summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/multi_index_block.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-10-01 11:03:19 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-01 15:31:49 +0000
commit078aa203f8625c4e1227ffc4e316cea218eb15c9 (patch)
treef969a51c1d7f16580967c9f8138194a959b5b904 /src/mongo/db/catalog/multi_index_block.cpp
parentc1401d158b915996aacd0e43b666ca3f7b0e9305 (diff)
downloadmongo-078aa203f8625c4e1227ffc4e316cea218eb15c9.tar.gz
SERVER-51238 fix index build phase when aborting index build for rollback
Diffstat (limited to 'src/mongo/db/catalog/multi_index_block.cpp')
-rw-r--r--src/mongo/db/catalog/multi_index_block.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/multi_index_block.cpp b/src/mongo/db/catalog/multi_index_block.cpp
index db0f8ba47c1..62aaf35c57d 100644
--- a/src/mongo/db/catalog/multi_index_block.cpp
+++ b/src/mongo/db/catalog/multi_index_block.cpp
@@ -461,7 +461,8 @@ Status MultiIndexBlock::insertAllDocumentsInCollection(
n++;
}
} catch (DBException& ex) {
- if (ex.isA<ErrorCategory::Interruption>() || ex.isA<ErrorCategory::ShutdownError>()) {
+ if (ex.isA<ErrorCategory::Interruption>() || ex.isA<ErrorCategory::ShutdownError>() ||
+ ErrorCodes::IndexBuildAborted == ex.code()) {
// If the collection scan is stopped because due to an interrupt or shutdown event, we
// leave the internal state intact to ensure we have the correct information for
// resuming this index build during startup and rollback.