summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-12-30 17:01:13 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-12-30 17:09:28 -0500
commite49a2a16fb4b337d7ed1b0ec8d766f281741d8bf (patch)
tree7f0cac8cb50e56819bfe2546a525076976b1e193 /src/mongo/db/operation_context.cpp
parent715e9e1cdc618dad480a7a1a73458daf6ea9ce0f (diff)
downloadmongo-e49a2a16fb4b337d7ed1b0ec8d766f281741d8bf.tar.gz
SERVER-22027 Sharding should not retry killed operations
This change introduces a different interruption code (11602) which will be used to kill operations during replication primary stepdown so the config server retry logic can differentiate them from user-killed operations.
Diffstat (limited to 'src/mongo/db/operation_context.cpp')
-rw-r--r--src/mongo/db/operation_context.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/operation_context.cpp b/src/mongo/db/operation_context.cpp
index 1b79dadcb50..1434ee5ddc7 100644
--- a/src/mongo/db/operation_context.cpp
+++ b/src/mongo/db/operation_context.cpp
@@ -46,12 +46,13 @@ Client* OperationContext::getClient() const {
return _client;
}
-void OperationContext::markKilled() {
- _killPending.store(1);
+void OperationContext::markKilled(ErrorCodes::Error killCode) {
+ invariant(killCode != ErrorCodes::OK);
+ _killCode.compareAndSwap(ErrorCodes::OK, killCode);
}
-bool OperationContext::isKillPending() const {
- return _killPending.loadRelaxed();
+ErrorCodes::Error OperationContext::getKillStatus() const {
+ return _killCode.loadRelaxed();
}
} // namespace mongo