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

Sharding state is set to initialized on Grid before sharding components are fully initialized

    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • Sharding 2018-10-22, Sharding 2018-11-05, Sharding 2018-11-19, Sharding 2018-12-17
    • 51

      This can trigger a crash or incorrect behavior if the sharding components are accessed before being fully initialized.

      One example is that the ShardServerCatalogCacheLoader is created in initializeGlobalShardingStateForMongoD before Grid::setShardingInitialized but its ReplicaSetRole member variable is initialized later in initializeShardingEnvironmentOnShardServer after Grid::setShardingInitialized. This can lead to a crash because various methods in the ShardServerCatalogCacheLoader invariant that the ReplicaSetRole will not be ReplicaSetRole::None.

      An example is shown here (and the corresponding Evergreen task).

            Assignee:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Reporter:
            blake.oler@mongodb.com Blake Oler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: