diff options
author | Erwin Pe <erwin.pe@mongodb.com> | 2022-08-01 14:48:46 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-01 15:39:57 +0000 |
commit | 3d49923b38176803e5c9e62edd8889137b3ac18f (patch) | |
tree | 763a22e093c72eac4a2ca47a1abc138c66b170e1 | |
parent | b795776ac3c1599528a5772825f16f88ecb5b1c9 (diff) | |
download | mongo-3d49923b38176803e5c9e62edd8889137b3ac18f.tar.gz |
SERVER-67909 Skip dropping a non-existent temp ECOC collection in the compact coordinator
-rw-r--r-- | src/mongo/db/s/compact_structured_encryption_data_coordinator.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mongo/db/s/compact_structured_encryption_data_coordinator.cpp b/src/mongo/db/s/compact_structured_encryption_data_coordinator.cpp index a76e7f07faf..836dde1bf79 100644 --- a/src/mongo/db/s/compact_structured_encryption_data_coordinator.cpp +++ b/src/mongo/db/s/compact_structured_encryption_data_coordinator.cpp @@ -48,6 +48,8 @@ namespace mongo { namespace { +MONGO_FAIL_POINT_DEFINE(fleCompactHangAfterDropTempCollection); + const auto kMajorityWriteConcern = BSON("writeConcern" << BSON("w" << "majority")); /** @@ -175,10 +177,21 @@ void doDropOperation(const CompactStructuredEncryptionDataState& state) { "Cannot drop temporary encrypted compaction collection due to missing collection UUID", state.getEcocRenameUuid().has_value()); + auto opCtx = cc().makeOperationContext(); + auto catalog = CollectionCatalog::get(opCtx.get()); auto ecocNss = state.getEcocRenameNss(); + auto ecocUuid = catalog->lookupUUIDByNSS(opCtx.get(), ecocNss); + + if (!ecocUuid) { + LOGV2_DEBUG( + 6790901, + 1, + "Skipping drop operation as temporary encrypted compaction collection does not exist"); + return; + } + Drop cmd(ecocNss); cmd.setCollectionUUID(state.getEcocRenameUuid().value()); - auto opCtx = cc().makeOperationContext(); doRunCommand(opCtx.get(), ecocNss.db(), cmd); } @@ -225,6 +238,10 @@ ExecutorFuture<void> CompactStructuredEncryptionDataCoordinator::_runImpl( _response = *_doc.getResponse(); } doDropOperation(_doc); + if (MONGO_unlikely(fleCompactHangAfterDropTempCollection.shouldFail())) { + LOGV2(6790902, "Hanging due to fleCompactHangAfterDropTempCollection fail point"); + fleCompactHangAfterDropTempCollection.pauseWhileSet(); + } })); } |