Do not change ownership recursive for Swift

Changing ownership recursive was required when deployments upgraded from
baremetal to containerized deployments. However, by now all deployments
should be containerized, and running chown recursive against a large
amount of data might timeout during upgrades.

Additionally temporary files might disappear while running chown and
chown exits with an error, breaking the update.

Therefore removing the recursive option, and only set the ownership for
the main and director subdirectores (which might include newly added
disk mountpoints). In the rare circumstance where this might be still
needed it is more safe to run this manually instead of breaking upgrades
for everyone else.

Closes-Bug: 1988441
Closes-Bug: 1988453
Change-Id: If59a3d4cf77a6995d60fc2db7f21739cac5f72aa
This commit is contained in:
Christian Schwede 2022-09-01 15:30:53 +02:00
parent 2283bb0982
commit 52c95b1d15
2 changed files with 11 additions and 2 deletions

View File

@ -383,12 +383,14 @@ outputs:
step_3:
# The puppet config sets this up but we don't have a way to mount the named
# volume during the configuration stage. We just need to create this
# directory and make sure it's owned by swift.
# directory and make sure it's owned by swift, as well as all
# immediate subdirectories (which might be mountpoints for additional
# disks).
swift_setup_srv:
image: &swift_account_image {get_attr: [RoleParametersValue, value, ContainerSwiftAccountImage]}
net: none
user: root
command: ['chown', '-R', 'swift:', '/srv/node']
command: ['find', '/srv/node', '-maxdepth', '1', '-type', 'd', '-exec', 'chown', 'swift:', '{}', ';']
volumes:
- /srv/node:/srv/node:z
environment:

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Do not change ownership recursive for Swift. This was required when
deployments upgraded from baremetal to containerized deployments.
However, by now all deployments should be containerized, and running chown
recursive against a large amount of data might timeout during upgrades.