Merge pull request #244 from travisturner/fix-race

make sure frag.maxRow() call is lock-protected
This commit is contained in:
Travis Turner 2020-04-02 23:52:38 -05:00 • committed by GitHub
commit 48879107b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 {