From 561ec5aad8bc287e25b786dc7ce4a0ee1a2d5b41 Mon Sep 17 00:00:00 2001 From: Daniele Salvatore Albano Date: Thu, 12 Oct 2023 22:15:22 +0200 Subject: [PATCH] Mark as not in preparation after a snapshot failure (#433) This PR changes the snapshot business logic ensuring that if the preparation stage fails the status of in_preparation is switched back to false after the failure is internally reported. --- src/storage/db/storage_db_snapshot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/storage/db/storage_db_snapshot.c b/src/storage/db/storage_db_snapshot.c index 5ca7d15f..21554fdb 100644 --- a/src/storage/db/storage_db_snapshot.c +++ b/src/storage/db/storage_db_snapshot.c @@ -366,6 +366,9 @@ bool storage_db_snapshot_rdb_prepare( if (snapshot_fd > 0) { close(snapshot_fd); } + + db->snapshot.in_preparation = false; + MEMORY_FENCE_STORE(); } return result;