summaryrefslogtreecommitdiffstats
path: root/storage/src/tests/distributor/mergeoperationtest.cpp
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2020-12-11 14:08:38 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2020-12-11 15:11:11 +0000
commitaa28f51fd49151f75934bf5e710c5c0ebae2ab8d (patch)
treed38e028dc86a727b9210092a87ac1caaee30f4e0 /storage/src/tests/distributor/mergeoperationtest.cpp
parentad78803b272498eda8432fde136230ff0fdc5969 (diff)
Only let reindexing puts through locked bucket if their token matches that of the lock
Avoids race condition edge case where reindexing puts from an outdated visitor may pass through a bucket lock intended for a newly created visitor operation Tokens are 128-bit values derived from a CSPRNG, so uniqueness is for all intents and purposes guaranteed.
Diffstat (limited to 'storage/src/tests/distributor/mergeoperationtest.cpp')
-rw-r--r--storage/src/tests/distributor/mergeoperationtest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/src/tests/distributor/mergeoperationtest.cpp b/storage/src/tests/distributor/mergeoperationtest.cpp
index 852c2ef8754..90fcf40b3fe 100644
--- a/storage/src/tests/distributor/mergeoperationtest.cpp
+++ b/storage/src/tests/distributor/mergeoperationtest.cpp
@@ -422,7 +422,7 @@ TEST_F(MergeOperationTest, merge_operation_is_blocked_by_locked_bucket) {
op.setIdealStateManager(&getIdealStateManager());
EXPECT_FALSE(op.isBlocked(*_pendingTracker, _operation_sequencer));
- auto token = _operation_sequencer.try_acquire(makeDocumentBucket(document::BucketId(16, 1)));
+ auto token = _operation_sequencer.try_acquire(makeDocumentBucket(document::BucketId(16, 1)), "foo");
EXPECT_TRUE(token.valid());
EXPECT_TRUE(op.isBlocked(*_pendingTracker, _operation_sequencer));
}