]> git-server-git.apps.pok.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>
Sat, 20 Jan 2024 18:00:24 +0000 (19:00 +0100)
commit691051a2bca1d056e1931e031b776660aee4a00a
treeae5d3d69da6a126ad8c4253001645090a9b1da65
parent730b9c5afb03bd054adbac03a00b8946bf2e814f
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