From 3852c51c9f96b8e65077c70b392458a298dabadf Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 6 Jun 2019 17:45:43 +0200 Subject: [PATCH] Cluster sync: Don't load/sync the .authoritative config file marker This would influence everything else, and it isn't needed anywhere but the master instance (zones.d -> var-zones). --- lib/remote/apilistener-filesync.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index 531748737..6279be5cc 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -684,6 +684,10 @@ ConfigDirInformation ApiListener::LoadConfigDir(const String& dir) */ void ApiListener::ConfigGlobHandler(ConfigDirInformation& config, const String& path, const String& file) { + /* Avoid loading the authoritative marker for syncs. */ + if (Utility::BaseName(file) == ".authoritative") + return; + CONTEXT("Creating config update for file '" + file + "'"); Log(LogNotice, "ApiListener") @@ -710,7 +714,10 @@ void ApiListener::ConfigGlobHandler(ConfigDirInformation& config, const String& update->Set(relativePath, content); - /* Calculate a checksum for each file (and a global one later). */ + /* Calculate a checksum for each file (and a global one later). + * + * IMPORTANT: Ignore the .authoritative file, this will not be synced. + * */ config.Checksums->Set(relativePath, GetChecksum(content)); }