From 0c8057924f34de84bc348a86d433ce86eeeec7ab Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 13 Sep 2019 21:58:26 +0300 Subject: [PATCH] lib/mergeset: properly check for sorted block headers Fix a typo for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/181 --- lib/mergeset/block_header.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mergeset/block_header.go b/lib/mergeset/block_header.go index 7ac7d86a3..6067a9e0e 100644 --- a/lib/mergeset/block_header.go +++ b/lib/mergeset/block_header.go @@ -158,7 +158,7 @@ func unmarshalBlockHeaders(dst []blockHeader, src []byte, blockHeadersCount int) newBHS := dst[dstLen:] // Verify that block headers are sorted by firstItem. - if !sort.SliceIsSorted(newBHS, func(i, j int) bool { return string(newBHS[i].firstItem) <= string(newBHS[j].firstItem) }) { + if !sort.SliceIsSorted(newBHS, func(i, j int) bool { return string(newBHS[i].firstItem) < string(newBHS[j].firstItem) }) { return nil, fmt.Errorf("block headers must be sorted by firstItem; unmarshaled unsorted block headers: %#v", newBHS) }