Skip to content

Reduce transaction scopes of writes in CAS index

Zehao Chen requested to merge zchen723/reduce-transaction-scope into master

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, add session.commit() between each partition is refreshed.
  • In _bulk_read_blobs_with_fallback and bulk_read_blobs, add session.commit() to create different transactions for _save_digests_to_index and _bulk_refresh_timestamps.
Edited by Zehao Chen

Merge request reports