summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuhong Zhang <34732434+YuhongZhang98@users.noreply.github.com>2023-02-09 22:07:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-10 00:50:44 +0000
commit66d62e802b3e952b73daf61545fd31158f198189 (patch)
tree703fe63290817dfe28f1573464756227da051202
parent6b19e54d461bab075ade6e3e05767a881ee37597 (diff)
downloadmongo-66d62e802b3e952b73daf61545fd31158f198189.tar.gz
SERVER-73830 Handle buckets pending direct writes when retrieving alternate buckets
-rw-r--r--src/mongo/db/timeseries/bucket_catalog/bucket_catalog.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/db/timeseries/bucket_catalog/bucket_catalog.cpp b/src/mongo/db/timeseries/bucket_catalog/bucket_catalog.cpp
index 4019e73df3d..57c569e7d31 100644
--- a/src/mongo/db/timeseries/bucket_catalog/bucket_catalog.cpp
+++ b/src/mongo/db/timeseries/bucket_catalog/bucket_catalog.cpp
@@ -746,15 +746,15 @@ Bucket* BucketCatalog::_useAlternateBucket(Stripe* stripe,
return potentialBucket;
}
- // If we still have an entry for the bucket in the open set, but it conflicts with
- // insertion, then it must have been cleared, and we can clean it up.
- invariant(state.value().isSet(BucketStateFlag::kCleared));
- _abort(stripe,
- stripeLock,
- potentialBucket,
- nullptr,
- getTimeseriesBucketClearedError(potentialBucket->bucketId.ns,
- potentialBucket->bucketId.oid));
+ // Clean up the bucket if it has been cleared.
+ if (state.value().isSet(BucketStateFlag::kCleared)) {
+ _abort(stripe,
+ stripeLock,
+ potentialBucket,
+ nullptr,
+ getTimeseriesBucketClearedError(potentialBucket->bucketId.ns,
+ potentialBucket->bucketId.oid));
+ }
}
return nullptr;