-
Notifications
You must be signed in to change notification settings - Fork 2
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
Integrate PVC remap feature to replication controller for single cluster failover #147
base: main
Are you sure you want to change the base?
Conversation
* Initial pvcremap script * Update pvcremap script
* initial setup for command and get pv list * retrieve all pvcs, experiment on listoption * retrieve list of PVCs associated with RG name argument * passed list of PVCs to swapPVC method * test and complete * added swapAllPVC method * cleaned up unused code --------- Co-authored-by: shainabanduri3 <[email protected]>
* update annotation and label of newly created pvc for remote-rg * recognized single cluster + began integrating pvcremap into controller * added back remote client * integrate swapallpvc intc into controller * added custom methods * used connection package methods * changed listpersistentvolumes method * added functions to interface * changed remoteClient to client * modified ListPersistentVolumeClaims * fix listoption * add list option * add list pvc * adjust build ubi micro * changes to controller * changes to connections * changes to interface * adjust the error in deleting pvc * organize function calls and documentation * removed log parameter, cleaned up code * remove logger * remove blank lines --------- Co-authored-by: shainabanduri3 <[email protected]> Co-authored-by: hynguyenw4dell <[email protected]>
* update annotation and label of newly created pvc for remote-rg * recognized single cluster + began integrating pvcremap into controller * added back remote client * integrate swapallpvc intc into controller * added custom methods * used connection package methods * changed listpersistentvolumes method * added functions to interface * changed remoteClient to client * modified ListPersistentVolumeClaims * fix listoption * add list option * add list pvc * adjust build ubi micro * changes to controller * changes to connections * changes to interface * adjust the error in deleting pvc * organize function calls and documentation * removed log parameter, cleaned up code * adding disable-pvc-remap * adding disablepvcremap * adding disablepvcremap * adding disablepvcremap * clean up unnecessary changes * remove csm-common --------- Co-authored-by: shainabanduri3 <[email protected]> Co-authored-by: hynguyenw4dell <[email protected]>
* add pvcremap test * add go routines to remapAllPVC * sucessfully create fake pv * test with no pv/pvc * remove html * test swapPVC * added code to unit test function to ensure reclaim policy remains after remap * started testing if failover action is processed * removed unnecessary Get in updatePVClaimRef and removePVClaimRef + fixed error message * added complete code for failover test * fix claim ref loop * removed unnecessary reconciles, cleaned up code * add test remap pvc unplanned * add disabled remap pvc * add remap pvc with mismatched target * tests include disablePVCRemap, unplanned failover, and refactoring * linting and rename functions * remove report --------- Co-authored-by: hynguyenw4dell <[email protected]> Co-authored-by: shainabanduri3 <[email protected]>
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
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.
Hi Tom @falfaroc @YichenYa0
I see that rep-controller deletes the local PVC and there is a manual test step to delete application pods. If the pods are running, delete pvc call would not succeed.
As per my understanding, the purpose of this PR is to automatically remap target PVs to running application pods after failover operation. Please correct me if I got it wrong.
With the current changes, I see that user has to perform below steps when storage array on source side becomes unavailable:
- Delete application pods,
- run repctl failover cmd (once completed, replication controller remaps new PVCs to target PVs),
- Recreate application pods with same yaml which also triggers exports from target storage array.
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Show resolved
Hide resolved
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.
Lint check failed. Please check.
controllers/replication-controller/dellcsireplicationgroup_controller.go
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
controllers/replication-controller/dellcsireplicationgroup_controller.go
Outdated
Show resolved
Hide resolved
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
Two things to check before the PR can be merged.
- Need to check with POs if this feature can be merged.
- There were multiple commits made after the initial testing. We may need to retest once.
Unit tests are still passing and look good, I will update the description with coverage. I will run the e2e as well to ensure that everything is working there as well. |
Moving to Draft state, need to check with POs regarding this feature's milestone. |
Description
--disable-pvc-remap=True
to the replication controller deployment confighelm-charts/charts/csm-replication/templates/controller.yaml
when deploying with helm chart, as shown below:Alternatively, you can edit the replication controller after its deployment, and add that argument inside the yaml file with
k edit -n dell-replication-controller deployment
.GitHub Issues
List the GitHub issues impacted by this PR:
Checklist:
How Has This Been Tested?
Manual Testing Instruction
repctl --rg <rg-id> failover --target <replicated-rg-id>
repctl --rg <replicated-rg-id> reprotect
Test Coverage Change
/controllers/replication-controller/dellcsireplicationgroup_controller.go
change: