Reduce transaction scopes of writes in CAS index
Before raising this MR, consider whether the following are required, and complete if so:
-
Unit tests
Description
The performance of CAS index can often be a bottleneck.
- Every read access results in a write access to refresh the access timestamp so it's not deleted by cleaners
- It supports bulk writes, which sometimes leads to deadlock observed in !847 (merged) .
One observation is that for CAS Index we don't need transactions or query isolations. For concurrent writes on the same CAS Index entry, the only difference is the timestamps reflected in the tuple.
This MR adds commits to shorten the transaction scopes of writes in CAS index to improve the performance.
Changes proposed in this merge request:
- In
_bulk_refresh_timestamps
, addsession.commit()
between each partition is refreshed. - In
_bulk_read_blobs_with_fallback
andbulk_read_blobs
, addsession.commit()
to create different transactions for_save_digests_to_index
and_bulk_refresh_timestamps
.
Edited by Zehao Chen