Skip to content

qa: Add tests to validate synced images on rbd-mirror - #54802

Merged
idryomov merged 2 commits into
ceph:mainfrom
ajarr:wip-61617
Feb 23, 2024
Merged

idryomov merged 2 commits into
ceph:mainfrom
ajarr:wip-61617

Conversation

@ajarr

@ajarr ajarr commented Dec 6, 2023 •

Copy link
Copy Markdown
Contributor

Introduce functional tests to validate that the images under
workloads are correctly mirrored between two clusters using snapshot
based mirroring.

Run workload on a primary image using a krbd or nbd client. Take
mirror snapshots of the image under workload. Unmount the mapped image
and calculate its MD5 checksum before demoting it. After demotion,
wait for the mirror status of the image to be 'up+unknown' in both
the clusters. This is to make sure that the non-primary image in the
other cluster is ready to be promoted. Now promote the non-primary
image in the other cluster. Map the promoted image and calculate its
MD5 checksum. Verify that the checksums of the demoted and promoted
images in the two clusters are the same.

The above test is run as part of two different workunits:

  • a workunit that validates the syncing of multiple mirrored images
    with workloads running on them
  • another workunit that validates the syncing of a single mirrored
    image with workload running on it and the image is set as primary
    alternatively between the two clusters, as it happens during
    failover and failback scenarios.

Fixes: https://tracker.ceph.com/issues/61617
Signed-off-by: Ramana Raja [email protected]
Co-authored-by: Ilya Dryomov [email protected]
Co-authored-by: Christopher Hoffman [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

@ajarr
ajarr requested a review from a team as a code owner December 6, 2023 03:27
@ajarr
ajarr marked this pull request as draft December 6, 2023 03:27
@ajarr ajarr added rbd and removed rbd labels Dec 6, 2023
@ajarr
ajarr force-pushed the wip-61617 branch 2 times, most recently from ff37a75 to e6e181f Compare December 8, 2023 16:22
@ajarr
ajarr force-pushed the wip-61617 branch 2 times, most recently from 340dbf4 to e2ffa60 Compare January 16, 2024 20:37
@ajarr
ajarr marked this pull request as ready for review January 16, 2024 20:39
@ajarr

ajarr commented Jan 16, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@ajarr

ajarr commented Jan 17, 2024

Copy link
Copy Markdown
Contributor Author

@ajarr
ajarr requested a review from idryomov January 17, 2024 11:06

@idryomov idryomov 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.

Pretty much all comments on compare_mirror_image_alternate_primary.sh apply to compare_mirror_images.sh too. I didn't duplicate them there.

@ajarr
ajarr marked this pull request as draft February 5, 2024 16:37
@ajarr

ajarr commented Feb 7, 2024

Copy link
Copy Markdown
Contributor Author

And missed to update the commit message

@ajarr

ajarr commented Feb 13, 2024 •

Copy link
Copy Markdown
Contributor Author

@ajarr

ajarr commented Feb 13, 2024 •

Copy link
Copy Markdown
Contributor Author

Tests running against the branch with data corruption fixes in librbd reverted.

Failed runs with MD5 mistmatches only for tests using nbd, i.e., librbd clients.

compare-mirror-image-{krbd,nbd} workloads
https://pulpito.ceph.com/rraja-2024-02-13_03:22:18-rbd:mirror-wip-ajarr-revert-corruption-fixes-feb-12-1-distro-default-smithi/

compare-mirror-image-alternate-primary-{krbd,nbd} workloads
https://pulpito.ceph.com/rraja-2024-02-13_03:22:37-rbd:mirror-wip-ajarr-revert-corruption-fixes-feb-12-1-distro-default-smithi/

@ajarr
ajarr requested a review from idryomov February 13, 2024 03:34
@ajarr
ajarr marked this pull request as ready for review February 13, 2024 03:34
@ajarr

ajarr commented Feb 14, 2024

Copy link
Copy Markdown
Contributor Author

Tests running on main branch with custom kernel that reverted data corruption fixes in krbd.

I expect to see only the krbd workloads failing with MD5 mismatch errors.

compare-mirror-image-{krbd,nbd} workloads
https://pulpito.ceph.com/rraja-2024-02-14_18:23:37-rbd:mirror-main-wip-revert-exclusive-lock-snapc-default-smithi/

compare-mirror-image-alternate-primary-{krbd,nbd} workloads
https://pulpito.ceph.com/rraja-2024-02-14_18:37:40-rbd:mirror-main-wip-revert-exclusive-lock-snapc-default-smithi/

Note:
Commands used to schedule the runs

$ export CEPH_QA_MAIL="[email protected]"; MACHINE_NAME=smithi; CEPH_BRANCH=main

$ teuthology-suite -v --ceph-repo https://github.com/ceph/ceph-ci.git --suite-repo https://github.com/ajarr/ceph -c $CEPH_BRANCH --suite-branch  wip-61617-feb-12-2024 -m $MACHINE_NAME -s rbd/mirror -p 50 -e $CEPH_QA_MAIL --kernel wip-revert-exclusive-lock-snapc --filter-all compare-mirror-images,ubuntu -l 8

$ teuthology-suite -v --ceph-repo https://github.com/ceph/ceph-ci.git --suite-repo https://github.com/ajarr/ceph -c $CEPH_BRANCH --suite-branch  wip-61617-feb-12-2024 -m $MACHINE_NAME -s rbd/mirror -p 50 -e $CEPH_QA_MAIL --kernel wip-revert-exclusive-lock-snapc --filter-all compare-mirror-image-alternate-primary,ubuntu -l 8

@ajarr

ajarr commented Feb 14, 2024

Copy link
Copy Markdown
Contributor Author

Note to the reviewer:

@ajarr

ajarr commented Feb 15, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@idryomov

Copy link
Copy Markdown
Contributor

jenkins test api

Comment thread qa/workunits/rbd/rbd_mirror_helpers.sh Resolved
Comment thread qa/workunits/rbd/rbd_mirror_helpers.sh Resolved
Comment thread qa/workunits/rbd/rbd_mirror_helpers.sh Resolved
@ajarr

ajarr commented Feb 21, 2024

Copy link
Copy Markdown
Contributor Author

Test runs on the latest patchset on 'main' branch
https://pulpito.ceph.com/rraja-2024-02-21_18:33:58-rbd:mirror-main-distro-default-smithi/
https://pulpito.ceph.com/rraja-2024-02-21_19:07:11-rbd:mirror-main-distro-default-smithi/

Since last patchset,

  • removed setting CEPH_ARGS='' in the two scripts as the rbd_mirror_helpers.sh script sets it to --id mirror
  • mirror pool status like mirror image status also hit "failed to query services: (13) Permission denied" . So executed the command with CEPH_ARGS='' and I no longer see "failed to query services: (13) Permission denied" .

Comment thread qa/workunits/rbd/rbd_mirror_helpers.sh Resolved
ajarr and others added 2 commits February 22, 2024 11:44
In rbd_mirror_helpers.sh, the `wait_for_status_in_pool_dir()` helper
stored `mirror image status` and `mirror pool status` command outputs
in files that could be shared over successive calls or calls from
multiple threads. Instead store the command outputs in local variables
to make `wait_for_status_in_pool_dir()` reentrant.

Signed-off-by: Ramana Raja <[email protected]>
Introduce functional tests to validate that the images under
workloads are correctly mirrored between two clusters using snapshot
based mirroring.

Run workload on a primary image using a krbd or nbd client. Take
mirror snapshots of the image under workload. Unmount the mapped image
and calculate its MD5 checksum before demoting it. After demotion,
wait for the mirror status of the image to be 'up+unknown' in both
the clusters. This is to make sure that the non-primary image in the
other cluster is ready to be promoted. Now promote the non-primary
image in the other cluster. Map the promoted image and calculate its
MD5 checksum. Verify that the checksums of the demoted and promoted
images in the two clusters are the same.

The above test is run as part of two different workunits:
 - a workunit that validates the syncing of multiple mirrored images
   with workloads running on them
 - another workunit that validates the syncing of a single mirrored
   image with workload running on it and the image is set as primary
   alternatively between the two clusters, as it happens during
   failover and failback scenarios.

Fixes: https://tracker.ceph.com/issues/61617
Signed-off-by: Ramana Raja <[email protected]>
Co-authored-by: Ilya Dryomov <[email protected]>
Co-authored-by: Christopher Hoffman <[email protected]>
@idryomov

Copy link
Copy Markdown
Contributor

LGTM! Could you please schedule 10 jobs of each type against bad builds, just in case?

@idryomov

Copy link
Copy Markdown
Contributor

Runs on 'main' using kernel build (wip-revert-exclusive-lock-snapc), that has the data corruption fixes reverted.

Please schedule the same for a librbd build with reverts for completeness.

@ajarr

ajarr commented Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

Runs on 'main' using kernel build (wip-revert-exclusive-lock-snapc), that has the data corruption fixes reverted.

Please schedule the same for a librbd build with reverts for completeness.

Yes, I did try to do it with old build. It looks like I need a new build as some packages are missing. I've initiated the new build.

@idryomov

Copy link
Copy Markdown
Contributor

It looks like I need a new build as some packages are missing. I've initiated the new build.

Yup, IIRC builds expire after two weeks.

@ajarr

ajarr commented Feb 23, 2024

Copy link
Copy Markdown
Contributor Author

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.

2 participants