Skip to content

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

Merged
idryomov merged 3 commits into
ceph:reeffrom
ajarr:wip-64554-reef
Mar 19, 2024
Merged

idryomov merged 3 commits into
ceph:reeffrom
ajarr:wip-64554-reef

Conversation

@ajarr

@ajarr ajarr commented Feb 26, 2024 •

Copy link
Copy Markdown
Contributor

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]>
(cherry picked from commit ea3a567)
@ajarr
ajarr requested a review from a team as a code owner February 26, 2024 16:48
@ajarr ajarr added this to the reef milestone Feb 26, 2024
@ajarr ajarr added the tests label Feb 26, 2024
@github-actions github-actions Bot added the rbd label Feb 26, 2024
@idryomov

Copy link
Copy Markdown
Contributor

jenkins test api

@ajarr

ajarr commented Mar 11, 2024

Copy link
Copy Markdown
Contributor Author

@idryomov , can you please take a look?

Once Ilya approves this PR, @yuriw can you please include the latest version of this PR in your testing instead? I had to include a fix that got merged into main earlier today. Thanks!

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

Conflicts:
qa/workunits/rbd/rbd_mirror_journal.sh
- Commit ajarr@3fd8a03 not backported
"qa/workunits/rbd: merge journal and snapshot test scripts"

@ajarr The resolution turns out to be incomplete. This commit also introduced wait_for_replaying_status_in_pool_dir() which is used in compare_mirror_images.sh. Need to replace that with a call to wait_for_status_in_pool_dir() and spell out the status.

ajarr and others added 2 commits March 14, 2024 10:19
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]>
(cherry picked from commit b7aae5c)

Cherry-pick notes:
- In qa/workunits/rbd/compare_mirror_images.sh, replace
  `wait_for_replaying_status_in_pool_dir` with `wait_for_status_in_pool_dir`
  Commit 3fd8a03 that added `wait_for_replaying_status_in_pool_dir`
  not backported
By making use of here strings in commit ea3a567 ("qa/workunits:
make wait_for_status_in_pool_dir() reentrant") we grew a dependency on
bash.

Signed-off-by: Ilya Dryomov <[email protected]>
(cherry picked from commit 166a236)
Signed-off-by: Ramana Raja <[email protected]>

Conflicts:
	qa/workunits/rbd/rbd_mirror_journal.sh
        -  Commit 3fd8a03 not backported
           "qa/workunits/rbd: merge journal and snapshot test scripts"
@ajarr
ajarr requested a review from idryomov March 14, 2024 14:20
@ajarr

ajarr commented Mar 14, 2024

Copy link
Copy Markdown
Contributor Author

Conflicts:
qa/workunits/rbd/rbd_mirror_journal.sh

  • Commit ajarr@3fd8a03 not backported
    "qa/workunits/rbd: merge journal and snapshot test scripts"

@ajarr The resolution turns out to be incomplete. This commit also introduced wait_for_replaying_status_in_pool_dir() which is used in compare_mirror_images.sh. Need to replace that with a call to wait_for_status_in_pool_dir() and spell out the status.

Fixed. Thanks!

@idryomov

Copy link
Copy Markdown
Contributor

jenkins test make check

@idryomov

Copy link
Copy Markdown
Contributor

Merging based on https://trello.com/c/bCURjoHF which tested this as included in #55928.

@idryomov
idryomov merged commit f6848a8 into ceph:reef Mar 19, 2024
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