There is currently a single rwlock protecting reads and writes of data in WT_TXN_GLOBAL. Some of those operations, such as updating the oldest transaction (and timestamp), involve scans that are O(#open sessions).
Performance should be better with more granular locking, where transactions put themselves on a number of lists (one by transaction ID, one by pinned ID, one by read timestamp, and another by commit timestamp). Each of those lists can be protected by a rwlock, and transactions would only appear in a list when they have the associated ID / timestamp.
This should make update_oldest into an O(1) operation, and make get_snapshot O(#running transactions) rather than O(#open sessions).
- is related to
-
WT-3415 setting timestamp in txn_state requires the global write lock
- Closed