diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2020-03-11 18:29:23 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-11 23:13:38 +0000 |
commit | 90eefa051e6015514dcc6256d0f42b76bf041a76 (patch) | |
tree | 734352949bfc4a13ef69493616acbc05aae2306a /src/mongo/db/s/cleanup_orphaned_cmd.cpp | |
parent | abd4c261113bb98cbacef3db12d48b38344b5399 (diff) | |
download | mongo-90eefa051e6015514dcc6256d0f42b76bf041a76.tar.gz |
SERVER-46395 Ensure range deletion task document exists during deletion.
Changes the range deletion task to guarantee a batch of documents can
only be removed while the corresponding range deletion task document
exists. If the range deletion task document doesn't exist or a stepdown
could lead to it not existing, then the range deletion task is
abandoned.
Changes the deletion of the range deletion task document to use the _id
index of the config.rangeDeletions collection rather than being a
collection scan.
Diffstat (limited to 'src/mongo/db/s/cleanup_orphaned_cmd.cpp')
-rw-r--r-- | src/mongo/db/s/cleanup_orphaned_cmd.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp index 2404ff36f5e..7aa97cd3e64 100644 --- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp +++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp @@ -114,7 +114,8 @@ CleanupResult cleanupOrphanedData(OperationContext* opCtx, *stoppedAtKey = targetRange->getMax(); - cleanupCompleteFuture = css->cleanUpRange(*targetRange, CollectionShardingRuntime::kNow); + cleanupCompleteFuture = + css->cleanUpRange(*targetRange, boost::none, CollectionShardingRuntime::kNow); } // Sleep waiting for our own deletion. We don't actually care about any others, so there is no |