The previous code was copying to /tmp, a volatile FS. If interrupted with a reboot, the content is gone, so no risk of corrupted or missing data. Now, however, it’s a basic cp to persistent storage. A reboot in the midst of that would leave us with a potential issue. So it may be better to do an rsync to a holding directory like /etc/puppet/cache.tmp, which can then be more-atomically renamed to /etc/puppet/cache once the rsync is complete. If a reboot occurs while the rsync is copying data, then, we don’t risk applying manifests with incomplete or corrupted data. We may even want a “sync” to flush the data to disk before the rename.
Re-opening to add a follow-up code change that enhances how the hieradata gets copied: /opendev. org/starlingx/ config/ src/branch/ master/ controllerconfi g/controllercon fig/scripts/ controller_ config# L498
https:/
The previous code was copying to /tmp, a volatile FS. If interrupted with a reboot, the content is gone, so no risk of corrupted or missing data. Now, however, it’s a basic cp to persistent storage. A reboot in the midst of that would leave us with a potential issue. So it may be better to do an rsync to a holding directory like /etc/puppet/ cache.tmp, which can then be more-atomically renamed to /etc/puppet/cache once the rsync is complete. If a reboot occurs while the rsync is copying data, then, we don’t risk applying manifests with incomplete or corrupted data. We may even want a “sync” to flush the data to disk before the rename.