-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Service Arch
-
Fully Compatible
-
Service Arch 2023-10-16, Service Arch 2023-10-30, Service Arch 2023-11-13, Service Arch 2023-11-27, Service Arch 2023-12-11, Service Arch 2023-12-25, Service Arch 2024-01-08, Service Arch 2024-01-22, Service Arch 2024-02-05
Original proposal:
Currently every time we do a retryable write, we find the _id index for the config.transactions table, look up the record ID we want to write in it, and then update the record. But we know the _id will always be the session ID which does not change for a given TransactionParticipant, so we can cache that record ID on the participant the first time we insert or look it up, and skip the index lookup on most writes.
We have to handle two exceptional cases
1) The record ID no longer exists, e.g. because the session got reaped yet re-used.
2) The record ID exists, but does not contain our _id value (the record ID got re-used). I don't know if this is possible with WiredTiger but I don't think we have formal guarantees against it.
In both cases we would just fall back to the slow path of doing a lookup and possibly an insert.
New proposal:
Make the config.transactions collection clustered. This is a cleaner implementation but comes with upgrade/downgrade considerations.
- is duplicated by
-
SERVER-86043 Cluster config.transactions
- Closed
- related to
-
SERVER-85423 CollectionScan::work() returns NEED_TIME for clustered collections which causes early yielding
- Closed
-
SERVER-82673 Create commands that reserialize config.transactions as a clustered/nonclustered collection
- Backlog
-
SERVER-84073 Enable the ClusteredConfigTransactions feature flag for testing
- Backlog