diff options
author | Pierlauro Sciarelli <pierlauro.sciarelli@mongodb.com> | 2021-12-14 09:04:59 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-12-14 09:56:18 +0000 |
commit | 02be742d686fa668a8cc1d3d4d7c4f8fa678d521 (patch) | |
tree | 9552af5cce47ae9bc84c1b1b956cdbc8ec126817 | |
parent | 172eefd07a93db431d762e1ab017b21db9d10f9f (diff) | |
download | mongo-02be742d686fa668a8cc1d3d4d7c4f8fa678d521.tar.gz |
SERVER-61628 Do not reschedule range deletion task when orphans have been fully deleted
-rw-r--r-- | src/mongo/db/s/range_deletion_util.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/s/range_deletion_util.cpp b/src/mongo/db/s/range_deletion_util.cpp index eead72b9f0c..0e26c3aaff0 100644 --- a/src/mongo/db/s/range_deletion_util.cpp +++ b/src/mongo/db/s/range_deletion_util.cpp @@ -354,10 +354,10 @@ ExecutorFuture<void> deleteRangeInBatches(const std::shared_ptr<executor::TaskEx }, nss); }) - .until([](StatusWith<int> swNumDeleted) { + .until([=](StatusWith<int> swNumDeleted) { // Continue iterating until there are no more documents to delete, retrying on // any error that doesn't indicate that this node is stepping down. - return (swNumDeleted.isOK() && swNumDeleted.getValue() == 0) || + return (swNumDeleted.isOK() && swNumDeleted.getValue() < numDocsToRemovePerBatch) || swNumDeleted.getStatus() == ErrorCodes::RangeDeletionAbandonedBecauseCollectionWithUUIDDoesNotExist || swNumDeleted.getStatus() == |