[SERVER-11746] Improve shard version checking for versioned (single) updates after yield Created: 16/Nov/13  Updated: 13/Oct/15  Resolved: 26/Aug/15

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

Type: Task Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-17805 logOp / OperationObserver should alwa... Closed
is duplicated by SERVER-11678 Improve shard version checking for up... Closed
Related
is related to SERVER-14669 Updates/deletes on sharded collection... Closed
is related to SERVER-17585 Enforce shard version after yields on... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 8 08/28/15
Participants:

 Description   

Need to make sure we are checking the shard version correctly and return the correct error, stale config.

We should ensure that this is done for findAndModify and any other update callers.

Greg suggests that we should investigate if all version checks can be done directly in the update code.



 Comments   
Comment by Randolph Tan [ 26/Aug/15 ]

Fixed with: https://github.com/mongodb/mongo/commit/e9312347ba068ac83695e6eacb2f35c03e57bbd7

Note that there are already shard version checks being performed after yield, specifically right in the logOp listener. However, the version used for checking is not being set if the connection does not have the version set (https://github.com/mongodb/mongo/blob/r3.0.6/src/mongo/db/commands/write_commands/batch_executor.cpp#L886-l896).

The fix is to make the write command path use ShardConnections so every connection it uses will have shard information.

Comment by Randolph Tan [ 23/Jul/15 ]

Thanks to SERVER-17805, the opObserver now checks the shard version. This means that we don't need to check the shard version after a yield to handle non-multi writes to orphaned ranges.

Generated at Thu Feb 08 03:26:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.