-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
Sharding NYC 2023-07-10, Sharding NYC 2023-07-24, Sharding NYC 2023-08-07, Sharding NYC 2023-08-21, Sharding NYC 2023-09-04, Sharding NYC 2023-09-18, Sharding NYC 2023-10-02, Sharding NYC 2023-10-16, Sharding NYC 2023-10-30, Cluster Scalability 2023-11-13, Cluster Scalability 2023-11-27
The two phase write protocol for single writes without a shard key match do a broadcast read and then write to a single shard with a matching document. SERVER-48340 restores the single write shard commit optimization, which lets two phase writes skip two phase commit, since they will always write to at most one shard.
The single write shard optimization has two phases: a round of commits on the read only shards, then if all read only commits were successful, sending commit to the one write shard. Two phase writes can be further optimized to skip the first commit phase because single writes don't care if read only shards not chosen to perform the write are able to commit. To satisfy the guarantees of a single write (ie only one matching document is updated), it's enough to only commit on the chosen write shard. Thus commit can become a single phase - committing on the write shard and in parallel committing (or aborting since it's cheaper) on the read shards (so they release their resources, their responses can be ignored).
- is related to
-
SERVER-79056 Measure performance for updateOne without shard key with commit optimizations
- Closed
- related to
-
SERVER-48340 Re-enable single-write-shard transaction commit optimization
- Closed