[SERVER-36897] OplogReader.hasNext can return false -> true, confusing `checkOplogs` Created: 27/Aug/18 Updated: 29/Oct/23 Resolved: 19/Sep/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | 4.0.1, 4.1.3 |
| Fix Version/s: | 4.0.3, 4.1.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Daniel Gottlieb (Inactive) | Assignee: | David Bradford (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v4.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | replsets/too_stale_secondary.js fails with the following patch:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | TIG 2018-09-24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Story Points: | 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
`ReplSetTest.checkOplog` will establish a reverse table scanning cursor on the oplog from each node, then "BFS" to compare the oplog for consistency. It will first get the latest entry in each oplog and perform a comparison, then advance all of the cursors and compare again. It allows the oplogs to have a different number of entries, so long as they match on the latest entries. To do so, checkOplog relies on OplogReader.hasNext to always return false after it has done so for the first time. However, if the call that executes the query receives a CappedPositionLost (thus not instantiating the shell's internal _cursor, a follow-up OplogReader.hasNext can return true, having re-issued the find and receiving a batch from the oplog starting at the latest entry. |
| Comments |
| Comment by Githook User [ 19/Sep/18 ] |
|
Author: {'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}Message: (cherry picked from commit 86d7a754bd72f055445968f4de92c60ae7b8ae70) |
| Comment by Githook User [ 19/Sep/18 ] |
|
Author: {'name': 'David Bradford', 'email': 'david.bradford@mongodb.com', 'username': 'dbradf'}Message: |
| Comment by David Bradford (Inactive) [ 14/Sep/18 ] |
|
I was already working in area in |