[SERVER-73383] Defragmentation may start over right after finishing Created: 27/Jan/23 Updated: 29/Oct/23 Resolved: 22/Mar/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 5.3.0, 6.0.0, 6.1.0, 6.2.0-rc6 |
| Fix Version/s: | 7.0.0-rc0, 6.0.6, 6.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Silvia Surroca | Assignee: | Silvia Surroca |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Backport Requested: |
v6.3, v6.0
|
||||||||||||||||||||
| Sprint: | Sharding EMEA 2023-02-06, Sharding EMEA 2023-02-20, Sharding EMEA 2023-03-06, Sharding EMEA 2023-03-20, Sharding EMEA 2023-04-03 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 5 | ||||||||||||||||||||
| Description |
|
It may happen that defragmentation start over right after finishing. This is the flow that leads to a defragmentation undesired restart on collA: 1. The Balancer thread reads all the collection entries when collA defragmentation didn't finish yet. 2. Defragmentation on collA finishes and the BalancerSecondary thread removes the _defragmentationStates collection entry and clears the defragmentation flags on collA config.collections entry 3. The Balancer calls startCollectionDefragmentation using a stale config.collections entry for collA and an updated _defragmentationStates map 4. Due to point 3, on startCollectionDefragmentation function, we don't return on this condition and we init the collection defragmentation again.
Note that when defragmentation starts over unexpectedly, the defragmentCollection field for collA remains unset, while the defragmentationPhase field has a valid defragmentation phase other than null. |
| Comments |
| Comment by Githook User [ 13/Apr/23 ] |
|
Author: {'name': 'Silvia Surroca', 'email': 'silvia.surroca@mongodb.com', 'username': 'silviasuhu'}Message: (cherry picked from commit 713d6f3d730c2ae15c68ba406c5572b47c859747) |
| Comment by Githook User [ 27/Mar/23 ] |
|
Author: {'name': 'Silvia Surroca', 'email': 'silvia.surroca@mongodb.com', 'username': 'silviasuhu'}Message: |
| Comment by Githook User [ 21/Mar/23 ] |
|
Author: {'name': 'Silvia Surroca', 'email': 'silvia.surroca@mongodb.com', 'username': 'silviasuhu'}Message: |