[SERVER-59474] Return a shutdown error as top-level error for batch write command that fails with CallbackCanceled when mongos shuts down Created: 20/Aug/21  Updated: 06/Dec/22  Resolved: 21/Mar/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: [DO NOT USE] Backlog - Sharding NYC
Resolution: Duplicate Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-64642 Fix error where mongos returns Callba... Closed
Related
is related to SERVER-53624 4.4 mongos does not attach RetryableW... Closed
is related to SERVER-55648 Mongos doesn't return top-level batch... Closed
Assigned Teams:
Sharding NYC
Operating System: ALL
Participants:
Linked BF Score: 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.


Generated at Thu Feb 08 05:47:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.