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

Race condition can allow using a SyncClusterConnection to talk to config servers even after swapping CatalogManager to CSRS mode

    • Fully Compatible
    • ALL
    • Sharding 13 (04/22/16)
    • 0

      There's a race when creating a SyncClusterConnection around the same time as another thread performs a catalog swap. Imagine you need to talk to the config server for some reason. You check whether you're in SCCC or CSRS mode and see that you are in SCCC mode, so you get ready to create a SyncClusterConnection to talk to the config servers. Before you do, however, another thread communicates with the config servers and notices the need to swap catalog managers. The catalog managers swap, then the original thread proceeds with creating the SyncClusterConnection. Normally if the config servers had switched to CSRS mode, connecting the SyncClusterConnection would fail because it would run isMaster against the first config server and see that it's mode is different than the one we're using. But in this case we'll see that the config server is in CSRS mode, and we'd check what mode we're in and see that we're also in CSRS mode, so there's nothing to do! The SyncClusterConnection connects successfully and is used to run the query.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: