diff options
-rw-r--r-- | src/mongo/db/timeseries/bucket_catalog/bucket_catalog.cpp | 18 |
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; |