Skip to content

crimson: fix several bugs causing stuck backfills#62837

Merged
athanatos merged 7 commits intoceph:mainfrom
athanatos:sjust/wip-crimson-stuck-backfilling
Apr 22, 2025
Merged

crimson: fix several bugs causing stuck backfills#62837
athanatos merged 7 commits intoceph:mainfrom
athanatos:sjust/wip-crimson-stuck-backfilling

Conversation

@athanatos
Copy link
Contributor

Show available Jenkins commands

@Matan-B Matan-B added this to Crimson Apr 21, 2025
@Matan-B Matan-B moved this to Awaits review in Crimson Apr 21, 2025
@athanatos
Copy link
Contributor Author

athanatos commented Apr 21, 2025

https://pulpito.ceph.com/sjust-2025-04-17_01:11:15-crimson-rados-wip-sjust-crimson-testing-2025-04-16-1744840247-distro-default-gibba/ -- 50/51 pass

Failure https://tracker.ceph.com/issues/71002 -- seems to be in scan_for_backfill, but doesn't seem to be related to these patches.

Tested

@athanatos athanatos marked this pull request as ready for review April 21, 2025 16:09
@athanatos athanatos requested a review from a team as a code owner April 21, 2025 16:09
@athanatos athanatos force-pushed the sjust/wip-crimson-stuck-backfilling branch from 4380720 to 0dcac7e Compare April 21, 2025 16:10
We're looking for the exact hobject_t specified.

Fixes: https://tracker.ceph.com/issues/70935
Signed-off-by: Samuel Just <sjust@redhat.com>
…_for_backfill

load_and_lock can return enoent if object is missing.

Fixes: https://tracker.ceph.com/issues/70936
Signed-off-by: Samuel Just <sjust@redhat.com>
…rottle

This made sense prior to the addition of the scheduler.  Now, we need
to go through the scheduler whether there's a max or not.

Signed-off-by: Samuel Just <sjust@redhat.com>
…ng macros

Signed-off-by: Samuel Just <sjust@redhat.com>
…over_object_with_throttle

791772f used with_throttle here in a way which caused
then_interruptible in PGRecovery::recover_object to be called outside of
an interruptible context.

Instead of using a wrapper taking a lambda, rephrase as an RAII releaser
suitable for use in a coroutine.  This avoids needing to structure
with_throttle to deal correctly with both interruptible and
non-interruptible contexts.

Fixes: https://tracker.ceph.com/issues/70939
Signed-off-by: Samuel Just <sjust@redhat.com>
It's now unused, and these combinator style wrappers are easy to
misuse and hard to read compared with RAII and coroutines.

Signed-off-by: Samuel Just <sjust@redhat.com>
@athanatos athanatos force-pushed the sjust/wip-crimson-stuck-backfilling branch from 0dcac7e to cd9dcf6 Compare April 21, 2025 16:30
@Matan-B
Copy link
Contributor

Matan-B commented Apr 22, 2025

jenkins test make check arm64

Copy link
Contributor

@Matan-B Matan-B left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! One question regarding the resolving bug - probably not a blocker.

auto obc_manager = pg.obc_loader.get_obc_manager(object);
co_await pg.obc_loader.load_and_lock(
auto obc_manager = pg.obc_loader.get_obc_manager(
object, /* resolve_clone = */ false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clone_id of the clone is not necessarily a valid snapshot of the object.
Reproduces on any clone whose id doesn't happen to be a live snapshot.

Since this by no means a client originated request this, getting the exact hobject_t makes sense to me.
However, my only hesitation here is with us actually emplacing the (possibly) to-be trimmed objects into the backfill interval.
Meaning shouldn't we rely on resolve_oid here to be used as a removed snap management check?
In a scenario in which a snapshot is removed, a belonging clone won't be resolved, why should it be part of the backfill interval in this case?

I think that the described case is possible since the object here is obtained directly from disk - without any metadata on the logical state of this object. The resolve check might actually help us gain information on this object (i.e to-be trimmed).

Assuming the above is somewhat correct, without resolving the clone object, we possibly backfill a to-be trimmed clone or if trimming was already kicked - this clone object will be logically stale(leaked in way)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve_clone is really only for client reads -- the client supplied snapshot needs to be a current, actual snapshot of the object. However, the cloneid on the object may be for a removed clone or may not necessarily ever have been a valid snapshot on the object.

Comment on lines +252 to +255
// if the object does not exist here, it must have been removed
// between the collection_list_partial and here. This can happen
// for the first item in the range, which is usually last_backfill.
co_return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should we add a log line here to more easily spot cases where scan_for_backfill returns earlier than expected? Could help with future investigations

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing that now in a follow up for https://tracker.ceph.com/issues/71003

}));
DEBUGDPP("got throttle: {} {}", pg->get_dpp(), soid, need);
co_await pg->get_recovery_backend()->recover_object(soid, need);
co_return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: DEBUGDPP("releasing throttle: {} {}", pg->get_dpp(), soid, need);

});
LOG_PREFIX(PGRecovery::recover_object_with_throttle);
DEBUGDPP("{} {}", pg->get_dpp(), soid, need);
auto releaser = co_await interruptor::make_interruptible(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Matan-B
Copy link
Contributor

Matan-B commented Apr 22, 2025

@athanatos, please see #62619 (comment)
Do you see it as a blocker?

@athanatos athanatos merged commit 11ce348 into ceph:main Apr 22, 2025
12 checks passed
@Matan-B Matan-B moved this from Awaits review to Merged in Crimson Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Merged (Pre Tentacle Freeze)

Development

Successfully merging this pull request may close these issues.

2 participants