-
Notifications
You must be signed in to change notification settings - Fork 807
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
Support clustered allocation when formatting ext4 filesystem #1706
Support clustered allocation when formatting ext4 filesystem #1706
Conversation
Hi @AndrewSirenko. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/ok-to-test |
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 other than my one suggestion, open to opinions on that
docs/parameters.md
Outdated
@@ -18,6 +18,7 @@ The AWS EBS CSI Driver supports [tagging](tagging.md) through `StorageClass.para | |||
| "inodeSize" | | | The inode size to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`, or `xfs`. | | |||
| "bytesPerINode" | | | The `bytes-per-inode` to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`. | | |||
| "numberOfINodes" | | | The `number-of-inodes` to use when formatting the underlying filesystem. Only supported on linux nodes and with fstype `ext2`, `ext3`, `ext4`. | | |||
| "bigAllocClusterSize | | | The cluster size (in bytes) to use when formatting an `ext4` filesystem with the `bigalloc` option enabled. Specifying a value will enable the `bigalloc` formatting option. | |
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.
From my understanding (and based on the kernel wiki here: https://ext4.wiki.kernel.org/index.php/Bigalloc) bigalloc
is just the parameter to enable clustered allocation on ext4
.
Thus, I propose this parameter (and associated internal variable/function names) is renamed to 'clusterSize
because that is what this is actually doing. This also would make sense if we add support in the future for another filesystem that supports specifying cluster size.
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.
I disagree because I think bigAllocClusterSize helps the customer more easily look up what this parameter does. My only grievance with clusterSize
is that Windows renamed block size to cluster size. This is why I added the explicit mention of bigalloc in. https://support.microsoft.com/en-us/topic/default-cluster-size-for-ntfs-fat-and-exfat-9772e6f1-e31a-00d7-e18f-73169155af95
This issue is exacerbated by the first link coming up when you search "cluster size" is that windows document.
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.
TLDR: Yes this parameter name SHOULD be clusterSize
, but because Windows overloaded the term I think we need the explicit mention of ext4's bigAlloc formatting option.
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.
In that case, I propose the name ext4ClusterSize
. If we're going to limit the name of the parameter to only ext4 for whatever reason, we should be explicit about that.
That said, I still do not prefer using a name that is intentionally limiting our future uses.
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.
Suggest ext4ClusterSize
as proposed above.
/test pull-aws-ebs-csi-driver-test-helm-chart |
1 similar comment
/test pull-aws-ebs-csi-driver-test-helm-chart |
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.
Thanks @AndrewSirenko /lgtm
/retest |
This change would break the fsresizer:
If you look at the resizer it doesn't add the |
Just an update: The new Linux AL2023 Base image for the driver contains an updated version of e2fsprogs which will prevent the breaking of fsresizer. I'm working on adding an e2e formatting option parameter test suite to the driver before finishing this PR (so that I can add proper e2e testing of this feature along with the other formatting option parameters). Thank you again Martin for exposing a gap in our testing. |
/hold |
a7de387
to
0333c47
Compare
c24bd3f
to
2f8f6f2
Compare
docs/faq.md
Outdated
### `ext4BigAlloc` and `ext4ClusterSize` | ||
|
||
Warnings: | ||
- The `bigalloc` feature may not be fully supported with your node's Linux kernel or may have various bugs. Please see the [ext4(5) man-page](https://man7.org/linux/man-pages/man5/ext4.5.html) for details. |
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.
I realize that you're just quoting from the linked man page. But this still seems unnecessarily alarming. It makes it sound like the CSI driver's implementation may have various bugs, which is not the case.
Suggest:
Ext4's
bigalloc
is an experimental feature, under active development. Please pay particular attention to your kernel version. See the ext4(5) man-page for details.
docs/faq.md
Outdated
|
||
Warnings: | ||
- The `bigalloc` feature may not be fully supported with your node's Linux kernel or may have various bugs. Please see the [ext4(5) man-page](https://man7.org/linux/man-pages/man5/ext4.5.html) for details. | ||
- Linux kernel release 4.15 added support for resizing ext4 filesystems using clustered allocation. **Resizing volumes mounted to nodes running a Linux kernel version prior to 4.15 will fail and require manual intervention and downtime of the volume.** |
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.
and require manual intervention and downtime of the volume.
Either say what "manual intervention" is required or just delete this part of the sentence.
2f8f6f2
to
0734fbe
Compare
@wmesard: changing LGTM is restricted to collaborators In 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/test-infra repository. |
/retest |
When deciding between customer experience 1 or 2 for: a. Enabling clustered allocation for an ext4 fs ( 1a.
1b.
2a
2b.
Decided for two separate parameters (option 1) due to:
At the cost of:
|
/unhold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AndrewSirenko The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is this a bug fix or adding new feature?
New feature
What is this PR about? / Why do we need it?
Close #1687
This PR:
ext4BigAlloc
andext4ClusterSize
storage class parameters that expose enabling clustered allocation onext4
filesystems.ext4BigAlloc
totrue
and 'ext4ClusterSize` to the desired cluster size.The
ext4BigAlloc
parameter enables clustered allocation on ext4 filesystems by enabling the bigalloc feature (ie performingmkfs.ext4 -O bigalloc
) when formatting a dynamically-provisioned Persistent Volume (PV). See this ext4 man page for more details about bigalloc.The
ext4ClusterSize
parameter allows users to set a custom cluster size when formatting a PV with theext4
filesystem IF they have setext4BigAlloc
to true. (appends-C ext4ClusterSize
to other mkfs.ext4 formatting options).One benefit to exposing this formatting option is that developers can enable torn write prevention on their volumes to improve the performance of their I/O-intensive relational database workloads and reduce latency without negatively impacting data resiliency. Relational databases that use InnoDB or XtraDB as the database engine, such as MySQL and MariaDB, will benefit from torn write prevention.
What testing is done?
Unit Tests + Manual Testing on EKS Cluster.
Manual Testing
ext4ClusterSize
parameter value) and Unhappy Path (Invalidext4ClusterSize
parameter value)Happy Path: Storage class with valid
ext4ClusterSize
parameter value yields properly formatted filesystem on PVext4ClusterSize: "16384"
in the storage class definition):kubectl exec -it app -- tune2fs -l /dev/nvme1n1
which contains the cluster-size parameter:Unhappy Path: Storage class with invalid
ext4ClusterSize
parameter value yields failed mount andmkfs.ext4
errorext4ClusterSize
parameterkubectl describe pod app
to yield the following events:Note the
FailedMount
due to the errormkfs.ext4: invalid cluster size - 1
at the end of the last line.