From 080a06ab22c8ac0841c06fe52ab4dbc982beafc1 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 6 Mar 2020 11:34:58 +0100 Subject: [SERVER] Reload cache maps periodically for local images If an image is incomplete, but has no upstream server that can be used for replication, reload the cache map from disk periodically, in case some other server instance is writing to the image. --- src/server/globals.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/server/globals.h') diff --git a/src/server/globals.h b/src/server/globals.h index 10d3ee3..211fe2d 100644 --- a/src/server/globals.h +++ b/src/server/globals.h @@ -111,6 +111,8 @@ typedef struct typedef struct { ref reference; + atomic_bool dirty; // Cache map has been modified outside uplink (only integrity checker for now) + bool unchanged; // How many times in a row a reloaded cache map went unchanged _Atomic uint8_t map[]; } dnbd3_cache_map_t; @@ -144,7 +146,6 @@ struct _dnbd3_image atomic_bool queue; // Too many requests waiting on uplink } problem; uint16_t rid; // revision of image - atomic_bool mapDirty; // Cache map has been modified outside uplink (only integrity checker for now) pthread_mutex_t lock; }; -- cgit v1.2.3-55-g7522