mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
fix data race
This commit is contained in:
parent
1b068f75a8
commit
1409ab5664
1 changed files with 5 additions and 2 deletions
7
field.go
7
field.go
|
|
@ -1490,7 +1490,10 @@ func (f *Field) importValue(columnIDs []uint64, values []int64, options *ImportO
|
|||
requiredDepth = v
|
||||
}
|
||||
// Increase bit depth if required.
|
||||
if requiredDepth > bsig.BitDepth {
|
||||
f.mu.RLock()
|
||||
bitDepth := bsig.BitDepth
|
||||
f.mu.RUnlock()
|
||||
if requiredDepth > bitDepth {
|
||||
if err := func() error {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
|
|
@ -1501,7 +1504,7 @@ func (f *Field) importValue(columnIDs []uint64, values []int64, options *ImportO
|
|||
return errors.Wrap(err, "increasing bsi bit depth")
|
||||
}
|
||||
} else {
|
||||
requiredDepth = bsig.BitDepth
|
||||
requiredDepth = bitDepth
|
||||
}
|
||||
|
||||
// Import into each fragment.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue