ambry icon indicating copy to clipboard operation
ambry copied to clipboard

BlobStoreStats returns valid log segment size map in the wrong order

Open vgkholla opened this issue 8 years ago • 1 comments

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

vgkholla avatar Aug 03 '17 22:08 vgkholla

#721 fixes the bug but tests to test this scenario need to be added to BlobStoreStats

vgkholla avatar Aug 09 '17 23:08 vgkholla