summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/apply_ops.cpp
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2018-09-13 18:14:58 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2018-09-13 18:32:46 -0400
commitb7c2a87a3d0c0395be5ab366dcff49c23ae88a57 (patch)
treeb53f13ed63334bc5a431f12381704bb78c19e1e7 /src/mongo/db/repl/apply_ops.cpp
parent6ff9e1ee65c95a1ba904862b445607a73822a67e (diff)
downloadmongo-b7c2a87a3d0c0395be5ab366dcff49c23ae88a57.tar.gz
SERVER-35307 Fix unused varialbe compile errors on some platforms.
Diffstat (limited to 'src/mongo/db/repl/apply_ops.cpp')
-rw-r--r--src/mongo/db/repl/apply_ops.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/repl/apply_ops.cpp b/src/mongo/db/repl/apply_ops.cpp
index ee458fa7cb3..622b0a0eb64 100644
--- a/src/mongo/db/repl/apply_ops.cpp
+++ b/src/mongo/db/repl/apply_ops.cpp
@@ -286,11 +286,15 @@ Status _applyPrepareTransaction(OperationContext* opCtx,
// Abort transaction unconditionally for now.
// TODO: SERVER-35875 / SERVER-35877 Abort or commit transactions on secondaries accordingly.
- ScopeGuard abortGuard = MakeGuard([&] { transaction->abortActiveTransaction(opCtx); });
+ ON_BLOCK_EXIT([&] { transaction->abortActiveTransaction(opCtx); });
- _applyOps(
+ auto status = _applyOps(
opCtx, dbName, applyOpCmd, info, oplogApplicationMode, result, numApplied, opsBuilder);
+ if (!status.isOK()) {
+ return status;
+ }
transaction->prepareTransaction(opCtx, optime);
+
return Status::OK();
}