Skip to content

test/rbd-mirror: eliminate a race in ResyncRequestedRemoteNotPrimary#64757

Merged
idryomov merged 1 commit intoceph:mainfrom
VinayBhaskar-V:wip-unittest-72325
Jul 30, 2025
Merged

test/rbd-mirror: eliminate a race in ResyncRequestedRemoteNotPrimary#64757
idryomov merged 1 commit intoceph:mainfrom
VinayBhaskar-V:wip-unittest-72325

Conversation

@VinayBhaskar-V
Copy link
Copy Markdown
Contributor

@VinayBhaskar-V VinayBhaskar-V commented Jul 30, 2025

Adjust the wait_for_notification call in TestMockImageReplayerSnapshotReplayer.ResyncRequestedRemoteNotPrimary
to expect 2 notifications instead of 1. This allows the test to correctly wait for both expected events
i.e for finish_sync() and handle_replay_complete(locker, -EREMOTEIO, "remote image demoted"), ensuring the
replayer transitions to STATE_COMPLETE and is_replaying() returns false as intended.

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

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

@VinayBhaskar-V VinayBhaskar-V requested a review from a team as a code owner July 30, 2025 10:34
@VinayBhaskar-V VinayBhaskar-V changed the title rbd-mirror: Fix TestMockImageReplayerSnapshotReplayer.ResyncRequestedNotPrimary Fix TestMockImageReplayerSnapshotReplayer.ResyncRequestedNotPrimary Jul 30, 2025
@VinayBhaskar-V VinayBhaskar-V changed the title Fix TestMockImageReplayerSnapshotReplayer.ResyncRequestedNotPrimary Fix TestMockImageReplayerSnapshotReplayer unittest Jul 30, 2025
@idryomov idryomov changed the title Fix TestMockImageReplayerSnapshotReplayer unittest test/rbd-mirror: eliminate a race in ResyncRequestedRemoteNotPrimary Jul 30, 2025
Copy link
Copy Markdown
Contributor

@idryomov idryomov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correctly wait for both expected asynchronous events

It would be nice to mention which events are being waited for.

Fixes: https://tracker.ceph.com/issues/72325#change-314364

Drop #change-314364 and make the title of the commit match the title of the PR.

Adjust the wait_for_notification call in TestMockImageReplayerSnapshotReplayer.ResyncRequestedRemoteNotPrimary
to expect 2 notifications instead of 1. This allows the test to correctly wait for both expected events
i.e for finish_sync() and handle_replay_complete(locker, -EREMOTEIO, "remote image demoted"), ensuring the
replayer transitions to STATE_COMPLETE and is_replaying() returns false as intended.

Fixes: https://tracker.ceph.com/issues/72325
Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
@VinayBhaskar-V
Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

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