[SERVER-53631] [Resharding] Verify UUIDs are correct in writesShouldRunInDistributedTransaction Created: 07/Jan/21  Updated: 29/Oct/23  Resolved: 14/Jan/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Blake Oler Assignee: Alexander Taskov (Inactive)
Resolution: Fixed Votes: 0
Labels: PM-234-M2, PM-234-T-lifecycle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-53258 [Resharding] Reject writes in opObser... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-01-25
Participants:
Story Points: 1

 Description   

Check a few things and make changes accordingly:

  • It's likely not necessary to pass in the reshardingUUID, since that information would have been already captured by the reshardingFields held on the CollectionMetadata object.
  • Think about whether the UUID captured from the chunk manager represents what we expect – this UUID may not match what is currently represented on the storage catalog.


 Comments   
Comment by Githook User [ 14/Jan/21 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-53631 Refactored and renamed writesShouldRunInDistributedTransaction function
Branch: master
https://github.com/mongodb/mongo/commit/5c99a50da93163636c9fa77edd61846a7ba30f8a

Comment by Max Hirschhorn [ 07/Jan/21 ]

It's likely not necessary to pass in the reshardingUUID, since that information would have been already captured by the reshardingFields held on the CollectionMetadata object.

To be a little more specific, I think the method signature should be

CollectionMetadata::writesShouldRunInDistributedTransaction(const UUID& currentCollectionUUID) const;

where both reshardingUUID and originalUUID are coming from the TypeCollectionReshardingFields. See also this comment I had made on SERVER-53258. The caller would provide the UUID in db/catalog's CollectionCatalog as the currentCollectionUUID. _cm->getUUID() is always expected to be reshardingUUID when we are in kCommitted.

We should also rename this method because the design for resharding isn't have writes being converted to distributed transactions nor do we plan to extend the design to do so later. The design for resharding is waiting until the coordinator detects the resharding operation would commit quickly so we shouldn't ever be in kCommitted long enough where distributed transactions to allow some writes would be helpful.

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