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

Return a shutdown error as top-level error for batch write command that fails with CallbackCanceled when mongos shuts down

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Sharding NYC
    • ALL
    • 15

      Currently, in v4.2, when mongos shuts down, a batch write command can be interrupted by a CallbackCanceled error instead of InterruptedAtShutdown error and when that occurs, it returns a response without a top-level error as follows:

      {"n" : 0, "ok": 1, "writeErrors" : [{"index" : 0, "code" : 90, "codeName" : "CallbackCanceled", "errmsg" : "Write results unavailable from ... :: caused by :: Callback canceled"}]}

      SERVER-55648 was meant to solve this but we had mistakenly assumed that CallbackCanceled cannot be thrown on shutdown if cancelation token does not exist. Since we are not attaching the RetryableWriteError label in 4.2, we should catch the CallbackCanceled here and throw a shutdown error so drivers can retry.

            Assignee:
            backlog-server-sharding-nyc [DO NOT USE] Backlog - Sharding NYC
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: