-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
Sharding 2022-08-08
-
9
The resharding_update_shard_key_in_retryable_write.js test uses assert.commandWorked() to throw an exception only to catch it again and ignore certain error responses. This is problematic in the context of SERVER-47764 because a LockTimeout error response which is sometimes expected here will immediately trigger the hang analyzer and almost surely cause the assert.soon() to time out and fail.
The runCommandRetryOnTransientErrors() function should probably be changed to check res.code explicitly.
assert.soon(() => { res = db.runCommand(cmdObj); try { assert.commandWorked(res); return true; } catch (error) { assert.commandFailedWithCode(res, [ ErrorCodes.StaleConfig, ErrorCodes.NoSuchTransaction, ErrorCodes.ShardCannotRefreshDueToLocksHeld, ErrorCodes.LockTimeout, ErrorCodes.IncompleteTransactionHistory ]); cmdObj.txnNumber = NumberLong(cmdObj.txnNumber + 1); return false; } });