[SERVER-23189] Write commands with 'ordered' option should not continue on StaleShardVersion errors Created: 16/Mar/16  Updated: 28/Jan/20  Resolved: 28/Jan/20

Status: Closed
Project: Core Server
Component/s: Sharding, Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

If write commands are passed the 'ordered' option, when they are processed on the individual shards they will ignore individual document errors and continue execute until the batch is exhausted.

However, if the error encountered is StaleShardVersion, there is no point in continuing, because it is guaranteed that none of the subsequent batch entries will succeed.

We should make the shard stop executing the batch the moment the first StaleShardVersion is encountered.



 Comments   
Comment by Kaloian Manassiev [ 28/Jan/20 ]

This has gone away after the rewrite of the write commands path in 3.6.

Comment by Kaloian Manassiev [ 17/Mar/16 ]

This is what mongos does already. This ticket is for mongod to stop processing the batch and tell mongos there's stale shard version. Currently mongod will go through the entire batch before returning to mongos.

Comment by Andy Schwerin [ 17/Mar/16 ]

If we see ssv in this circumstance, couldn't mongos resume from the ssv erroring entry onward after refreshing the routing table? For that matter, couldn't all unordered writes that error be similarly retried by mongos?

Generated at Thu Feb 08 04:02:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.