diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2014-05-01 13:33:47 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2014-05-05 04:43:36 -0400 |
commit | ac19e03a1c66037e17e6f057c0a0bb004b2a3977 (patch) | |
tree | ea2e9062a5f3ee271931f165c890e06a82fc004e /src/mongo/db | |
parent | 165f5e4a2f20f333b158db2ac7aa7bc31bfe904f (diff) | |
download | mongo-ac19e03a1c66037e17e6f057c0a0bb004b2a3977.tar.gz |
more rollback4.js debuggery
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/bgsync.h | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/sync_tail.cpp | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/mongo/db/repl/bgsync.h b/src/mongo/db/repl/bgsync.h index dd2fed481ad..cff97b2e923 100644 --- a/src/mongo/db/repl/bgsync.h +++ b/src/mongo/db/repl/bgsync.h @@ -111,9 +111,9 @@ namespace replset { // restart syncing void start(); + public: bool isAssumingPrimary(); - public: static BackgroundSync* get(); static void shutdown(); static void notify(); diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index 53fdbb74387..85c90970129 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -237,7 +237,7 @@ namespace replset { } } setOplogVersion(ops.getDeque().front()); - + multiApply(ops.getDeque(), func); n += ops.getDeque().size(); @@ -377,8 +377,18 @@ namespace replset { // if we should crash and restart before updating the oplog theReplSet->setMinValid(lastOp); + if (BackgroundSync::get()->isAssumingPrimary()) { + LOG(1) << "about to apply batch up to optime: " + << ops.getDeque().back()["ts"]._opTime().toStringPretty(); + } + multiApply(ops.getDeque(), multiSyncApply); + if (BackgroundSync::get()->isAssumingPrimary()) { + LOG(1) << "about to update oplog to optime: " + << ops.getDeque().back()["ts"]._opTime().toStringPretty(); + } + applyOpsToOplog(&ops.getDeque()); // If we're just testing (no manager), don't keep looping if we exhausted the bgqueue @@ -474,6 +484,10 @@ namespace replset { } } + if (BackgroundSync::get()->isAssumingPrimary()) { + LOG(1) << "notifying BackgroundSync"; + } + // Update write concern on primary BackgroundSync::notify(); } |