diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-01-26 13:27:19 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-01-26 18:45:57 -0500 |
commit | 084109075e885bb967addd0b7ed929791a4eaea6 (patch) | |
tree | 9fe70dfed684273f9ea3948c4b8d9e1cf57d4c83 /src | |
parent | bd4956d96e195e7a0072fd87e3793e4f442f92af (diff) | |
download | mongo-084109075e885bb967addd0b7ed929791a4eaea6.tar.gz |
SERVER-17037 syncApply should reset the current op in the beginning
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index e09d2e706c5..954eba9b2b1 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -119,12 +119,17 @@ namespace repl { /* apply the log op that is in param o @return bool success (true) or failure (false) */ - bool SyncTail::syncApply( - OperationContext* txn, const BSONObj &op, bool convertUpdateToUpsert) { + bool SyncTail::syncApply(OperationContext* txn, + const BSONObj &op, + bool convertUpdateToUpsert) { + if (inShutdown()) { return true; } + // Count each log op application as a separate operation, for reporting purposes + txn->getCurOp()->reset(); + const char *ns = op.getStringField("ns"); verify(ns); @@ -180,7 +185,6 @@ namespace repl { } Client::Context ctx(txn, ns); - ctx.getClient()->curop()->reset(); if ( createCollection == 0 && !isIndexBuild && |