-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rbd-mirror: prevent I/O modifications against a non-primary image #33831
Conversation
@dillaman unittest_rbd_mirror crashed on jenkins |
jenkins test make check |
(appended a commit that fixed a random failure in the unit tests due to notifications not getting delivered to rbd-mirror) |
When a snapshot-based image is non-primary, we will need to use this implicit feature to ensure that writes and maintenance operations cannot be performed against the image. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This will be utilized by the RefreshRequest state machine to flag the image as read-only if the new RBD_FEATURE_NON_PRIMARY feature is enabled. Also allow that flag to be masked out by rbd-mirror daemon to permit IO and operations against a non-primary image. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
With the non-primary feature bit is enabled, mask-out the read-only feature bit that will be set in the refresh image state machine if the image has that feature bit set. This will ensure that only the rbd-mirror daemon will be able to modify a non-primary image. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When promoted to primary, disable the non-primary feature bit and when demoted (or created non-primary), enable the non-primary feature bit. This will prevent all non rbd-mirror RBD clients from modifying the RBD image. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The promote state machine will handle remove the non-primary feature bit and will ensure an interrupted disable operation doesn't leave things in an inconsistent state. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The exclusive-lock and journaling features are not required for snapshot-based mirroring. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This variable is not currently used in snapshot-based mirroring mode but it should be populated for consistency. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The state machine was incorrectly skipping over the mirror enable step for non-primary images when the journaling feature bit was not enabled. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When using snapshot-based mirroring, there shouldn't be any need to force the use of the exclusive-lock feature. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
…ures Ensure that snapshot-based mirroring is tested in different RBD image feature combinations. Fixes: https://tracker.ceph.com/issues/44396 Signed-off-by: Jason Dillaman <dillaman@redhat.com>
This feature is mutable from only within librbd as a mirrored image is promoted/demoted. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
If a refresh is in-progress when a header update notification is received, the notification was previously incorrectly dropped. This prevented rbd-mirror's snapshot-based mirroring replayer from detecting updates in some cases. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The non-primary image might have mirror snapshots that need to be updated to remove the peer reference. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new RBD_FEATURE_NON_PRIMARY overlaps with the legacy test for an invalid feature bit. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
http://pulpito.ceph.com/jdillaman-2020-03-11_14:09:34-rbd-wip-jd-testing-distro-basic-smithi/ (includes the fast-diff PR and the rbd_support pool scan improvements) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Checklist
Show available Jenkins commands
jenkins retest this please
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 backend
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox