Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-64517

RecoverableCriticalSection is not properly recovered on startup

    • Fully Compatible
    • ALL
    • v5.3, v5.2, v5.0
    • Sharding EMEA 2022-03-21

      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

            Assignee:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: