[SERVER-20260] New indexes should bump their Collection's minimum SnapshotName Created: 02/Sep/15 Updated: 23/Feb/18 Resolved: 17/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 3.1.7 |
| Fix Version/s: | 3.1.9 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Michael Grundy | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Steps To Reproduce: | jstest attached. |
||||||||||||||||||||
| Sprint: | Quint 9 09/18/15 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
This is a temporary solution to ensure that indexes created with w:majority are guaranteed to be usable to a read using majority readConcern level. Currently w:majority only waits for the OpTime and does not wait for the SnapshotName set on the Client. This means that it is possible for an index to be in the committed snapshot but not usable to queries since they are using a too old SnapshotName. The changes for this ticket will be made unnessesary once we complete the work of reunifying OpTime and SnapshotName for Original title: Running count with readConcern majority and a hint errors Original description: Here is the dbCommand object:
And the log output with the error.
|
| Comments |
| Comment by Githook User [ 17/Sep/15 ] |
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: This is a temporary solution to ensure that indexes created with w:majority |
| Comment by Eric Milkie [ 15/Sep/15 ] |
|
Why didn't |
| Comment by Mathias Stearn [ 15/Sep/15 ] |
|
Unfortunately, even on a single local node, w:majority only waits for the OpTime since the SnapshotName is stripped off before calling into the ReplicationCoordinator::awaitReplication(). Currently the only way to wait for both is to call ReplicationCoordinator::awaitReplicationOfLastOpForClient(), but that is only used by the RangeDeleter, not any user-initiated w:majority actions. |
| Comment by Eric Milkie [ 15/Sep/15 ] |
|
I'm not sure the attached jstests is representative of the problem as described; it doesn't use sharding or mongos. |
| Comment by Mathias Stearn [ 11/Sep/15 ] |
|
Replaced title and description with plan of action. |
| Comment by Eric Milkie [ 02/Sep/15 ] |
|
redbeard0531 Sounds plausible. |
| Comment by Mathias Stearn [ 02/Sep/15 ] |
|
milkie I think when we reserve a SnapshotName we need to add that to the Clients ReplInfo so it knows to wait for it. |
| Comment by Michael Grundy [ 02/Sep/15 ] |
|
Adding w:majority to the index build didn't fix it. Is it possible that w:majority on an index build isn't working? If I toss a sleep in, it will pass. |
| Comment by Eric Milkie [ 02/Sep/15 ] |
|
For this, does it fix the test if you do w:majority on the index build? Otherwise, it won't wait long enough for the index build to be present in the read level majority snapshot, so you would get "bad hint" since it doesn't see the index you specified. |