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

Write commands run by threads that can survive rollback can fail operationTime invariant in ServiceEntryPoint

    • Fully Compatible
    • ALL
    • v4.4, v4.2, v4.0, v3.6
    • Repl 2020-05-18
    • 8

      If a thread does a write that gets rolled back during stepdown, its client can have _lastOp with timestamp higher than the timestamp of system last opTime (if the wallclock on primary is behind the wallclock on the node the threads runs on). So if after stepdown the thread sends a write command to itself, the command will fail the ReplicationCoordinator check when trying to write an oplog entry but the NotMaster error will get caught in this block in the ServiceEntryPoint::runCommandImpl. Since the command is a noop, the client's lastOp will be set to last system opTime. So after the wait for writeConcern fails, the NotMaster error will get propagated up, and the operation will hit the invariant operationTime >= startOperations when trying  append operationTime to the response.

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: