It's totally broken: instead of returning the current position and
moving to the next position, it returns the next position and doesn't
move anywhere. Luckily it hasn't been used until now.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This is a leftover from commit 2b3a46801d39 ("librbd: switch
diff-iterate API to use new object-map diff helper").
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
When getting parent diff, pass the overlap-reduced image extent instead
of the entire 0..overlap range to avoid a similar quadratic slowdown on
cloned images.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
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>
For each covered edge case or error, run through the following
scenarios:
- where the edge case concerns snap_id_start
- where the edge case concerns snap_id_end
- where the edge case concerns intermediate snapshot and
snap_id_start == 0 (diff against the beginning of time)
- where the edge case concerns intermediate snapshot and
snap_id_start != 0 (diff from snapshot)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
In case of diff-iterate against the beginning of time, the result
depends only on the end version. Loading and processing object maps
or intermediate snapshots is redundant and can be skipped.
This optimization is made possible by commit be507aaed15f ("librbd:
diff-iterate shouldn't ever report "new hole" against a hole") and, to
a lesser extent, the previous commit.
Getting FastDiffInvalid, LoadObjectMapError and ObjectMapTooSmall to
pass required tweaking not just expectations, but also start/end snap
ids and thus also the meaning of these tests. This is addressed in the
next commit.
Fixes: https://tracker.ceph.com/issues/63341
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
The new "track the largest of all versions in the set, diff state is
only ever grown" semantics introduced in commit 330f2a7bb9 ("librbd:
helper state machine for computing diffs between object-maps") don't
make sense for diff-iterate. It's a waste because DiffIterate won't
query beyond the end version size -- this is baked into the API.
Limit this behavior to deep-copy and resurrect the original behavior
from 2015 for diff-iterate.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Commit 399a45e113 ("librbd/object_map: rbd diff between two
snapshots lists entire image content") fixed most of the damage caused
by commit b81cd2460d ("librbd/object_map: diff state machine should
track object existence"), but the case of a "resize diff" when diffing
from snapshot was missed. An area that was freshly allocated in image
resize is the same in principle as a freshly created image and objects
marked OBJECT_EXISTS_CLEAN are no exception. Diff for such objects in
such an area should be set to DIFF_STATE_DATA_UPDATED, however
currently when diffing from snapshot, it's set to DIFF_STATE_DATA.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
It became redundant with commit b81cd2460d ("librbd/object_map: diff
state machine should track object existence") -- it != end_it condition
in the loop is sufficient.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
In preparation for multiple similarly configured MockTestImageCtx
objects being used in a single test, centralize their creation and add
a couple of helpers for setting expectations from a callback.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
- Remove static_snap_oi name -- left over from old classic implementation,
misleading.
- OpsExecutor::prepare_clone can only be invoked on a primary, remove
the branch.
- Create the obs directly and pass to obc via set_clone_state, which
sets fully_loaded.
Signed-off-by: Samuel Just <sjust@redhat.com>
We can't guarantee that all continuations will complete before on_flush,
so we unhook and invalidate all live obcs from the registry upon
interval_change. As long as any lingering continuations simply note the
interval change and terminate, this should be safe.
Signed-off-by: Samuel Just <sjust@redhat.com>
As `apt-get remove ceph-libboost*` show the error and cause the make check failed.
`E: The package ceph-libboost1.79-dev needs to be reinstalled, but I can't find an archive for it.`
The ceph-libboost* packages may be not removed, so use `dpkg` to force remove ceph-libboost*.
Fixes: https://tracker.ceph.com/issues/64032
Signed-off-by: luo rixin <luorixin@huawei.com>
We need to be able to clear the lru without waiting for all outstanding
references to be released. Items with such references enter an
invalidated state where references can still be added and removed with
deletion at use_count == 0, but can't be accessed any longer via the lru.
Signed-off-by: Samuel Just <sjust@redhat.com>
common/options/crimson: increase crimson_osd_obc_lru_size to 512
Reviewed-by: Matan Breizman <mbreizma@redhat.com>
Reviewed-by: Samuel Just <sjust@redhat.com>
Fixes: https://tracker.ceph.com/issues/64027
This change also includes:
- adding ~/.local/bin to path so behave binary can be found
- adding requirements.txt file for testing dependencies
- increasing timeout used to wait for tools deployment to 90s
- increasing timeout used to wait for kvm network to 20s
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
osd/scrub: allow replicas to scrub even if their OSDs have ongoing backfills
Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Samuel Just <sjust@redhat.com>