[SERVER-64517] RecoverableCriticalSection is not properly recovered on startup Created: 15/Mar/22 Updated: 29/Oct/23 Resolved: 16/Mar/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 5.0.0 |
| Fix Version/s: | 6.0.0-rc0, 5.0.7, 5.3.0-rc4, 5.2.2 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Jordi Serra Torrens | Assignee: | Jordi Serra Torrens |
| 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: |
v5.3, v5.2, v5.0
|
||||||||
| Sprint: | Sharding EMEA 2022-03-21 | ||||||||
| Participants: | |||||||||
| Description |
|
RecoverableCriticalSectionService intends to keep an in-memory state whose state mirrors the critical sections that are durably persisted on a collection. Currently, on startup, we initialize this in-memory state by hooking into ReplicaSetAwareService's onStartup method and then reading from the collection. On steady state replication an opObserver keeps it in sync. However, ReplicaSetAwareService::onStartup is not the correct place to do such initialization, because by the time it gets called initialSync and startupRecovery have not run yet. This can cause a freshly started up shard to miss an in-memory critical section. To address it, we should follow the same approach taken by 'recoverTenantMigrationAccessBlockers': It recovers its state (1) after initialSync, (2) after startup recovery, (3) after a rollback |
| Comments |
| Comment by Githook User [ 18/Mar/22 ] |
|
Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}Message: (cherry picked from commit ce0bbc5ec1728e443c5ff893a78693b24570b80d) |
| Comment by Githook User [ 18/Mar/22 ] |
|
Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}Message: (cherry picked from commit ce0bbc5ec1728e443c5ff893a78693b24570b80d) |
| Comment by Githook User [ 17/Mar/22 ] |
|
Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}Message: (cherry picked from commit ce0bbc5ec1728e443c5ff893a78693b24570b80d) |
| Comment by Githook User [ 16/Mar/22 ] |
|
Author: {'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}Message: |