feat(upgrade, api, core): upgrade old BlockDevices to new BlockDevices with new UUID#442
Conversation
Codecov Report
@@ Coverage Diff @@
## master #442 +/- ##
==========================================
- Coverage 42.90% 40.53% -2.37%
==========================================
Files 71 71
Lines 3228 3488 +260
==========================================
+ Hits 1385 1414 +29
- Misses 1735 1966 +231
Partials 108 108
Continue to review full report at Codecov.
|
pawanpraka1
left a comment
There was a problem hiding this comment.
few comments. still reviewing it.
|
@akhilerm -- finally got my slot to review and went through one round. I still need to go through addDeviceHandler.go file. My initial impressions on the rest of the files:
|
pawanpraka1
left a comment
There was a problem hiding this comment.
@akhilerm in legacy case, when we will populate the deviceInfo.UUID? it seems like it will not be set as we are setting UUID in GPT case only?
eventhandler.go:81 => existingBlockDeviceResource := pe.Controller.GetExistingBlockDeviceResource(bdAPIList, deviceInfo.UUID)
|
@akhilerm - with the changes in the PR can you see if the following tests work: (a) handle the change in the path name (b) handle the movement of disk from node1 to node2 |
|
@kmova @pawanpraka1 Here is the reference doc for the upgrade flow. |
|
@kmova Both the above mentioned test cases : |
…gacy UUID Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
80f6103 to
6c2d0a5
Compare
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
6c2d0a5 to
b35f564
Compare
kmova
left a comment
There was a problem hiding this comment.
Overall looks good!
Have a comment in the delete handler that needs to be addressed. And generic comments on adding more comments in both add/delete handler codes.
change legacy check in delete to the end. Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
|
@kmova addressed the review comments and tested the changes. |
| klog.V(4).Infof("device: %s upgraded", bd.DevPath) | ||
| return nil | ||
| } | ||
|
|
There was a problem hiding this comment.
see if we can break addBlockDevice into smaller part? it is a huge function.
There was a problem hiding this comment.
will take it up in a later PR @pawanpraka1 .
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan akhil.mohan@mayadata.io
Why is this PR required? What issue does it fix?:
The BDs existing in old UUID scheme need to be migrated to BDs in new scheme.
BlockDevices will be creates for disks that are being used by zfs localPV and mayastor.
What this PR does?:
Handles cases for co-exisiting of BDs in legacy and GPTBased uuid scheme
Cases which are handled:
Unclaimed(ClaimedandReleased) state and uses the legacy uuid scheme will be annotated withinternal.openebs.io/uuid-scheme=legacyUnclaimedstate will be made inactive and new BlockDevice resource using the GPT scheme will be created.internal.openebs.io/uuid-scheme=legacyannotation. This is done so as to make the changes backward compatible with applications that are currently using those BlockDevice resources.BlockDevice resource will be created for devices that are used by ZFS-LocalPV. Those blockdevices will be labelled
openebs.io/block-device-tag=zfs-localpvso that the operator cannot claim those resources.MayaStor disks: Mayastor disks will be ignored, because we need a unique way to identify disks that are already in use by mayastor. (This is because mayastor disks does not have any partitions.)
Pre-requisites before performing the upgrade:
1.should be satisfiedDoes this PR require any upgrade changes?:
No.
If the changes in this PR are manually verified, list down the scenarios covered::
Any additional information for your reviewer? :
NOTES:
Flow Diagram for the upgrade of LocalPV is available here. The gist also contains the changes that are required in the steps for cstor.
Checklist:
<type>(<scope>): <subject>