Info
When looking for a sync source, if we consider a node but decide not to use it because it is behind us, we log a message that looks like:
2016-09-14T15:31:11.564+0000 D REPL
[rsBackgroundSync] Cannot select sync source behind our last applied optime: WIN-K6DURTQEFVN:20017
This message would be more useful if it included the optime of the node and the node it is considering syncing from.
Top User Comments
xgen-internal-githook commented on Mon, 24 Oct 2016 19:58:55 +0000:
Author:
{u'username': u'will62794', u'name': u'William Schultz', u'email': u'will627@comcast.net'}
Message: SERVER-26399 Improved "Cannot select sync source" messages to include the relevant optimes
Branch: master
https://github.com/mongodb/mongo/commit/eae94d70dbb93fd69435c411e714e06944060975
judah.schvimer commented on Fri, 14 Oct 2016 19:56:38 +0000:
This log message should also be corrected to say "Cannot select sync source that is equal to or behind our last applied optime". The line here is a less than or equal to operator, not a less than operator: https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/topology_coordinator_impl.cpp#L302 is:
if (it->getAppliedOpTime().getTimestamp() <= lastTimestampApplied) {
judah.schvimer commented on Fri, 30 Sep 2016 22:22:32 +0000:
"Cannot select sync source because it is too far behind" should also include the relevant optimes.
milkie commented on Fri, 30 Sep 2016 13:34:19 +0000:
Actually, I've noticed that that new message, which was written based on the variable names in that function, is incorrect. The optime passed to the function is actually the last optime fetched, not applied. So we should change both the message and the variable name there.