Skip to content

crimson: add initial scrub support - #54214

Merged
athanatos merged 24 commits into
ceph:mainfrom
athanatos:sjust/wip-crimson-scrub
Jan 3, 2024
Merged

athanatos merged 24 commits into
ceph:mainfrom
athanatos:sjust/wip-crimson-scrub

Conversation

@athanatos

Copy link
Copy Markdown
Contributor

This PR adds initial support for scrubs initiated via the ceph tell (scrub|deep_scrub) commands. Scheduling, preemption, repair, other features will be future work, but this suffices at least to scrub after teuthology jobs.

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@athanatos
athanatos force-pushed the sjust/wip-crimson-scrub branch from f52a36b to 99be158 Compare October 31, 2023 16:45
Comment thread src/osd/osd_types_fmt.h Resolved
@athanatos
athanatos force-pushed the sjust/wip-crimson-scrub branch from 99be158 to 237002f Compare November 2, 2023 15:29
Comment thread src/crimson/osd/scrub/scrub_validator.h Resolved
Comment thread src/crimson/osd/pg_backend.cc Outdated
}

delta_stats.num_objects--;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the object should be marked as whiteout (whiteout == true), num_objects won't be decremented because of the return beforehand. IIUC, we shouldn't decrement num_objects on whiteout because of the created object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ugh, I misread some code in classic and concluded that whiteouts don't count in num_objects. I'll fix this and the corresponding code in scrub.

Comment thread src/crimson/osd/pg_backend.cc Outdated
delta_stats.num_bytes -= os.oi.size;

// todo: update watchers
if (os.oi.is_whiteout()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you explain why the previous check location was wrong?
It differs from PrimaryLogPG::_delete_oid

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I missed the if (whiteout && os.oi.is_whiteout()) { above -- this change doesn't actually have any effect. I'll remove it.

@Matan-B

Matan-B commented Nov 6, 2023

Copy link
Copy Markdown
Contributor

make check seems to be failing because of unused captures.

@github-actions

github-actions Bot commented Nov 7, 2023

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@athanatos
athanatos force-pushed the sjust/wip-crimson-scrub branch from 8dfb958 to a180eaf Compare November 7, 2023 04:18
@athanatos

Copy link
Copy Markdown
Contributor Author

Will fix the lambda captures tomorrow.

@athanatos
athanatos force-pushed the sjust/wip-crimson-scrub branch from a180eaf to edfb060 Compare November 7, 2023 19:34
@athanatos
athanatos force-pushed the sjust/wip-crimson-scrub branch from edfb060 to 1928ce3 Compare November 7, 2023 21:00
Comment thread src/common/scrub_types.h Resolved
Comment thread qa/tasks/ceph.py Resolved
Comment thread src/crimson/osd/scrub/scrub_machine.h Resolved
Comment thread src/crimson/osd/scrub/scrub_machine.h Resolved
Comment thread src/crimson/osd/scrub/scrub_machine.h Resolved
Solves an FTBFS when using with_interruption from pg_commands.cc:

In file included from ../src/crimson/admin/pg_commands.cc:14:
../src/crimson/common/interruptible_future.h:135:46: error: redefinition of ‘bool __tls_guard’
  135 | thread_local interrupt_cond_t<InterruptCond> interrupt_cond;
      |                                              ^~~~~~~~~~~~~~
In file included from ../src/common/TrackedOp.h:18,
                 from ../src/os/ObjectStore.h:25,
                 from ../src/osd/PGLog.h:23,
                 from ../src/osd/PeeringState.h:19,
                 from ../src/crimson/osd/shard_services.h:17,
                 from ../src/crimson/osd/pg_shard_manager.h:10,
                 from ../src/crimson/osd/osd.h:23,
                 from ../src/crimson/admin/pg_commands.cc:16:
../src/common/StackStringStream.h:188:36: note: ‘bool __tls_guard’ previously declared here
  188 |   inline static thread_local Cache cache;

This matches what we already do with
interrupt_cond_t<crimson::os::seastore::TransactionConflictCondition>.

Signed-off-by: Samuel Just <[email protected]>
- Switch to DEBUGDPPU to add pg prefix to each line
- Pass this_instance_id through for uniformity
- Clarify log lines particularly entering/leaving stages

Signed-off-by: Samuel Just <[email protected]>
It's common during cluster setup for there to be periods with
degraded/recovering PGs.  Ignore those errors.

Signed-off-by: Samuel Just <[email protected]>
Scrub wants to be able to pass numeric_limits::max() as limit
since we've already selected bounds based on the number of objects.

Signed-off-by: Samuel Just <[email protected]>
seek_to_first() if start is nullopt, upper_bound() otherwise.

Signed-off-by: Samuel Just <[email protected]>
This is the more modern variant.  Crimson doesn't currently
support the pg <pgid> deep_scrub variant, so let's just use
this one generally.

Signed-off-by: Samuel Just <[email protected]>
Scrub doesn't want to split snapshot sets across chunks.  The range,
however, is exclusive on the right.  get_max_object_boundary() gives
us a way to always include head and all snapshots in the same chunk
as it will sort greater than any legal object with the same head.

Signed-off-by: Samuel Just <[email protected]>
fmt_print_ctx avoids creating a string.

Signed-off-by: Samuel Just <[email protected]>
…as mutable, don't move action

The lambda passed to seastar::repeat will be invoked multiple times,
don't pass an rvalue ref to call_with_interruption.  Also, declare
lambda as mutable in case action needs to be mutable.

Signed-off-by: Samuel Just <[email protected]>
…ruct

There will ultimately be many Operation types that need to use the
PGPeeringPipeline, let's not enumerate them as friends.

Signed-off-by: Samuel Just <[email protected]>
We don't want scrub and snaptrimming running at the same time,
use the same lock.

Signed-off-by: Samuel Just <[email protected]>
…ests

scrub_validator.h/cc contain the logic from translating a set of ScrubMaps
into per-chunk stats and errors.

scrub_machine.h/cc contain the logic for the overall scrub lifecycle and
reservation management.

ScrubContext (scrub_machine.h) is the interface through which the above
logic performs reservations and scans.

Signed-off-by: Samuel Just <[email protected]>
Crimson routes the scrub request directly to the PGScrubber rather
than going through PeeringState.

Signed-off-by: Samuel Just <[email protected]>
@athanatos
athanatos force-pushed the sjust/wip-crimson-scrub branch from 1ac65d8 to 12e5f22 Compare December 11, 2023 04:26
@athanatos

athanatos commented Dec 12, 2023 •

Copy link
Copy Markdown
Contributor Author

@athanatos

Copy link
Copy Markdown
Contributor Author

@athanatos

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@athanatos
athanatos merged commit 0669530 into ceph:main Jan 3, 2024
@ljflores

ljflores commented Jan 8, 2024

Copy link
Copy Markdown
Member

@athanatos I see a new teuthology failure that looks related to this: https://tracker.ceph.com/issues/63967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants