ambry
ambry copied to clipboard
BlobStoreStats returns valid log segment size map in the wrong order
BlobStoreStats has a function to get size by log segment. The return type is a NavigableMap but the sort order in the map is incorrect. This causes DefaultCompactionPolicy to pick the wrong segments.
The sort order needs to be fixed by using LogSegmentNameHelper.COMPARATOR
For example, segments with names 1_0, 2_0 and 10_0 should be sorted in that order but the returned Map has them in natural String sort order i.e. 1_0, 10_0 2_0
#721 fixes the bug but tests to test this scenario need to be added to BlobStoreStats