From ba20b6691fc0ef2201d3a6dbb2217fd281d2250e Mon Sep 17 00:00:00 2001 From: Adrian Suarez Date: Tue, 12 Mar 2024 13:55:15 -0400 Subject: [PATCH] Make sure files are durable that should be in snapshot --- stable/database/files/backup_hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stable/database/files/backup_hooks.py b/stable/database/files/backup_hooks.py index f99081ef4..a2142a153 100644 --- a/stable/database/files/backup_hooks.py +++ b/stable/database/files/backup_hooks.py @@ -42,6 +42,10 @@ def write_file(path, content): else: json.dump(content, f) + # Flush buffers and invoke fsync() to make sure data is written to disk + f.flush() + os.fsync(f.fileno()) + # Make sure that file is accessible by nuodb user, which has uid 1000 by # default. Making the file group-writable ensures that it is accessible to # the nuodb user in OpenShift deployments where an arbitrary uid is used