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
change azure disk host cache to ReadOnly by default #72229
Conversation
clarify the release note that the changed value is in the azure provisioner, for storage classes that do not specify a caching mode. existing PVs and direct PV creation already defaulted cachingmode to readwrite, and will continue to do so: kubernetes/pkg/apis/core/v1/defaults.go Lines 274 to 278 in 0c7e207
|
Thanks for your remindar.
Let me submit another commit in this PR. |
4222cb5
to
db1088a
Compare
/hold cancel |
/assign @liggitt |
Reading through that, I agree ReadWrite is not a great default for PVs, but changing an API default is considered a breaking change. We'd need to understand the full impact of changing the default to ReadOnly for an application that was properly handling persisting data. Would it only result in a performance degradation, or would it change behavior in breaking ways as well? |
Hi @liggitt, I don't think k8s users could properly handling persisting data when using Below are details about host cache setting, it also applies to Linux: WARNING: If your application does not use FILE_FLAG_WRITE_THROUGH, the write cache could result in data loss because the data could be sitting in the host OS memory waiting to be written when the physical machine crashes unexpectedly. |
Write caches are common in many environments, both in software and in hardware. Software responsible for persisting data typically makes use of syscalls like fsync() to ensure data has actually been persisted. I'm not familiar with the A couple questions:
|
It looks like the field was added in 1.4 with a default of None (dea4b02#diff-14b477f6f8ca5978c702f4d21641e43f), and the default was changed to ReadWrite in 1.7 (4177b28#diff-14b477f6f8ca5978c702f4d21641e43fR242) |
change cachingMode default value for azure disk PV revert back to ReadWrite in azure disk PV setting
db1088a
to
53145d7
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx 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 |
Hi @liggitt I have reverted the code change of the cachingMode change in azure disk default PV setting, now this PR only changes the cachingMode from |
updated release note. lgtm, will let @kubernetes/sig-storage-pr-reviews tag |
/assign @feiskyer |
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
/retest
/test pull-kubernetes-e2e-gce-100-performance |
@andyzhangx: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
…2229-upstream-release-1.13 Automated cherry pick of #72229
…2229-upstream-release-1.12 Automated cherry pick of #72229
…2229-upstream-release-1.11 Automated cherry pick of #72229
What type of PR is this?
/kind bug
What this PR does / why we need it:
change azure disk host cache to
ReadOnly
by defaultThe default value
None
would lead to slow perf. And according to below doc: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage-performance#disk-cachingdefault host cache should be
ReadOnly
, the reason why we use “cachingMode: None” by default in k8s is that there is a critical disk bug due to this cachingMode setting(ReadOnly
&ReadWrite
) which would lead to disk i/o error, and this issue has been fixed in the middle of this year by azure disk team.I would also like to change the default value(from
ReadWrite
toReadOnly
) of caching mode in direct azure disk PV creation, there is one statement in the host cache doc:ReadWrite
cache may lead to data loss when VM crashes according to below doc:https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage-performance#disk-caching
Which issue(s) this PR fixes:
Fixes #72228
Special notes for your reviewer:
Release note:
/sig azure
/hold
hold this RP temporalily, I will let azure disk team do final confirmation whether
ReadOnly
is the best default value.From my side, I have verified that the original issue has been fixed in azure, we can move to use
ReadOnly
host cache now.