REP-6882 Track mismatch length #186
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One of this tool’s longstanding pain points is that it is quite common for mismatches to appear in only 1 generation. Because of this it’s not been feasible to distinguish “real” mismatches from “ephemeral” ones.
This changeset teaches Migration Verifier to track how long a given mismatch has been seen. It does so by recording the mismatch’s first-seen & latest-seen time; the delta between those times is the mismatch’s “duration”. We now log that value as part of the table of mismatches, and we sort the mismatches on it (descending). Thus, the top line in the mismatch table is the longest-lived mismatch, which is the one most likely to warrant manual intervention.
This makes no effort to hide “ephemeral” mismatches because determining what counts as “ephemeral” requires knowledge of how far behind the replicator (e.g., mongosync) lags the source cluster. If the lag is 30 minutes, for example, then ideally the logs would hide (or, at least, just mention without surfacing) any mismatch newer than that lag time. This is a possible area for follow-up improvement.