summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2015-10-09 07:34:07 -0400
committermatt dannenberg <matt.dannenberg@10gen.com>2015-10-09 09:46:25 -0400
commit845a03d2224b3e5c75f950abe31f2bc0d7c860aa (patch)
tree029af5527ed19cd3cf4b43728e431c7d9f04b126 /src
parentc2ae70a7eb2ca553bc56b0d160722591aa7925ea (diff)
downloadmongo-845a03d2224b3e5c75f950abe31f2bc0d7c860aa.tar.gz
SERVER-20846 improve log message in shouldChangeSyncSource
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/repl/topology_coordinator_impl.cpp4
-rw-r--r--src/mongo/db/repl/topology_coordinator_impl_test.cpp6
-rw-r--r--src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/repl/topology_coordinator_impl.cpp b/src/mongo/db/repl/topology_coordinator_impl.cpp
index 3c493f0525c..739c523b853 100644
--- a/src/mongo/db/repl/topology_coordinator_impl.cpp
+++ b/src/mongo/db/repl/topology_coordinator_impl.cpp
@@ -2344,8 +2344,8 @@ bool TopologyCoordinatorImpl::shouldChangeSyncSource(const HostAndPort& currentS
(candidateConfig.shouldBuildIndexes() || !_selfConfig().shouldBuildIndexes()) &&
it->getState().readable() && !_memberIsBlacklisted(candidateConfig, now) &&
goalSecs < it->getOpTime().getSecs()) {
- log() << "changing sync target because current sync target's most recent OpTime is "
- << currentSourceOpTime.toString() << " which is more than "
+ log() << "re-evaluating sync source because our current sync source's most recent "
+ << "OpTime is " << currentSourceOpTime.toString() << " which is more than "
<< _options.maxSyncSourceLagSecs << " behind member "
<< candidateConfig.getHostAndPort().toString() << " whose most recent OpTime is "
<< it->getOpTime().toString();
diff --git a/src/mongo/db/repl/topology_coordinator_impl_test.cpp b/src/mongo/db/repl/topology_coordinator_impl_test.cpp
index 6560b87a814..0301abe215d 100644
--- a/src/mongo/db/repl/topology_coordinator_impl_test.cpp
+++ b/src/mongo/db/repl/topology_coordinator_impl_test.cpp
@@ -4227,7 +4227,7 @@ TEST_F(HeartbeatResponseTest, ShouldChangeSyncSourceFresherHappierMemberExists)
startCapturingLogMessages();
ASSERT_TRUE(getTopoCoord().shouldChangeSyncSource(HostAndPort("host2"), OpTime(), now()));
stopCapturingLogMessages();
- ASSERT_EQUALS(1, countLogLinesContaining("changing sync target"));
+ ASSERT_EQUALS(1, countLogLinesContaining("re-evaluating sync source"));
}
TEST_F(HeartbeatResponseTest, ShouldChangeSyncSourceFresherMemberIsBlackListed) {
@@ -4269,7 +4269,7 @@ TEST_F(HeartbeatResponseTest, ShouldChangeSyncSourceFresherMemberIsBlackListed)
startCapturingLogMessages();
ASSERT_TRUE(getTopoCoord().shouldChangeSyncSource(HostAndPort("host2"), OpTime(), now()));
stopCapturingLogMessages();
- ASSERT_EQUALS(1, countLogLinesContaining("changing sync target"));
+ ASSERT_EQUALS(1, countLogLinesContaining("re-evaluating sync source"));
}
TEST_F(HeartbeatResponseTest, ShouldChangeSyncSourceCurrentTargetNoLongerPrimary) {
@@ -4473,7 +4473,7 @@ TEST_F(HeartbeatResponseTest, ShouldChangeSyncSourceFresherMemberDoesNotBuildInd
startCapturingLogMessages();
ASSERT_TRUE(getTopoCoord().shouldChangeSyncSource(HostAndPort("host2"), OpTime(), now()));
stopCapturingLogMessages();
- ASSERT_EQUALS(1, countLogLinesContaining("changing sync target"));
+ ASSERT_EQUALS(1, countLogLinesContaining("re-evaluating sync source"));
}
TEST_F(TopoCoordTest, CheckShouldStandForElectionWithPrimary) {
diff --git a/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp b/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp
index 51c5f234c48..0e793a28bf9 100644
--- a/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp
+++ b/src/mongo/db/repl/topology_coordinator_impl_v1_test.cpp
@@ -2293,7 +2293,7 @@ TEST_F(HeartbeatResponseTestV1, ShouldChangeSyncSourceFresherMemberDoesNotBuildI
startCapturingLogMessages();
ASSERT_TRUE(getTopoCoord().shouldChangeSyncSource(HostAndPort("host2"), OpTime(), now()));
stopCapturingLogMessages();
- ASSERT_EQUALS(1, countLogLinesContaining("changing sync target"));
+ ASSERT_EQUALS(1, countLogLinesContaining("re-evaluating sync source"));
}
TEST_F(HeartbeatResponseTestV1, ShouldRespondNegativelyToPV0ElectionCommands) {
@@ -2449,7 +2449,7 @@ TEST_F(HeartbeatResponseTestV1, ShouldChangeSyncSourceFresherMemberIsBlackListed
startCapturingLogMessages();
ASSERT_TRUE(getTopoCoord().shouldChangeSyncSource(HostAndPort("host2"), OpTime(), now()));
stopCapturingLogMessages();
- ASSERT_EQUALS(1, countLogLinesContaining("changing sync target"));
+ ASSERT_EQUALS(1, countLogLinesContaining("re-evaluating sync source"));
}
TEST_F(HeartbeatResponseTestV1, ShouldChangeSyncSourceFresherHappierMemberExists) {
@@ -2480,7 +2480,7 @@ TEST_F(HeartbeatResponseTestV1, ShouldChangeSyncSourceFresherHappierMemberExists
startCapturingLogMessages();
ASSERT_TRUE(getTopoCoord().shouldChangeSyncSource(HostAndPort("host2"), OpTime(), now()));
stopCapturingLogMessages();
- ASSERT_EQUALS(1, countLogLinesContaining("changing sync target"));
+ ASSERT_EQUALS(1, countLogLinesContaining("re-evaluating sync source"));
}
TEST_F(HeartbeatResponseTestV1, ShouldChangeSyncSourceMemberHasYetToHeartbeat) {