]> 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>
Sat, 20 Jan 2024 15:33:32 +0000 (16:33 +0100)
commit557be66f34617cea0600755afa3ee45a40b54bb3
treebd785d032a7ae6b631a1d533a98a19688d54b937
parentf69deca57fef8ebdd9afbe8803bc63d8522ab982
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)

Conflicts:
src/librbd/object_map/DiffRequest.cc [ commit ef12761bdb03
  ("librbd: use uint64 for return value of size()") not in
  pacific ]
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