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.
|