summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/primary_only_service.h
diff options
context:
space:
mode:
authorCheahuychou Mao <cheahuychou.mao@mongodb.com>2020-09-15 00:29:36 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-17 17:15:43 +0000
commitb9841ae3e9c2772e1c5d2705448f6e5528599596 (patch)
treeb7c28401168f2c26b8900a7add5333e75d78c8d7 /src/mongo/db/repl/primary_only_service.h
parentbc4059e8ad9828396fdb4e86d8210422751492ec (diff)
downloadmongo-b9841ae3e9c2772e1c5d2705448f6e5528599596.tar.gz
SERVER-50939 Ensure that PrimaryOnlyService Instances unblock any dependent work during stepdown or shutdown
Diffstat (limited to 'src/mongo/db/repl/primary_only_service.h')
-rw-r--r--src/mongo/db/repl/primary_only_service.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/repl/primary_only_service.h b/src/mongo/db/repl/primary_only_service.h
index 664ecd9fa11..4d8ccb5f74c 100644
--- a/src/mongo/db/repl/primary_only_service.h
+++ b/src/mongo/db/repl/primary_only_service.h
@@ -106,6 +106,13 @@ public:
virtual SemiFuture<void> run(
std::shared_ptr<executor::ScopedTaskExecutor> executor) noexcept = 0;
+ /**
+ * This is the function that is called when this running Instance needs to be interrupted.
+ * It should unblock any work managed by this Instance by, for example, emplacing the given
+ * error into any unresolved promises that the Instance manages.
+ */
+ virtual void interrupt(Status status) = 0;
+
private:
bool _running = false;