summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/tenant_migration_donor_cmds.cpp
diff options
context:
space:
mode:
authorAndrew Shuvalov <andrew.shuvalov@mongodb.com>2021-02-03 01:02:54 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-11 01:54:38 +0000
commitdb4c86fb6f59d81a8b74cff41096b9ee6066fe30 (patch)
tree7faa59cbdfcc465aa7adde2b732a75b130cc9c70 /src/mongo/db/commands/tenant_migration_donor_cmds.cpp
parent8aea774eb7a9bb4774dcd202eef97814a9a46cc6 (diff)
downloadmongo-db4c86fb6f59d81a8b74cff41096b9ee6066fe30.tar.gz
SERVER-53950: fix ASAN errors when migration recipient is stuck on step down
Diffstat (limited to 'src/mongo/db/commands/tenant_migration_donor_cmds.cpp')
-rw-r--r--src/mongo/db/commands/tenant_migration_donor_cmds.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/commands/tenant_migration_donor_cmds.cpp b/src/mongo/db/commands/tenant_migration_donor_cmds.cpp
index 1570f370213..5e239bbe97d 100644
--- a/src/mongo/db/commands/tenant_migration_donor_cmds.cpp
+++ b/src/mongo/db/commands/tenant_migration_donor_cmds.cpp
@@ -98,12 +98,14 @@ public:
auto durableState = [&] {
try {
return donor->getDurableState(opCtx);
- } catch (ExceptionFor<ErrorCodes::ConflictingOperationInProgress>&) {
+ } catch (ExceptionFor<ErrorCodes::ConflictingOperationInProgress>& ex) {
// The conflict is discovered while inserting the donor instance's state doc.
// This implies that there is no other instance with the same migrationId, but
// there is another instance with the same tenantId. Therefore, the instance
// above was created by this command, so remove it.
- donorService->releaseInstance(stateDocBson["_id"].wrap());
+ // The status from this exception will be passed to the instance interrupt()
+ // method.
+ donorService->releaseInstance(stateDocBson["_id"].wrap(), ex.toStatus());
throw;
}
}();