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

Noop write for afterClusterTime/atClusterTime needs to target primary

    • Fully Compatible
    • ALL
    • Sharding 2021-02-08

      In waitForReadConcernImpl we perform a makeNoopWriteIfNeeded to bump up the clusterTime by running a appendOplogNote command

      The command is run against the Shard object obtained here. If the waitForReadConcernImpl is running on a configsvr secondary, then Grid::get(opCtx)>shardRegistry()>getConfigShard() returns a ShardLocal instance. Then the appendOplogNote would be ran using the DBDirectClient agains the local node (secondary), which will fail.

      We need to ensure that the appendOplogNote is ran against the replica set primary.

      We could use ReplicationCoordinator::runCmdOnPrimaryAndAwaitResponse

            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:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: