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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • None
    • ALL
    • 15

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-sharding-nyc Backlog - Sharding NYC
              cheahuychou.mao@mongodb.com Cheahuychou Mao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: