provisioner: Data corruption if PVC Name is used across namespaces #8987
Labels
addon/storage-provisioner
Issues relating to storage provisioner addon
kind/bug
Categorizes issue or PR as related to a bug.
priority/important-soon
Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone
As raised in comment:
in PR:
a change was made to how directories on disk were named when created by the storage provisioner:
That is, the change at line 60 from:
to:
This meant that whereas previously the name of the directory on disk was unique, and named after the PV (which used a uuid or similar), the name of the directory on disk was changed to the PVC name.
The problem is that the PVC name isn't unique because the same PVC name can be used in different namespaces.
This change causes a data corruption problem for applications because the PVC in two different namespaces can be assigned the same directory on disk for storage when the PVC names are the same in each namespace.
This means you can't for example run two instances of same database deployment in two different namespaces as they will trample on each others database files and corrupt themselves since they use the same PVC name.
The original method of using the PV name was much safer.
If you really want directory names to be more friendly, you must use the name of the namespace in the path as well. For example, in the form:
Without a change to this, will keep having persistent volume data corruption issues.
Steps to reproduce the issue:
Create two separate namespaces.
Create a PVC in each namespace where the PVC has the same name.
Create a deployment in each namespace which mounts the respective PVC in that namespace.
Write files to the persistent volume from each pod and will see that is the same storage. You can also look at the PV created for each and see it is the same file system path.
For example:
Full output of
minikube startcommand used, if not already included:The text was updated successfully, but these errors were encountered: