From 83e855895579e6e676603a2855d550a33a4aca46 Mon Sep 17 00:00:00 2001 From: Dan Larkin-York Date: Fri, 2 Apr 2021 19:14:27 +0000 Subject: SERVER-55743 Replace invalid invariant in BucketCatalog::abort --- src/mongo/db/timeseries/bucket_catalog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mongo/db/timeseries/bucket_catalog.cpp b/src/mongo/db/timeseries/bucket_catalog.cpp index ecbd9dd888b..7035cf36beb 100644 --- a/src/mongo/db/timeseries/bucket_catalog.cpp +++ b/src/mongo/db/timeseries/bucket_catalog.cpp @@ -285,8 +285,13 @@ void BucketCatalog::finish(std::shared_ptr batch, const CommitInfo& void BucketCatalog::abort(std::shared_ptr batch) { invariant(batch); - invariant(!batch->finished()); invariant(batch->_commitRights.load()); + + if (batch->finished()) { + invariant(batch->getResult().getStatus() == ErrorCodes::TimeseriesBucketCleared); + return; + } + Bucket* bucket = batch->bucket(); // Before we access the bucket, make sure it's still there. -- cgit v1.2.1