mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
Add (temporary, perhaps) locking on TestTx_CountRange
On roaring, CountRange needs to have exclusive access to a fragment, but doesn't currently require a lock, because it's usually used from inside other already-locked things.
This commit is contained in:
parent
de14762661
commit
0952db5af7
1 changed files with 5 additions and 0 deletions
|
|
@ -81,6 +81,11 @@ func TestTx_CountRange(t *testing.T) {
|
|||
f, tx := requireCountRangeSampleData(t)
|
||||
defer f.Clean(t)
|
||||
defer tx.Rollback()
|
||||
// CountRange accesses the fragment without locking. Normally we only
|
||||
// call it from inside a fragment routine with locking. Otherwise, you
|
||||
// can have a race condition with snapshots, for instance.
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
|
||||
expected := uint64(0)
|
||||
j := uint64(0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue