summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/resync.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/resync.cpp')
-rw-r--r--src/mongo/db/repl/resync.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/db/repl/resync.cpp b/src/mongo/db/repl/resync.cpp
index e45022440a3..848700d215a 100644
--- a/src/mongo/db/repl/resync.cpp
+++ b/src/mongo/db/repl/resync.cpp
@@ -72,7 +72,7 @@ public:
}
CmdResync() : Command(kResyncFieldName) {}
- virtual bool run(OperationContext* txn,
+ virtual bool run(OperationContext* opCtx,
const string& dbname,
BSONObj& cmdObj,
int,
@@ -100,16 +100,16 @@ public:
return appendCommandStatus(
result, Status(ErrorCodes::NotSecondary, "primaries cannot resync"));
}
- uassertStatusOKWithLocation(replCoord->resyncData(txn, waitForResync), "resync", 0);
+ uassertStatusOKWithLocation(replCoord->resyncData(opCtx, waitForResync), "resync", 0);
return true;
}
// Master/Slave resync.
- ScopedTransaction transaction(txn, MODE_X);
- Lock::GlobalWrite globalWriteLock(txn->lockState());
+ ScopedTransaction transaction(opCtx, MODE_X);
+ Lock::GlobalWrite globalWriteLock(opCtx->lockState());
// below this comment pertains only to master/slave replication
if (cmdObj.getBoolField("force")) {
- if (!waitForSyncToFinish(txn, errmsg))
+ if (!waitForSyncToFinish(opCtx, errmsg))
return false;
replAllDead = "resync forced";
}
@@ -118,16 +118,16 @@ public:
errmsg = "not dead, no need to resync";
return false;
}
- if (!waitForSyncToFinish(txn, errmsg))
+ if (!waitForSyncToFinish(opCtx, errmsg))
return false;
- ReplSource::forceResyncDead(txn, "client");
+ ReplSource::forceResyncDead(opCtx, "client");
result.append("info", "triggered resync for all sources");
return true;
}
- bool waitForSyncToFinish(OperationContext* txn, string& errmsg) const {
+ bool waitForSyncToFinish(OperationContext* opCtx, string& errmsg) const {
// Wait for slave thread to finish syncing, so sources will be be
// reloaded with new saved state on next pass.
Timer t;
@@ -135,7 +135,7 @@ public:
if (syncing.load() == 0 || t.millis() > 30000)
break;
{
- Lock::TempRelease t(txn->lockState());
+ Lock::TempRelease t(opCtx->lockState());
relinquishSyncingSome.store(1);
sleepmillis(1);
}