make sure frag.maxRow() call is lock-protected

This commit is contained in:
Travis 2020-04-02 23:12:08 -05:00
parent 632f6856ab
commit b4f1781d30

View file

@ -1843,8 +1843,10 @@ func (f *Field) importRoaringOverwrite(ctx context.Context, data []byte, shard u
// and bsiGroup.BitDepth based on the imported data.
switch f.Options().Type {
case FieldTypeInt, FieldTypeDecimal:
frag.mu.Lock()
frag.calculateMaxRowID()
maxRowID, _ := frag.maxRow(nil)
frag.mu.Unlock()
var bitDepth uint
if maxRowID+1 > bsiOffsetBit {