When updating files, we quite often use utilities such as `os.WriteFile`, internally this will open the file with the 'O_TRUNC' flag, then write the given data. This opens ourselves to issues where truncation succeeds, but the write fails (meaning it's possible to end up with partial/empty files).
For "mission critical" files, we should use atomic operations, for example when updating the plan.
- relates to
MB-48485 [CBM] Failed to resume backup with error ' (bucket0) (vb 867) Received an unexpected error from the sink callback, beginning teardown'
DOC-8642 [CBM] Add documentation around 'hide dot files' on Samba
MB-45622 [CBM] Improve resilience to power outage/kill -9 scenarios