-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
Sharding 2018-12-03
Currently, mongos sends updates and deletes that target more than one shard to all shards, without shard versions because normally mongos can't retry partial failures from stale shard version errors. In a transaction, mongos can retry on partial failures (or abort the writes entirely on each shard), so the router should be able to version writes that target more than one shard.
This prevents the scenario where mongos starts a transaction on a collection it is stale for with an unversioned write, which acquires a lock on the stale collection and holds it for the lifetime of the transaction, preventing the shard from refreshing its filtering metadata for the stale collection until the transaction completes (because the refresh requires an exclusive lock on the stale collection). In this case, any stale versioned writes would hang waiting for the transaction to finish when the shard tries to refresh its metadata.
- related to
-
SERVER-37502 Consider sending database version for all commands allowed in a transaction
- Closed