summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2015-11-18 15:13:52 -0500
committerBenety Goh <benety@mongodb.com>2015-12-11 10:45:42 -0500
commited2df219c7301f9b8d065dfe7e7acee526857983 (patch)
tree7a87639907c9c3f7786a964379fd50295119d6e3
parent45d232d316c583a20f1a79700656981f65fd01aa (diff)
downloadmongo-ed2df219c7301f9b8d065dfe7e7acee526857983.tar.gz
SERVER-21847 log range of oplog entries read from sync source
(cherry picked from commit 819f0b95bf87dc6598fa51991de8e04ceaad75c1)
-rw-r--r--src/mongo/db/repl/bgsync.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp
index b8b0278b890..d55a0c58528 100644
--- a/src/mongo/db/repl/bgsync.cpp
+++ b/src/mongo/db/repl/bgsync.cpp
@@ -359,7 +359,8 @@ void BackgroundSync::_produce(OperationContext* txn) {
metadataObj,
_replCoord->getConfig().getElectionTimeoutPeriod());
- LOG(1) << "scheduling fetcher to read remote oplog on " << source;
+ LOG(1) << "scheduling fetcher to read remote oplog on " << source << " starting at "
+ << cmdObj["filter"];
auto scheduleStatus = fetcher.schedule();
if (!scheduleStatus.isOK()) {
warning() << "unable to schedule fetcher to read remote oplog on " << source << ": "
@@ -447,6 +448,14 @@ void BackgroundSync::_fetcherCallback(const StatusWith<Fetcher::QueryResponse>&
auto firstDocToApply = documents.cbegin();
auto lastDocToApply = documents.cend();
+ if (!documents.empty()) {
+ LOG(2) << "fetcher read " << documents.size()
+ << " operations from remote oplog starting at " << documents.front()["ts"]
+ << " and ending at " << documents.back()["ts"];
+ } else {
+ LOG(2) << "fetcher read 0 operations from remote oplog";
+ }
+
// Check start of remote oplog and, if necessary, stop fetcher to execute rollback.
if (queryResponse.first) {
auto getNextOperation = [&firstDocToApply, lastDocToApply]() -> StatusWith<BSONObj> {