-
Notifications
You must be signed in to change notification settings - Fork 253
disk: replace conf file with xattr #1608
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
Conversation
|
manual verification: Before upgrade, two disks attached to the node:
Upgrade: unmount globalmount, optionally restart csi, then restart kubelet to verify load devMap from xattr: Simulating the devMap is not accurate: |
Move DiskXattrName and DiskXattrVirtioBlkName variables from nodeserver.go to a new file xattr.go. This is a pure code move with no functional changes.
We used to use /etc/kubernetes/volumes/disk/d-*.conf files to record the relationships between disks without serial number and the device path. But it has multiple drawbacks: - leak: we may fail to remove the files we created - inaccurate: if the disk is detached, switched driver, the device will gone without our knowledge. In this case, the conf file may points to a non-exist file, or even a wrong file. Replace the conf files with xattr, which we are already using to calculate number of volumes available on node. The xattrs are attached to the device inode, and will go with the inode. So that we don't need to worry about any cleanup or inaccuracy. Old conf files are migrated to xattr in one go, in the init container. As a bonus, the partition support is now more decoupled, and should work on more scenarios. xattrs are always attached to root block device, not partition.
|
/unhold |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huww98, mowangdk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
We used to use /etc/kubernetes/volumes/disk/d-*.conf files to record the relationships between disks without serial number and the device path. But it has multiple drawbacks:
Replace the conf files with xattr, which we are already using to calculate number of volumes available on node. The xattrs are attached to the device inode, and will go with the inode. So that we don't need to worry about any cleanup or inaccuracy.
Old conf files are migrated to xattr in one go, in the init container.
As a bonus, the partition support is now more decoupled, and should work on more scenarios. xattrs are always attached to root block device, not partition.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
/hold
for manual verification on disks without serial number
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: