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

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.0, v3.6
    • Sprint:
      Sharding 2018-10-22, Sharding 2018-11-05, Sharding 2018-11-19, Sharding 2018-12-17
    • Linked BF Score:
      51

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: