[SERVER-47088] Make index_commands_shard_targeting.js not assert that index commands run during critical section fail with MaxTimeMSExpired Created: 24/Mar/20  Updated: 29/Oct/23  Resolved: 24/Mar/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-04-06
Participants:
Linked BF Score: 14

 Description   

There is no guarantee that the command will always fail with MaxTimeMSExpired because of a race in the AsyncRequestSender. When the opCtx is killed due to the maxTimeMS deadline, the ARS stores the status and marks any outstanding remote responses as failed with MaxTimeMSExpired. However, if the shard has already responded before that, the ARS will still return the response from shard. So in that case, the StaleConfig error from the shard will get handled in the mongos retry loop, causing the mongos to mark the shard as stale and send out setShardVersion to the shard which will then fail due to MaxTimeMSExpired. So the command will just keep failing in all next retries.

The test should instead use checkLog to check for the log lineĀ "Failed to refresh metadata for collection.*MaxTimeMSExpired" on the shard.



 Comments   
Comment by Githook User [ 24/Mar/20 ]

Author:

{'name': 'Cheahuychou Mao', 'username': 'cheahuychou', 'email': 'cheahuychou.mao@mongodb.com'}

Message: SERVER-47088 Make index_commands_shard_targeting.js not assert that index commands run during critical section fail with MaxTimeMSExpired error

(cherry picked from commit 114eeb13a6a30c899b9e26ccb5d8b734999f61cb)
Branch: v4.4
https://github.com/mongodb/mongo/commit/a326a0e3c8d6ba1973e7e45b0998ad019e6adeee

Comment by Githook User [ 24/Mar/20 ]

Author:

{'name': 'Cheahuychou Mao', 'username': 'cheahuychou', 'email': 'cheahuychou.mao@mongodb.com'}

Message: SERVER-47088 Make index_commands_shard_targeting.js not assert that index commands run during critical section fail with MaxTimeMSExpired error
Branch: master
https://github.com/mongodb/mongo/commit/114eeb13a6a30c899b9e26ccb5d8b734999f61cb

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