Add new 'simple' oplog tailer method #301
Merged
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.
Adds a new "simple" method for collecting oplogs needed to construct
a consistent backup. It implements an algorithm similar to what mongodump
--oplog already does, albeit for multiple shards.
It does not begin tailing the oplogs for all shards at the beginning
of the backup. Instead, it runs mongodump for all shards and waits until
they have all finished.
Then it collects the delta between when each shard's dump ended and the time
when the last one finished.
The following stages, especially the Resolver, which brings all shard's
oplogs forward to a consistent point in time, are unchanged.
Rationale for this addition:
With the existing "tailer" approach, our backups very often failed with the
error message "Tailer host changed". This appears to be a common problem
with oplog tailing in general, judging from what you can find on the internet.
It appears that for some reason the oplog tailing cursors get aborted by
mongod with an error stating
"operation exceeded time limit", code: 50
.With this new simpler oplog fetching method, that apparently does not happen.
The most important difference/drawback compared to the current tailer is that
the simple approach fails if the oplog of one of the shards is so busy that
by the time the deltas are to be collected it has rolled over, so that
operations are no longer available. This, however, will only be the case
on very busy systems where one might argue the oplog size should be increased
anyway.
In general the simple method should be a little less resource intensive, because
there is not additional I/O while mongodumps are runnig.
This change is backwards compatbile for callers. To use the new method, a new
configuration parameter needs to be specified:
--oplog.tailer.method simple
.The default value for this option is
tailer
which can also be explictly setto select the classic implementation.
Implementation Notes:
implementation was extracted into a new common base class "OplogTask".
make the code a little more readable, despite the additions.
spurious (harmless) error messages like the following when finishing: