]> granicus.if.org Git - icinga2/commitdiff
Sync cluster config before replaying the logs
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 18 Sep 2015 08:05:34 +0000 (10:05 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 18 Sep 2015 08:07:13 +0000 (10:07 +0200)
If there were objects added at runtime (either through direct api
creation or by using the config file management api) the newly
created objects must be synced first, and then the stored historical
data should be synced.

refs #9927
refs #9100

lib/remote/apilistener.cpp

index e2598333213a56e4de93fabc71e4a98e1fe7f180..7e45995e80f0e958191871e114359d15675a4475 100644 (file)
@@ -370,6 +370,11 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
                if (endpoint) {
                        endpoint->AddClient(aclient);
 
+                       /* sync zone file config */
+                       SendConfigUpdate(aclient);
+                       /* sync runtime config */
+                       SendRuntimeConfigObjects(aclient);
+
                        if (need_sync) {
                                {
                                        ObjectLock olock(endpoint);
@@ -379,11 +384,6 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
 
                                ReplayLog(aclient);
                        }
-
-                       /* sync zone file config */
-                       SendConfigUpdate(aclient);
-                       /* sync runtime config */
-                       SendRuntimeConfigObjects(aclient);
                } else
                        AddAnonymousClient(aclient);
        } else {