diff options
author | Josef Ahmad <josef.ahmad@mongodb.com> | 2023-04-04 12:15:17 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-04 13:07:44 +0000 |
commit | 806b58d5fac1b17d848b3c7c997b67b68440b2ba (patch) | |
tree | 59bd4047a8b07b7491549ad57b1598b9f763d176 /src/mongo/db/repl_index_build_state.h | |
parent | b7a17172c80bf156595ad3e9d92ea9ec900c03e2 (diff) | |
download | mongo-806b58d5fac1b17d848b3c7c997b67b68440b2ba.tar.gz |
SERVER-75308 Fix race between external and internal index build aborts
Diffstat (limited to 'src/mongo/db/repl_index_build_state.h')
-rw-r--r-- | src/mongo/db/repl_index_build_state.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/repl_index_build_state.h b/src/mongo/db/repl_index_build_state.h index eff7b0c976e..a1b4a1fe2bc 100644 --- a/src/mongo/db/repl_index_build_state.h +++ b/src/mongo/db/repl_index_build_state.h @@ -309,8 +309,12 @@ public: /** * Only for two-phase index builds. Requests the primary to abort the build, and transitions * into a waiting state. + * + * Returns true if the thread has transitioned into the waiting state. + * Returns false if the build is already in abort state. This can happen if the build detected + * an error while an external operation (e.g. a collection drop) is concurrently aborting it. */ - void requestAbortFromPrimary(const Status& abortStatus); + bool requestAbortFromPrimary(const Status& abortStatus); /** * Returns timestamp for committing this index build. |