Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix random CheckReplOplog failures in 'passthough' test suites #107

Merged
merged 1 commit into from
Oct 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rocks_record_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ namespace mongo {
_currentSequenceNumber =
RocksRecoveryUnit::getRocksRecoveryUnit(opCtx)->snapshot()->GetSequenceNumber();

if (!startIterator.isNull()) {
if (!startIterator.isNull() && !_readUntilForOplog.isNull()) {
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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

// This is a hack to speed up first/last record retrieval from the oplog
_needFirstSeek = false;
_lastLoc = startIterator;
Expand Down