]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/os/seastore/object_data_handler: LBACursor based overwrite
authorXuehan Xu <xuxuehan@qianxin.com>
Fri, 21 Mar 2025 02:58:27 +0000 (10:58 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 5 Aug 2025 06:33:59 +0000 (14:33 +0800)
commitbbcf328ec6caff403fb2257ed89b43bde2f4317d
treed73400502bca433281db35a3b42d071c2afa16d9
parent51225f4087b3229e28a9113b5db187fd8ef7bfe1
crimson/os/seastore/object_data_handler: LBACursor based overwrite

This should avoid unnecessary lba tree searches in the old
implementation of ObjectDataHandler::overwrite()

Overwrites of ObjectDataBlocks are dealt with by first punching holes
in the lba tree and then inserting new extents in the holes.

Specifically, overwrites are classified into two categories:
1. the range of the overwrite falls in a single lba mapping;
2. the range of the overwrite crosses multiple lba mappings.

For the first category, ObjectDataHandler processes the overwrites in
the following way:
1. if the mapping is a pending one (corresponds to a pending extent),
   merge the overwrite with the data of the pending extent;
2. otherwise, if the overwrite can, apply it with delta based
   overwrites;
3. otherwise, punch a hole in the mapping, insert a new extent with the
   data of the overwrite.

For the second category, the overwrite is processed as follows:
1. if the left boundary of the overwrite is inside an existing mapping,
   deal with the mapping in a way similar to the single-mapping
   overwrites;
2. remove all lba mappings that are strictly within the range of the
   overwrite;
3. deal with the right boundary of the overwrite in the same way as the
   left boundary.

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/lba_mapping.h
src/crimson/os/seastore/object_data_handler.cc
src/crimson/os/seastore/object_data_handler.h
src/crimson/os/seastore/seastore_types.h
src/crimson/os/seastore/transaction_manager.h
src/test/crimson/seastore/test_object_data_handler.cc
src/test/crimson/seastore/test_transaction_manager.cc