[SERVER-81966] Avoid modification of previous ChunkMap instances during refresh Created: 08/Oct/23 Updated: 06/Dec/23 Resolved: 09/Oct/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.2.25, 7.0.1, 6.0.10, 5.0.21, 7.2.0-rc0, 7.1.0 |
| Fix Version/s: | 4.2.25, 7.1.1, 7.2.0-rc0, 5.0.22, 7.0.3, 4.4.26, 6.0.12 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tommaso Tocci | Assignee: | Tommaso Tocci |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | balancer-round-perf | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v7.1, v7.0, v6.0, v5.0, v4.4, v4.2
|
||||||||||||||||
| Sprint: | Sharding EMEA 2023-10-16 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||
| Description |
Bug descriptionDuring routing table refresh, we create an updated ChunkMap from an existing one (copy on write). It is important that during the creation of the new ChunkMap the existing one remain untouched and valid. The current update algorithm is affected by the bug that could cause a vector of the original ChunkMap to be erased. This happens in ChunkMap::_mergeAndCommitUpdatedChunkVector where we std::move the chunkInfo pointers from the old vector to the new one. Conditions to trigger the bugSeveral conditions need to apply in order to trigger this bug:
Additionally, in order for this bug to cause any harm, the original RoutingTable needs to be accessed after the refreshed one is constructed, that usually happen with long-lasting requests or with a very high frequency of quick requests. Affected versions
RemediationsChunk merges are a prerequisite to hit this bug, thus the way to prevent triggering it is just to stop all chunk merges activities and restart all the binaries in the cluster (both mongod and mongos). Version >= 7.0
Version 6.0
Version <= 5.0In these versions, the balancer does not perform any automatic chunk merges, thus the only users that can be affected and need to take the remediation steps are the ones that executed at least one manual chunk merge.
|
| Comments |
| Comment by Githook User [ 19/Oct/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Githook User [ 11/Oct/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Githook User [ 09/Oct/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Githook User [ 09/Oct/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Githook User [ 09/Oct/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Githook User [ 09/Oct/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |
| Comment by Githook User [ 09/Oct/23 ] |
|
Author: {'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}Message: |