Skip to content

OSD: Optimised EC Deep Scrubbing Implementation - #63184

Merged
SrinivasaBharath merged 5 commits into
ceph:mainfrom
JonBailey1993:ec_optimisation_deep_scrubbing_implementation
Jul 16, 2025
Merged

SrinivasaBharath merged 5 commits into
ceph:mainfrom
JonBailey1993:ec_optimisation_deep_scrubbing_implementation

Conversation

@JonBailey1993

Copy link
Copy Markdown
Contributor

depends on #62952

Initial implementation of deep-scrubbing for Optimised EC. Performs deep scrubbing by taking the digests and putting them through the erasure coding plugin to decide if the calculated parity digest is the same as the actual parities digest. Added a unit test to TestErasureCodePlugins.cc to verify this functionality, and added unit tests to test_scrubber_be.cc to test the new scrubbing behaviour.

I have still got some small efficiency and tidying up, but functionally it should be sound and wanted to be able for people to take a look.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@JonBailey1993
JonBailey1993 requested a review from a team as a code owner May 8, 2025 14:37
@JonBailey1993
JonBailey1993 force-pushed the ec_optimisation_deep_scrubbing_implementation branch from 47f7189 to 00dbeca Compare May 8, 2025 14:37
@aainscow

aainscow commented May 9, 2025

Copy link
Copy Markdown
Contributor

Did you mean to add us as reviewers, rather than assign to us?

@aainscow aainscow left a comment

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.

Mostly nits. Some concerns:

  1. There are places where we are using <k to mean "is data" this will break for LRC... academic.
  2. We seem to be supporting legacy EC for some stuff. This adds test burden and we only want if we have time for that.
  3. ISA has a m==1 restriction - given this is our default plugin, this is very worrying.

Comment thread src/erasure-code/isa/ErasureCodeIsa.h Resolved
Comment thread src/osd/scrubber/scrub_backend.cc Resolved
Comment thread src/osd/scrubber/scrub_backend.cc Resolved
Comment thread src/osd/scrubber/scrub_backend.cc Resolved
Comment thread src/osd/scrubber/scrub_backend.cc Resolved
Comment thread src/osd/ECSwitch.h Resolved
Comment thread src/test/osd/scrubber_generators.cc Resolved
Comment thread src/test/osd/scrubber_generators.h Resolved
Comment thread src/test/osd/scrubber_test_datasets.cc Resolved
Comment thread src/test/osd/scrubber_test_datasets.cc Resolved

@aainscow aainscow left a comment

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.

Meant to click "request changes"

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

Did you mean to add us as reviewers, rather than assign to us?

Yes I did, that's not the first time I've clicked the wrong button there either, oops

@JonBailey1993

JonBailey1993 commented May 9, 2025 •

Copy link
Copy Markdown
Contributor Author

Mostly nits. Some concerns:

  1. There are places where we are using <k to mean "is data" this will break for LRC... academic.
  2. We seem to be supporting legacy EC for some stuff. This adds test burden and we only want if we have time for that.
  3. ISA has a m==1 restriction - given this is our default plugin, this is very worrying.

Thanks for raising these points.
1: Thanks for pointing out this, I will go through and update these to use better interfaces that are "LRC compatible".
2: I think from a conceptual standpoint everything we do for optimised EC should work on legacy EC in terms of these deep-scrubbing changes. However the point of view of the test burden is not something I had considered. I will make a branch in git of the current implementation with the legacy so that if we want to reintroduce these again we will not lose the code, however for the time being I think I will remove the Legacy EC changes from this PR and just have it concentrate on doing this work for Optimised EC.
3: This was a mistake on my part. The m == 1 restriction should apply to Cauchy ONLY. Reed Solomon Van should work with any m value. I will update to reflect this. I will get this fixed.

Edit: The legacy implementation as it currently stands is now in the branch named "ec_legacy_and_optimisation_deep_scrubbing_implementation" in my repository.

@JonBailey1993
JonBailey1993 force-pushed the ec_optimisation_deep_scrubbing_implementation branch 3 times, most recently from e416df8 to 080299c Compare May 12, 2025 17:35
@JonBailey1993
JonBailey1993 requested a review from aainscow May 12, 2025 17:50
@JonBailey1993
JonBailey1993 force-pushed the ec_optimisation_deep_scrubbing_implementation branch from 080299c to c77ed46 Compare May 12, 2025 20:41
@JonBailey1993 JonBailey1993 self-assigned this May 12, 2025
Comment thread src/erasure-code/isa/ErasureCodeIsa.h Resolved
Comment thread src/osd/scrubber/scrub_backend.cc Resolved
Comment thread src/osd/scrubber/scrub_backend.cc Resolved
Comment thread src/osd/scrubber/scrub_backend.cc Outdated

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.

@rzarzynski - any problem here (after your buffer changes)? thanks

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-actions

Copy link
Copy Markdown

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

@JonBailey1993
JonBailey1993 force-pushed the ec_optimisation_deep_scrubbing_implementation branch from 04e3702 to 6a4f771 Compare June 20, 2025 14:55
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

Rebased

@ljflores

ljflores commented Jun 26, 2025 •

Copy link
Copy Markdown
Member

@JonBailey1993 Apologies for the delay in QA- I ran into some issues that I think might be related to this PR. I'm asking Bharath to drop it and rerun some jobs to make sure. Can you take a look at the following issues and let me know what you think? I particularly think that (1) is related since the job failed twice, and it is running an ec-radosbench workload. (2) might not be related since it passed in a rerun, and I've seen a similar issue before, but it would be good to make sure.

The tests were also run on an older SHA (I see there have been further updates), so we might need to retest this one anyway.

Testing ref: https://tracker.ceph.com/issues/71409

Suspected regressions:

  1. This one failed twice:

/a/skanta-2025-06-03_11:03:28-rados-wip-bharath1-testing-2025-06-02-2052-distro-default-smithi/8307501
/a/skanta-2025-06-05_23:47:06-rados-wip-bharath1-testing-2025-06-02-2052-distro-default-smithi/8311804

rados/thrash-erasure-code/{ceph clusters/{fixed-4} fast/fast mon_election/connectivity msgr-failures/fastclose objectstore/{bluestore/{alloc$/{avl} base mem$/{low} onode-segment$/{512K-onoff} write$/{v1/{compr$/{no$/{no}} v1}}}} rados recovery-overrides/{more-async-partial-recovery} supported-random-distro$/{ubuntu_latest} thrashers/default thrashosds-health workloads/ec-radosbench}

2025-06-03T17:41:21.543 DEBUG:teuthology.orchestra.run.smithi119:> sudo adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 30 ceph --cluster ceph --admin-daemon /var/run/ceph/ceph-osd.13.asok dump_ops_in_flight
2025-06-03T17:41:21.543 INFO:tasks.ceph.osd.10.smithi144.stderr:2025-06-03T17:41:21.534+0000 7f6eff0b5640 -1 received  signal: Hangup from /usr/bin/python3 /usr/bin/daemon-helper kill ceph-osd -f --cluster ceph -i 10  (PID: 26881) UID: 0
2025-06-03T17:41:21.581 INFO:teuthology.orchestra.run.smithi044.stderr:nodeep-scrub is set
2025-06-03T17:41:21.643 ERROR:teuthology.run_tasks:Saw exception from tasks.
Traceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_teuthology_eaeb97003cfc43fc86754e4e45e7b398c784dedf/teuthology/run_tasks.py", line 105, in run_tasks
    manager = run_one_task(taskname, ctx=ctx, config=config)
  File "/home/teuthworker/src/git.ceph.com_teuthology_eaeb97003cfc43fc86754e4e45e7b398c784dedf/teuthology/run_tasks.py", line 83, in run_one_task
    return task(**kwargs)
  File "/home/teuthworker/src/git.ceph.com_teuthology_eaeb97003cfc43fc86754e4e45e7b398c784dedf/teuthology/task/full_sequential.py", line 37, in task
    mgr.__exit__(*exc_info)
  File "/usr/lib/python3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/home/teuthworker/src/github.com_ceph_ceph-c_28e985f5708ff44ef7be57b0a26d7b94fad5c783/qa/tasks/radosbench.py", line 142, in task
    run.wait(radosbench.values(), timeout=timeout)
  File "/home/teuthworker/src/git.ceph.com_teuthology_eaeb97003cfc43fc86754e4e45e7b398c784dedf/teuthology/orchestra/run.py", line 479, in wait
    check_time()
  File "/home/teuthworker/src/git.ceph.com_teuthology_eaeb97003cfc43fc86754e4e45e7b398c784dedf/teuthology/contextutil.py", line 134, in __call__
    raise MaxWhileTries(error_msg)
teuthology.exceptions.MaxWhileTries: reached maximum tries (800) after waiting for 4800 seconds
  1. This one passed on a rerun:

/a/skanta-2025-06-03_11:03:28-rados-wip-bharath1-testing-2025-06-02-2052-distro-default-smithi/8307584

rados/thrash/{0-size-min-size-overrides/2-size-2-min-size 1-pg-log-overrides/normal_pg_log 2-recovery-overrides/{more-async-partial-recovery} 3-scrub-overrides/{max-simultaneous-scrubs-1} backoff/normal ceph clusters/{fixed-4} crc-failures/bad_map_crc_failure d-balancer/upmap-read mon_election/classic msgr-failures/osd-delay msgr/async-v1only objectstore/{bluestore/{alloc$/{stupid} base mem$/{low} onode-segment$/{256K} write$/{v2/{compr$/{no$/{no}} v2}}}} rados supported-random-distro$/{centos_latest} thrashers/pggrow_host thrashosds-health workloads/radosbench}

2025-06-03T19:45:14.007 INFO:tasks.ceph.ceph_manager.ceph:{'pgid': '6.a', 'version': "0'0", 'reported_seq': 1228, 'reported_epoch': 2255, 'state': 'undersized+peered', 'last_fresh': '2025-06-03T19:45:07.345734+0000', 'last_change': '2025-06-03T19:25:07.912242+0000', 'last_active': '2025-06-03T19:25:06.897205+0000', 'last_peered': '2025-06-03T19:45:07.345734+0000', 'last_clean': '2025-06-03T19:25:06.897205+0000', 'last_became_active': '0.000000', 'last_became_peered': '2025-06-03T19:25:07.912242+0000', 'last_unstale': '2025-06-03T19:45:07.345734+0000', 'last_undegraded': '2025-06-03T19:45:07.345734+0000', 'last_fullsized': '2025-06-03T19:25:07.911604+0000', 'mapping_epoch': 1632, 'log_start': "0'0", 'ondisk_log_start': "0'0", 'created': 1632, 'last_epoch_clean': 0, 'parent': '0.0', 'parent_split_bits': 0, 'last_scrub': "0'0", 'last_scrub_stamp': '2025-06-03T19:25:06.897205+0000', 'last_deep_scrub': "0'0", 'last_deep_scrub_stamp': '2025-06-03T19:25:06.897205+0000', 'last_clean_scrub_stamp': '2025-06-03T19:25:06.897205+0000', 'objects_scrubbed': 0, 'log_size': 0, 'log_dups_size': 0, 'ondisk_log_size': 0, 'stats_invalid': False, 'dirty_stats_invalid': False, 'omap_stats_invalid': False, 'hitset_stats_invalid': False, 'hitset_bytes_stats_invalid': False, 'pin_stats_invalid': False, 'manifest_stats_invalid': False, 'snaptrimq_len': 0, 'last_scrub_duration': 0, 'scrub_schedule': 'queued for scrub', 'scrub_duration': 0, 'objects_trimmed': 0, 'snaptrim_duration': 0, 'stat_sum': {'num_bytes': 0, 'num_objects': 0, 'num_object_clones': 0, 'num_object_copies': 0, 'num_objects_missing_on_primary': 0, 'num_objects_missing': 0, 'num_objects_degraded': 0, 'num_objects_misplaced': 0, 'num_objects_unfound': 0, 'num_objects_dirty': 0, 'num_whiteouts': 0, 'num_read': 0, 'num_read_kb': 0, 'num_write': 0, 'num_write_kb': 0, 'num_scrub_errors': 0, 'num_shallow_scrub_errors': 0, 'num_deep_scrub_errors': 0, 'num_objects_recovered': 0, 'num_bytes_recovered': 0, 'num_keys_recovered': 0, 'num_o
bjects_omap': 0, 'num_objects_hit_set_archive': 0, 'num_bytes_hit_set_archive': 0, 'num_flush': 0, 'num_flush_kb': 0, 'num_evict': 0, 'num_evict_kb': 0, 'num_promote': 0, 'num_flush_mode_high': 0, 'num_flush_mode_low': 0, 'num_evict_mode_some': 0, 'num_evict_mode_full': 0, 'num_objects_pinned': 0, 'num_legacy_snapsets': 0, 'num_large_omap_objects': 0, 'num_objects_manifest': 0, 'num_omap_bytes': 0, 'num_omap_keys': 0, 'num_objects_repaired': 0}, 'up': [7], 'acting': [7], 'avail_no_missing': ['7'], 'object_location_counts': [], 'blocked_by': [], 'up_primary': 7, 'acting_primary': 7, 'purged_snaps': []}
2025-06-03T19:45:14.010 INFO:tasks.thrashosds.thrasher:Traceback (most recent call last):
  File "/home/teuthworker/src/github.com_ceph_ceph-c_28e985f5708ff44ef7be57b0a26d7b94fad5c783/qa/tasks/ceph_manager.py", line 192, in wrapper
    return func(self)
  File "/home/teuthworker/src/github.com_ceph_ceph-c_28e985f5708ff44ef7be57b0a26d7b94fad5c783/qa/tasks/ceph_manager.py", line 1488, in _do_thrash
    self.ceph_manager.wait_for_recovery(
  File "/home/teuthworker/src/github.com_ceph_ceph-c_28e985f5708ff44ef7be57b0a26d7b94fad5c783/qa/tasks/ceph_manager.py", line 3015, in wait_for_recovery
    assert now - start < timeout, \
AssertionError: wait_for_recovery: failed before timeout expired

@github-actions

github-actions Bot commented Jul 9, 2025

Copy link
Copy Markdown

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

@ronen-fr

Copy link
Copy Markdown
Contributor

…ing or CRCs

Add new flag for whether plugins support encoding/decoding or CRCs to get the CRC of what the encoded/decoded data would be.

Signed-off-by: Jon Bailey <[email protected]>
Add iterator traits to mini_flat_map and bitset_set iterator to allow std algorithms to be able to perform operations using the mini_flat_map iterator

Signed-off-by: Jon Bailey <[email protected]>
@JonBailey1993
JonBailey1993 force-pushed the ec_optimisation_deep_scrubbing_implementation branch from 6a4f771 to 9d140d1 Compare July 14, 2025 15:03
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

Rebase complete. No other changes in push.

@JonBailey1993
JonBailey1993 force-pushed the ec_optimisation_deep_scrubbing_implementation branch from 9d140d1 to de106ec Compare July 15, 2025 10:39
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

Rebase above fixes marge conflicts from all_shards being added into ECUtil.h while this PR was in progress (This PR had done the same and it conflicted). Have removed my additions and used the existing implementations of all_shards instead.

@JonBailey1993
JonBailey1993 force-pushed the ec_optimisation_deep_scrubbing_implementation branch from de106ec to afd3cae Compare July 15, 2025 12:38
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

jenkins test api

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.

8 participants