]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/object_map: add support for ranged diff-iterate
authorIlya Dryomov <idryomov@gmail.com>
Wed, 27 Dec 2023 17:07:05 +0000 (18:07 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 2 Feb 2024 14:36:57 +0000 (15:36 +0100)
commit9f1f352eb5aff43bb7ac6d1a085b25a8351cbd91
tree1957b393f5b10281613ee4bc88adccdf578ab2e0
parent6ceb5cc0b5c4af3954acc75eb6e0db77e0522be8
librbd/object_map: add support for ranged diff-iterate

Currently diff-iterate in fast-diff mode is performed on the entire
image no matter what image extent is passed to the API.  Then, unused
diff just gets discarded as DiffIterate ends up querying only objects
that the passed image extent maps to.  This hasn't been an issue for
internal consumers ("rbd du", "rbd diff", etc) because they work on the
entire image, but turns out to lead to quadratic slowdown in some QEMU
use cases.

0..UINT64_MAX range is carved out for deep-copy which is unranged by
definition.  To get effectively unranged diff-iterate, 0..UINT64_MAX-1
range can be used.

Fixes: https://tracker.ceph.com/issues/63341
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 0b5ba5fedf704ada74a65108af129eae6baea5c5)
src/librbd/api/DiffIterate.cc
src/librbd/api/DiffIterate.h
src/librbd/deep_copy/ImageCopyRequest.cc
src/librbd/object_map/DiffRequest.cc
src/librbd/object_map/DiffRequest.h
src/test/librbd/deep_copy/test_mock_ImageCopyRequest.cc
src/test/librbd/object_map/test_mock_DiffRequest.cc