summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/range_deletion_util.h
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2020-03-11 18:29:23 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-11 23:13:38 +0000
commit90eefa051e6015514dcc6256d0f42b76bf041a76 (patch)
tree734352949bfc4a13ef69493616acbc05aae2306a /src/mongo/db/s/range_deletion_util.h
parentabd4c261113bb98cbacef3db12d48b38344b5399 (diff)
downloadmongo-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/range_deletion_util.h')
-rw-r--r--src/mongo/db/s/range_deletion_util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/s/range_deletion_util.h b/src/mongo/db/s/range_deletion_util.h
index 6dc679bb226..a1f66b78578 100644
--- a/src/mongo/db/s/range_deletion_util.h
+++ b/src/mongo/db/s/range_deletion_util.h
@@ -30,6 +30,8 @@
#include <list>
+#include <boost/optional.hpp>
+
#include "mongo/db/namespace_string.h"
#include "mongo/executor/task_executor.h"
#include "mongo/s/catalog/type_chunk.h"
@@ -68,6 +70,7 @@ SharedSemiFuture<void> removeDocumentsInRange(
const UUID& collectionUuid,
const BSONObj& keyPattern,
const ChunkRange& range,
+ boost::optional<UUID> migrationId,
int numDocsToRemovePerBatch,
Seconds delayForActiveQueriesOnSecondariesToComplete,
Milliseconds delayBetweenBatches);