[SERVER-27493] Reverse oplog cursors can return early on wiredtiger in 3.0 Created: 21/Dec/16  Updated: 06/Dec/17  Resolved: 06/Feb/17

Status: Closed
Project: Core Server
Component/s: Replication, Storage
Affects Version/s: 3.0.11
Fix Version/s: 3.0.15

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-20669 Unable to init mongodb node: rollback... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage 2017-02-13
Participants:

 Description   

In 3.0, on WiredTiger, if you do a reverse natural order query on the oplog, it's possible that it returns only 1 document, even when the oplog has many entries. This can happen if the newest entry is visible, but the second newest entry is not yet visible. When we encounter a hidden entry in a reverse collection scan, we simply return EOF, as though we had hit the beginning of the collection. This can cause issues where rollback fails to complete and hits an fassert, since if the node rolling back does a reverse oplog query against its sync source and that cursor returns that there are no more entries, it assumes we hit the beginning of the sync source's oplog and thus that we have falling too far behind to recover.



 Comments   
Comment by Githook User [ 06/Feb/17 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-27493 do not enforce oplog visibility hack for reverse cursors
Branch: v3.0
https://github.com/mongodb/mongo/commit/7e198e2d9fbce530b34a6353e2b7af642b6ca971

Comment by Spencer Brody (Inactive) [ 21/Dec/16 ]

On newer versions of MongoDB this has been fixed by the various work done around oplog visibility, which culminated in the work redbeard0531 did in SERVER-26685.
It should be possible to fix this on 3.0, however, without backporting the full oplog visibility fixes, we simply need to change the code that applies oplog visibility rules to only do so for forward scans, not for reverse scans.

Generated at Thu Feb 08 04:15:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.