Skip to content

osd/ECBackend.cc: Fix double increment of num_shards_repaired stat - #58139

Merged
yuriw merged 1 commit into
ceph:mainfrom
bill-scales:fix_num_shards_repaired_stat
Jun 25, 2024
Merged

yuriw merged 1 commit into
ceph:mainfrom
bill-scales:fix_num_shards_repaired_stat

Conversation

@bill-scales

Copy link
Copy Markdown
Contributor

Commit deffa82 refactored ECBackend::handle_recovery_push for Crimson but accidentally duplicated the code that increments the num_shards_repaired OSD statistic.

This caused one of the QA tests to fail because the stat reported twice as much repair work had been completed than expected:

qa/standalone/scrub/osd-scrub-repair.sh: TEST_repair_stats_ec: test 26 = 13

Running the standalone test without the fix reproduces the error every time. Running the standalone test with this fix passes.

It is clear from reviewing the commit above that the intent was to keep the code the same and just split the function ECBackend::handle_recovery_push into two functions - one that has code that will be common with Crimson and one that has the remainder of the code, however the increment of the statistic was left in both functions.

Fixes: https://tracker.ceph.com/issues/64437
Signed-off-by: Bill Scales [email protected]

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
  • 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
  • jenkins test rook e2e

Commit ceph@deffa82 refactored
ECBackend::handle_recovery_push for Crimson but accidentally duplicated the code that increments
the num_shards_repaired OSD statistic.

This caused one of the QA tests to fail because the stat reported twice as much repair work
had been completed than expected:

qa/standalone/scrub/osd-scrub-repair.sh: TEST_repair_stats_ec: test 26 = 13

Fixes: https://tracker.ceph.com/issues/64437

Signed-off-by: Bill Scales <[email protected]>
@bill-scales
bill-scales requested a review from a team as a code owner June 19, 2024 13:38
@github-actions github-actions Bot added the core label Jun 19, 2024
Comment thread src/osd/ECBackend.cc
int r = store->stat(ch, ghobject_t(op.soid, ghobject_t::NO_GEN,
get_parent()->whoami_shard().shard), &st);
if (r == 0) {
get_parent()->pg_sub_local_num_bytes(st.st_size);

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.

Oh, handling of pg_sub_local_num_bytes & co has been dissected but I missed inc_osd_stat_repaired. Thanks for nailing this down!

@ronen-fr

Copy link
Copy Markdown
Contributor

great! I'll reinstate the test once this fix is merged.

@ljflores

Copy link
Copy Markdown
Member

This will get in the next main batch. Thx @bill-scales !

@neha-ojha

Copy link
Copy Markdown
Member

@neha-ojha

Copy link
Copy Markdown
Member

jenkins test make check

@bill-scales

Copy link
Copy Markdown
Contributor Author

Analysis of test failures:

make check X86 tests failed due to race hazard in unittest_rocksdb_option / TestRocksdbOptionParse.cc

make check X86 tests failed with an instance of existing issue https://tracker.ceph.com/issues/66556

  • Test ran successfully locally - looks like its a race hazard

make check ARM tests failed with an instance of existing issue https://tracker.ceph.com/issues/46875

  • X86 version of test ran successfully locally - another race hazard?

None of these are related to the code change

@bill-scales

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@bill-scales

Copy link
Copy Markdown
Contributor Author

Another unrelated test failure from run_rbd_unit_tests_109.sh (https://jenkins.ceph.com/job/ceph-pull-requests/137260/testReport/junit/projectroot.src/test/run_rbd_unit_tests_109_sh/)

[ RUN      ] TestLibRBD.CacheMayCopyOnWrite
using new format!
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/librbd/test_librbd.cc:10694: Failure
Expected equality of these values:
  0
  rbd.clone(ioctx, name.c_str(), "one", ioctx, clone_name.c_str(), (1ULL<<0), &order)
    Which is: -9
[  FAILED  ] TestLibRBD.CacheMayCopyOnWrite (109 ms)

This test isn't anything related to the code change, and passed previously so must be another race hazard :-( I think -9 is EBADF which means the image name already exists? I'll investigate further but meanwhile lets have another go

@bill-scales

Copy link
Copy Markdown
Contributor Author

jenkins test make check

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.

6 participants