feat(wale-clone): Added data dir permission change (0700) during cloning #920
+4
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the
launch.sh
script, the permissions of PGROOT and PGDATA directories are already set. In situations where you clone an instance from a source with wrong permissions (e.g.0775
) on the PGDATA directory, the clone will fail during recovery, since the permissions will be set wrong.The error will be something like this:
A reason why the permissions are updated by Kubernetes itself can be, if there is a kubelet restart on a worker node. This will lead to a permission change to allow full access to whatever
fsGroup
is specified. This is done recursively on the root folder. So the result will be0770
permissions. See here for more details. The same happens also during kubelet restarts.This PR includes setting the permissions to
0700
of the PGDATA directory after thebackup-fetch
has been done. The actual instance recovery will therefore not fail.I hope you find this helpful.
Kind regards
Philip