diff options
author | Benety Goh <benety@mongodb.com> | 2020-10-26 10:43:09 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-26 18:01:32 +0000 |
commit | f8594ceefa7254f2d20d6cf1e0222ad568c03f39 (patch) | |
tree | f720b67f32e3a8ec80c5190a7b9e6d019f06097e /src/mongo/db/system_index.cpp | |
parent | 55b997d754887aba313be309554153ddc26f2cbf (diff) | |
download | mongo-f8594ceefa7254f2d20d6cf1e0222ad568c03f39.tar.gz |
SERVER-50031 createSystemIndexes should allow WriteConflictExceptions to escape
Diffstat (limited to 'src/mongo/db/system_index.cpp')
-rw-r--r-- | src/mongo/db/system_index.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/system_index.cpp b/src/mongo/db/system_index.cpp index 6f3ad2a4410..b08598d0f51 100644 --- a/src/mongo/db/system_index.cpp +++ b/src/mongo/db/system_index.cpp @@ -41,6 +41,7 @@ #include "mongo/db/catalog/commit_quorum_options.h" #include "mongo/db/catalog/index_catalog.h" #include "mongo/db/catalog/index_key_validate.h" +#include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/db_raii.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/index_builds_coordinator.h" @@ -220,6 +221,8 @@ void createSystemIndexes(OperationContext* opCtx, CollectionWriter& collection) try { IndexBuildsCoordinator::get(opCtx)->createIndexesOnEmptyCollection( opCtx, collection, {indexSpec}, fromMigrate); + } catch (WriteConflictException&) { + throw; } catch (DBException& ex) { fassertFailedWithStatus(40456, ex.toStatus()); } |