Skip to content

src/test/osd: create ceph_test_rados_io_sequence testing tool - #59857

Merged
JonBailey1993 merged 4 commits into
ceph:mainfrom
JonBailey1993:JonBailey1993/ceph_test_rados_io_sequence
Oct 7, 2024
Merged

JonBailey1993 merged 4 commits into
ceph:mainfrom
JonBailey1993:JonBailey1993/ceph_test_rados_io_sequence

Conversation

@JonBailey1993

@JonBailey1993 JonBailey1993 commented Sep 18, 2024 •

Copy link
Copy Markdown
Contributor

src/test/osd: Create ceph_test_rados_io_sequence tool

Application creates IO sequences using seeded random numbers. IO sequences are varied in IO offset, length, IO order and data patterns to try stress erasure coding specifically and detect defects earlier in the development cycle.

We feel the creation of this as a new tool is benificial for several reasons:

  • Existing test tools either generate completely random I/O (with different offsets and lengths) or test very uniform I/O (either read/write whole object or read/writes with fixed length). This is very inefficient (relies on brute force) for testing boundary conditions. The I/O sequence test tool generates sequences of I/Os to specifically test boundary conditions
  • Existing test tools only generate RADOS requests that contain a single read or write request. Recent regressions found in EC show that clients (e.g. RBD with LUKs) can generate RADOS requests that contain multiple reads or writes. This tool will sometimes generate requests with 2 or 3 I/O operations
  • Quality of data patterns when writing to objects and validation of data for reading is not as great as desired in existing test tools. This means that code bugs where the wrong part of an object is read/written may not be detected. This tool creates more sophisticated data patterns and keeps a model of the object to track the expected contents of the object.
  • For erasure coding there are many choices of erasure code profile, this tool can create pools and exercise multiple different profiles in parallel to speed up testing.

The test tool is located in src/test/osd, as the new tool is used explicitly for testing the erasure coding implementation of OSDs. A lot of the logic for generating IO Sequences has been stored in a new location, io_exerciser, located in src/common. The thinking behind storing the code here is we feel it is useful to share between other applications. It is abstracted to a level it shouldn't be necissairy to have to be only used with only the new ceph_test_rados_io_sequence application and we would like to be able to integrate with other tools such as ceph_test_rados or possibly rados bench as well in future PRs to enhance testing done with those tools.

Signed-off-by: Jon Bailey [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
JonBailey1993 requested a review from a team as a code owner September 18, 2024 11:42
@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence branch 2 times, most recently from 5ce5fed to 41fd338 Compare September 18, 2024 15:52
Creation of ceph_test_radios_io_sequence tool.
Application creates IO sequences using seeded random numbers.
IO sequences are varied in IO offset, length, IO order and data patterns to try stress erasure coding specifically and detect defects earlier in the development cycle.

We feel the creation of this as a new tool is benificial for several reasons:
* Existing test tools either generate completely random I/O (with different offsets and lengths) or test very uniform I/O (either read/write whole object or read/writes with fixed length). This is very inefficient (relies on brute force) for testing boundary conditions. The I/O sequence test tool generates sequences of I/Os to specifically test boundary conditions
* Existing test tools only generate RADOS requests that contain a single read or write request. Recent regressions found in EC show that clients (e.g. RBD with LUKs) can generate RADOS requests that contain multiple reads or writes. This tool will sometimes generate requests with 2 or 3 I/O operations
* Quality of data patterns when writing to objects and validation of data for reading is not as great as desired in existing test tools. This means that code bugs where the wrong part of an object is read/written may not be detected. This tool creates more sophisticated data patterns and keeps a model of the object to track the expected contents of the object.
* For erasure coding there are many choices of erasure code profile, this tool can create pools and exercise multiple different profiles in parallel to speed up testing.

The test tool is located in src/test/osd, as the new tool is used explicitly for testing the erasure coding implementation of OSDs.
A lot of the logic for generating IO Sequences has been stored in a new location, io_exerciser, located in src/common. The thinking behind storing the code here is we feel it is useful to share between other applications.
It is abstracted to a level it shouldn't be necissairy to have to be only used with only the new ceph_test_rados_io_sequence application and we would like to be able to integrate with other tools such as ceph_test_rados or possibly rados bench as well in future PRs to enhance testing done with those tools.

Signed-off-by: Jon Bailey <[email protected]>
@JonBailey1993
JonBailey1993 force-pushed the JonBailey1993/ceph_test_rados_io_sequence branch from 41fd338 to afb6399 Compare September 18, 2024 17:00
Comment thread src/common/io_exerciser/Model.h Resolved
Comment thread src/common/io_exerciser/Model.h Resolved
Comment thread src/common/io_exerciser/Model.h Resolved
Comment thread src/common/io_exerciser/ObjectModel.cc Resolved
Comment thread src/common/io_exerciser/ObjectModel.cc Resolved
Removes use of const members to allow possibility of moving.
Changes strings that were passed by value to now be const ref.
Adds readability improvements to shorten repeated use of long namespace names in cpp files.
Use std::generator for initialisation of seeds instead of previous for loop

Signed-off-by: Jon Bailey <[email protected]>
Comment thread src/common/io_exerciser/IoOp.h Resolved
Comment thread src/common/io_exerciser/IoOp.cc Resolved
Comment thread src/common/io_exerciser/IoOp.cc Resolved
Comment thread src/common/io_exerciser/DataGenerator.h Resolved
@ronen-fr

Copy link
Copy Markdown
Contributor

nice work!

Comment thread src/common/io_exerciser/RadosIo.cc Resolved
@ronen-fr

Copy link
Copy Markdown
Contributor

LGTM apart from some style comments.
Marking as 'approved', but would appreciate you checking the comments.

@ronen-fr ronen-fr 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.

see comments

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

LGTM apart from some style comments. Marking as 'approved', but would appreciate you checking the comments.

Will check through comments this morning and update code in places. Thanks for taking the time to review this.

Removed dataGenerationSingleton.
Changed stringstream to use of fmt::format
Made enums into enum classes

Signed-off-by: Jon Bailey <[email protected]>
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

see comments

Have addressed all comments now, either by resolving in code or with a reply to the comment

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

ceph API tests check failed.

Failed during build step installing dashboard nodeenv:
[1772/1776] dashboard nodeenv is being installed FAILED: src/pybind/mgr/dashboard/frontend/node-env/bin/npm /home/jenkins-build/build/workspace/ceph-api/build/src/pybind/mgr/dashboard/frontend/node-env/bin/npm

Looking further down the logs, looks like connection was interrupted during download of node
* Install prebuilt node (20.13.1) .Incomplete read while reading from https://nodejs.org/download/release/v20.13.1/node-v20.13.1-linux-x64.tar.gz - IncompleteRead(3186688 bytes read, 43534552 more expected) Incomplete read while reading from https://nodejs.org/download/release/v20.13.1/node-v20.13.1-linux-x64.tar.gz - IncompleteRead(2531328 bytes read, 44189912 more expected) Incomplete read while reading from https://nodejs.org/download/release/v20.13.1/node-v20.13.1-linux-x64.tar.gz - IncompleteRead(14393344 bytes read, 32327896 more expected)

Will retrigger ceph API tests as looks to have been a network glitch during building from my inspection here.

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test api

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

make check (arm64) check failed.

Failure reason looks similar to the last test
FAILED: src/pybind/mgr/dashboard/frontend/CMakeFiles/mgr-dashboard-nodeenv /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend/CMakeFiles/mgr-dashboard-nodeenv

Same step was above and in progress:
[2306/2698] dashboard nodeenv is being installed

Failure reason looks to be the same, with extra text in the middle due to presumably another thread starting a different build step while the previous one was working towards the failure
` * Install prebuilt node (20.13.1) .Incomplete read while reading from https://nodejs.org/download/release/v20.13.1/node-v20.13.1-linux-arm64.tar.gz - IncompleteRead(1908736 bytes read, 44521098 more expected)
..... done.

  • Appending data to /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend/node-env/bin/activate
  • Appending data to /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend/node-env/bin/activate.fish
    [2307/2698] cd /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend && . /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend/node-env/bin/activate && npm config set cache /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend/node-env/.npm --userconfig /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend/node-env/.npmrc && deactivate
    FAILED: src/pybind/mgr/dashboard/frontend/CMakeFiles/mgr-dashboard-nodeenv /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/pybind/mgr/dashboard/frontend/CMakeFiles/mgr-dashboard-nodeenv `

I believe this is the same network glitch on the build system and will retrigger the make check (arm64) test

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

Looks like API tests failed due to a timeout again... Dashboard (or any code relating to Ceph itself) has not been modified in this PR (All code is new and creating a new application), so I believe these changes are not the cause of this issue.
Retriggering api tests
ERROR: setUpClass (tasks.mgr.dashboard.test_health.HealthTest)
File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/dashboard/helper.py", line 223, in setUpClass cls.mds_cluster.mds_stop()
teuthology.exceptions.MaxWhileTries: Timed out waiting for daemon mds.a

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test api

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

1 similar comment
@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@JonBailey1993

JonBailey1993 commented Oct 1, 2024 •

Copy link
Copy Markdown
Contributor Author

301/301 Test #262: unittest-transaction-manager ..............***Timeout 7201.31 sec
One unit test for arm64 hit timeout and was aborted. Test that failed is not related to added code as new code does not modify that area. Code added does not modify existing classes, but only adds new classes which are only used in the newly added application created in this PR and not called by this unit test. Will retrigger once more.

@JonBailey1993

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64


bool RadosIo::readyForIoOp(IoOp &op)
{
ceph_assert(lock.is_locked_by_me()); //Must be called with lock held

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.

Line fails build complaining about missing function is_locked_by_me().
Build fails when doing a DEBUG build

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 have a PR open to fix this here: #60211, as this code has now unfortunately merged with this line in.

However I noticed the opposite when opening the PR - that the build fails when doing a RELEASE/RelWithDebInfo build and succeeds when doing a DEBUG build. Can I confirm the build type you are doing please? If it is debug, are you able to provide any more information?

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.

I was doing DEBUG build (which activates the assert code) and failed with a complain about non-existing member function is_locked_by_me() for BOOST::lock.

I comment out the assert line in my code and now it builds fine

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