[SERVER-60094] ReshardingOplogApplicationRules does not version all writes Created: 20/Sep/21  Updated: 29/Oct/23  Resolved: 22/Sep/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 5.0.3
Fix Version/s: 5.0.4, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Brett Nawrocki Assignee: Brett Nawrocki
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-oplog-apply
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-54984 Relax invariant in ReshardingOpObserv... Closed
is related to SERVER-59023 Resharding can fail with NamespaceNot... Closed
is related to SERVER-52639 Fail resharding operation if new shar... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding 2021-10-04
Participants:
Story Points: 1

 Description   

ReshardingOplogApplicationRules::_applyDelete_inlock() has special logic to upon removing a document from the temporary resharding collection to move a document from one of the other stash collections (i.e. one associated with a different donor shard) into its place. The runWithTransaction() helper does so by using AlternativeSessionRegion which will construct a separate OperationContext. The write being performed in this separate OperationContext won't have shard version attached for the temporary resharding collection like the original one had. Calling initializeClientRoutingVersions() on the OperationShardingState associated with the separate OperationContext should address the delete on the temporary resharding collection not having a shard version.

See SERVER-59023 for why this is necessary; that this was not already being done was an oversight when implementing that ticket.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 24/Sep/21 ]

Author:

{'name': 'Brett Nawrocki', 'email': 'brett.nawrocki@mongodb.com', 'username': 'brettnawrocki'}

Message: SERVER-60094 Add shard version to internal write

ReshardingOplogApplicationRules::_applyDelete_inlock() has special logic
to, upon removing a document from the temporary resharding collection,
move a document from one of the other stash collections (i.e. one
associated with a different donor shard) into its place. The
runWithTransaction() helper does so by using AlternativeSessionRegion
which will construct a separate OperationContext. The write being
performed in this separate OperationContext won't have shard version
attached for the temporary resharding collection like the original one
had. Therefore, call initializeClientRoutingVersions() on this context
to set the version.

(cherry picked from commit 31f1068f5273f1dd55378eda3fb4bdc441e0a15e)
Branch: v5.0
https://github.com/mongodb/mongo/commit/be7a8458ef6c5a4bd361755ea6a9b857c4076035

Comment by Githook User [ 21/Sep/21 ]

Author:

{'name': 'Brett Nawrocki', 'email': 'brett.nawrocki@mongodb.com', 'username': 'brettnawrocki'}

Message: SERVER-60094 Add shard version to internal write

ReshardingOplogApplicationRules::_applyDelete_inlock() has special logic
to, upon removing a document from the temporary resharding collection,
move a document from one of the other stash collections (i.e. one
associated with a different donor shard) into its place. The
runWithTransaction() helper does so by using AlternativeSessionRegion
which will construct a separate OperationContext. The write being
performed in this separate OperationContext won't have shard version
attached for the temporary resharding collection like the original one
had. Therefore, call initializeClientRoutingVersions() on this context
to set the version.
Branch: master
https://github.com/mongodb/mongo/commit/31f1068f5273f1dd55378eda3fb4bdc441e0a15e

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