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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
startIterator is not-null only in the oplog case. _readUntilForOplog is not-null in oplog case and when this is a forward iterator.
So what this fix does is make sure we only use the
startIterator
optimization in forward cursors, and not in backward cursor. Is that what you are trying to do? That seems like a good thing to do, although I don't fully understand the test failures mentioned in #107 to say with confidence that this fix will solve the problem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was to leave this hack for both forward and backward cursors but to remove it for non-oplog capped collections. Frankly speaking, I don't know how this fixes CheckReplOplog - this was just a guess.
After quick code analysis i think
_readUntilForOplog
can be not-null for backward cursors too. Are you sure it cannot?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-oplog capped collections will definitely have startIterator as null, right? See here: https://github.com/mongodb-partners/mongo-rocks/blob/master/src/rocks_record_store.cpp#L772