[SERVER-30977] Need to sign cluster times for unsharded replica sets Created: 06/Sep/17 Updated: 30/Oct/23 Resolved: 28/Sep/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Misha Tyulenev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | todo_in_code | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Sharding 2017-10-02 | ||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Imagine you have a node whose system clock is out of sync and ahead of the rest of the replica set. That node gets elected primary and takes a w:1 write and returns an operationTime of 500. Before that primary ever commits any writes in its term, however, it crashes and a new primary is elected. The new primary is only at clusterTime 100. If the client then sends afterClusterTime to the new primary, it will get an error that "readConcern afterClusterTime must not be greater than clusterTime value". Instead of getting an error, the new primary should perform a no-op write to advance its cluster time to 500. In order to do that, unsharded replica sets will need to sign and propagate a cluster time like shard servers do. 1. Refactor KeyCollectionManager:
d. Add KeysCollectionClientSharded that uses ShardingCatalogClient and KeysCollectionClientDirect that uses DBDirectClient to get and insert keys. 2. in db/db.cpp: construct KeysCollectionManager with KeysCollectionClientDirect when mongod is being started with a --replSet flag
3. enable/disable keys generation when the mongod node becomes primary/secondary 4. When a replica set becomes a part of the shardedCluster its nodes must change the client to KeysCollectionClientSharded. 5. We should not invariant on the non-consistent user input: remove the invariant - in production it should log an error and return an error. |
| Comments |
| Comment by Githook User [ 28/Sep/17 ] |
|
Author: {'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev', 'username': 'mikety'}Message: |
| Comment by Misha Tyulenev [ 08/Sep/17 ] |
|
Note: |