|
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.
|