]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crimson/os/seastore/transaction: new conflict/no_conflict trans 70068/head
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 8 Jul 2026 08:05:20 +0000 (16:05 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Fri, 17 Jul 2026 09:51:04 +0000 (17:51 +0800)
commitfdad2c066b257599eac8b8a7e773c406334c3a40
tree4261a858285a64a54e9a157347a913086c779e6a
parent2b1ed9e100a4f5ff76b9eef5380100942c4c45f6
crimson/os/seastore/transaction: new conflict/no_conflict trans
synchronization

Use seastar::shared_mutex to synchronize transactions when committing
no_conflict ones.

Specifically, this commit achieves conflict/no_conflict trans
synchronization by:
1. The no_conflict trans acquires locks on all the stable extents which
   it modifies.
2. The conflicting trans acquires shared locks on all the stable extents
   which it modifies.
3. The no_conflict trans releases the locks after its committing.
4. The conflicting trans releases the shared locks once it enter the
   prepare pipeline phase.

This commits makes sure that:
1. only transactions accessing the extents that the no_conflict trans
   is committing will be blocked.
2. avoid persisting extents that a committing no_conflict trans is
   modified

Compared to the old approach, this commit's strategy is much more
straightforward and understandable.

This commit is more performant as the no_conflict trans only blocks
the trans the modified extent set of which intersects with it, while,
in the old approach, all other transactions will be blocked once a
conflicting trans is blocked because it's blocked after it enters the
prepare pipeline phase

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/cached_extent.h
src/crimson/os/seastore/transaction.h
src/crimson/os/seastore/transaction_manager.cc
src/crimson/os/seastore/transaction_manager.h