-
Notifications
You must be signed in to change notification settings - Fork 189
mirroring: disable mirroring when secondary cluster is down #3379
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
base: main
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rewantsoni The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
0df4775 to
111f01e
Compare
|
/hold for testing |
|
@rewantsoni This refactor introduce a lot of noise into the code base. Although the shouldMirror is only calculated once, the decision on how to act on it is spread all over the reconcile function and even being passed downward into other sub functions. Preferably the decision need to be made as early as possible in the reconcile flow then a reconcile path is being choosed based on the result. Doing it this way will benefit the code base, the readability and the ability to reason about the flow. |
@nb-ohad The problem is that we need to reconcile RBDMirror, CephBlockPools, and Radosnamespace in both cases. When shouldMirror is true we need to deploy rbdMirror, enable mirroring on cephblockpools and enable mirroring on radosnamespace as well. When it is set to false, we need to delete RBDMirror, disable mirroring on cephBlockPool and disable mirroring on radosnamespace as well. Along with this we also need to make sure that if a blockpool is labeled with forbid Mirroring label we probably should disable the mirroring on it as well. What I can do to increase readability is move the rpc calls inside shouldMirror and then call reconcile RBDMirror, CephBlockPools, and Radosnamespace in both cases to enable/disable mirroring based on the in-memory map that we create from the rpc responses. |
|
/cherry-pick release-4.19 |
|
@rewantsoni: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
6c4fa66 to
75ef66f
Compare
a36a2be to
9e3abec
Compare
|
Tested it on a cluster, mirroring is disabled for cephblockpool and rns. |
9e3abec to
713bf1d
Compare
|
/cherry-pick release-4.20 |
|
@rewantsoni: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
362ccd0 to
b5d2f73
Compare
Signed-off-by: Rewant Soni <resoni@redhat.com>
Refactor the mirroring controller to disable mirroring on cephblockpool and rns when the secondary cluster is down.
Fixes: DFBUGS-2957, DFBUGS-3638