Skip to content

common/io_exerciser: Add support to ceph_test_rados_io_sequence injecting errors for testing how erasure coding deals with error scenarios - #60330

Merged
JonBailey1993 merged 10 commits into
ceph:mainfrom
JonBailey1993:JonBailey1993/ceph_test_rados_io_sequence_inject_error
Jan 9, 2025

Conversation

@JonBailey1993

@JonBailey1993 JonBailey1993 commented Oct 15, 2024 •

Copy link
Copy Markdown
Contributor

common/io_exerciser: Add support to ceph_test_rados_io_sequence for error injects

Adds support to the ceph_test_rados_io_sequence application so that it can simulate OSDs returning errors. It does this by sending commands through the ceph admin socket to inject different types of error responses in OSDs.
The application currently implements this in interactive mode, and in automated mode through some simple tests that take an existing test and perform it with an OSD injecting an error throughout the test run.

This PR contains commits from #59926 (as it depends on them for interactive mode implementation of new code) - if that one gets reviewed and merged first, I will rebase this PR so there is less to review here.

Signed-off-by: JonBailey1993 [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

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence_inject_error branch 2 times, most recently from d80050d to 6db1ead Compare October 16, 2024 12:18
@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence_inject_error branch 9 times, most recently from dcab269 to 91bf624 Compare October 25, 2024 21:29
@JonBailey1993
JonBailey1993 marked this pull request as ready for review October 25, 2024 21:31
@JonBailey1993
JonBailey1993 requested a review from a team as a code owner October 25, 2024 21:31
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

@JonBailey1993
JonBailey1993 marked this pull request as draft October 26, 2024 04:47
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

Ceph-ci runs due to compilation failure where operator -> of unique_ptr cannot be called in constexpr function, due to not being constexpr, but clang (which I developed using) allowing it. Have fixed and will push the new fix and rerun.

@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence_inject_error branch from 91bf624 to ac252d1 Compare October 28, 2024 11:39
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

ceph API tests failed due to a compilation issue with the way I was using std::views::iota with clang-14. Pushing an update with a fix.

@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence_inject_error branch from ac252d1 to 35bc870 Compare October 28, 2024 14:13
@JonBailey1993
JonBailey1993 marked this pull request as ready for review October 28, 2024 14:24
@JonBailey1993 JonBailey1993 changed the title common/io_exerciser: Add support to ceph_test_rados_io_sequence for error injects common/io_exerciser: Add support to ceph_test_rados_io_sequence injecting errors for testing how erasure coding deals with error scenarios Oct 28, 2024
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

Hi @ronen-fr - I have added you as an assignee, I would appreciate if you could give these changes a review a review when you have time.

Changes include adding new OPs and sequences to the ceph_test_rados_io_sequence exerciser to allow testing of non-good path IO and recovery paths by injecting read and write errors into the OSD so other paths through the IO path will be tested when those sequences are run (along with a new command line parameter to indicate you want to test recovery paths).

@@ -0,0 +1,321 @@
#include <memory>

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.

A basic question here: why invent our own JSON structures? there are stable C++ libraries for JSON data manipulation (there is boost::json, which I do not have first hand experience with; there is Nlohmann's (which
I did use a few times), and there are others. Is there a reason to invent our own?

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.

BTW - Nlohmann is used by Jaegertracing, which is (for now?) part of our codebase.

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.

I was using the json_spirit library which we use elsewhere in Ceph and was just trying to encapsulate code which I kept repeating into one place rather than it being spread throughout ceph_test_rados_io_sequence and duplicated in other classes, such as decoding the strings into the various types of the structures I wanted to use.

It was originally meant to be more a class for just storing structs that I would decode the json strings into, but looking back I've slowly absorbed the json decoding logic of json_spirit into it.

I'm happy to change this over to Nlohmann json which might match the desired interface I was after with the structs better anyway if we want, as building a new JSON library wasn't my intention here.

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.

I've added a new commit changing the JSON so it completely takes of advantage of ceph_json.h in the way we use it in other parts of the code. If you are happy with these changes I've made, let me know and I'll be happy to merge it in.

Comment thread src/common/io_exerciser/ObjectModel.cc Resolved
Comment thread src/common/io_exerciser/DataGenerator.h Resolved
@ronen-fr

Copy link
Copy Markdown
Contributor

LGTM - apart from that one style comment

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

ceph API tests

Cloning repository https://github.com/ceph/ceph.git
 > git init /home/jenkins-build/build/workspace/ceph-api # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /home/jenkins-build/build/workspace/ceph-api

Looks like an error occurred cloning the repository ([172.21.3.232+irvingi03]). Will rekick the Jenkins API tests.

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test api

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

ceph API tests

2024-11-15T15:43:30.719+0000 7f74fa897500 -1 error: monitor data filesystem reached concerning levels of available storage space (available: 0% 606 MiB)
you may adjust 'mon data avail crit' to a lower value to make this go away (default: 1%)

Using guessed paths /home/jenkins-build/build/workspace/ceph-api/build/lib/ ['/home/jenkins-build/build/workspace/ceph-api/qa', '/home/jenkins-build/build/workspace/ceph-api/build/lib/cython_modules/lib.3', '/home/jenkins-build/build/workspace/ceph-api/src/pybind']
Traceback (most recent call last):
  File "/home/jenkins-build/build/workspace/ceph-api/build/../qa/tasks/vstart_runner.py", line 1616, in <module>
    exec_test()
...
teuthology.exceptions.CommandFailedError: Command failed with status 28: '../src/vstart.sh -n --nolockdep'

Filesystem looks to be full on test machine ([172.21.3.230+irvingi05]). Will rerun the api tests (again).

Is there somewhere things like this should be reported?

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test api

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

ceph API tests
`Cloning repository https://github.com/ceph/ceph.git

git init /home/jenkins-build/build/workspace/ceph-api # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /home/jenkins-build/build/workspace/ceph-api`

Original issue again

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test api

@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence_inject_error branch from 77626fc to c5aa5d6 Compare November 25, 2024 13:03
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@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 and others added 10 commits January 7, 2025 11:40
Implement inheritence for ceph::io_exerciser::IoOp to allow better differentiation between the different Op types and allow more complex Operations to be implemented

Signed-off-by: Jon Bailey <[email protected]>
Error inject interfaces for EC reads and writes using
ceph tell osd.<n> interface

Signed-off-by: Bill Scales <[email protected]>
…equence interactive mode

Add injecterror commands that can be used in interactive mode to inject read and write errors as well as clear them

Signed-off-by: Jon Bailey <[email protected]>
Add sequences to test IOs with simple error injects, along with some small fixes for previous error inject implementation.

Signed-off-by: Jon Bailey <[email protected]>
…eph_json.h fully.

Also moved and renamed JSONStructures files so they structures are more easily identifiable and usable by others if desired.

Signed-off-by: Jon Bailey <[email protected]>
…6 and random values are generated thereafter

Signed-off-by: Jon Bailey <[email protected]>
@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence_inject_error branch from a89b0a4 to 8fb7829 Compare January 7, 2025 13:19
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

I am planning to commit this on Friday (10th January 2025) so long as no more comments are made, as this PR is approved. If any changes are requested, let me know/comment before then.

I have rebased to the latest main and tested here: https://shaman.ceph.com/builds/ceph/wip_JonBailey1993_ceph_test_rados_io_sequence_inject_error_rebased/b4e4c3546cd09daec76dba14708017cc65bf9a8b/ along with local testing and I'm satisfied it is behaving as desired from my testing.

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.

3 participants