Commit Graph

55 Commits

Author SHA1 Message Date
Alexander Aleksandrovič Klimov e84a4a290d
Merge pull request #8450 from Icinga/bugfix/do-not-accept-api-updates-for-unknown-zone
API: Don't accept object updates for unknown global zone
2020-11-24 10:40:20 +01:00
Julian Brost be53b0af9e Log config object deletions to replay log
The initial config object sync for each new connection (in
`ApiListener::SendRuntimeConfigObjects()`) only considers currently
existing objects and has no way to pass the information that objects
were deleted in the meantime.

This commit logs config object deletions to the replay log if required
so that there is a chance that it will be propagated to nodes that were
offline when the deletion happened.

Note that this can only be considered a workaround as the replay log
might be pruned or could even be completely disabled. Also, there still
seems to be a race-condition between the config sync and replay log of
multiple new connections at the same time.
2020-11-09 14:09:44 +01:00
Noah Hilverling 8ba5f72533 API: Don't accept object updates for unknown zone 2020-11-06 17:27:10 +01:00
Michael Friedrich 2760748d78 Fix and improve logging for runtime object sync
config::UpdateObject would create a new object, but this may
have been silently ignored with 'ignore_on_error' - downtimes, etc.
Since we cannot simply fetch the error from inside the config compiler,
we'd just check whether there's a config object created at this stage.
This happens synchronously, and once there is, log something.

The previous code always logged the creation, even if the downtime
was ignored, e.g. when the first master sent one for local host objects.

This commit also adds more details: identity, endpoint, zone to extract
the MessageOrigin details into log messages for better troubleshooting
and debugging.

refs #7198
2019-08-15 09:29:05 +02:00
Michael Friedrich c30edd0a34 Fix message origin for runtime created config object (create/delete events) 2019-08-13 15:05:47 +02:00
Michael Friedrich f92c134b0a Cluster: Don't try to sync objects from broken _api package 2019-04-26 14:43:38 +02:00
Alexander A. Klimov 6c86c127f1 Port JsonRpcConnection to Boost ASIO 2019-04-01 11:40:14 +02:00
Michael Friedrich d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich b16c22448e Cluster: Delete object message should log that
Atm it is a copy-paste error and irritates during debugging.
Coming from my analysis of existing cluster messages.
2019-01-28 17:39:22 +01:00
Michael Friedrich dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Jean Flach 2b44eff8da Fix "Discard" message being warning 2018-07-26 09:39:03 +02:00
Michael Friedrich c4a6ab0211 Add diagnostic_information as verbose error to config object handlers 2018-04-06 12:26:49 +02:00
Gunnar Beutner 94e6be1a65 Remove unused includes 2018-01-22 09:52:29 +01:00
Gunnar Beutner c2fb9fe226 Use initializer lists for arrays and dictionaries 2018-01-16 12:27:44 +01:00
Gunnar Beutner e3ad0be769 Apply clang-tidy fix 'modernize-use-auto' 2018-01-04 12:24:57 +01:00
Michael Insel 158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach 2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner 325e4a2fb9 Use nullptr instead of <Type>::Ptr() 2017-11-30 17:47:09 +01:00
Michael Friedrich 4658cb391e Fix logging for discarded cluster messages
fixes #4930
fixes #4969
2017-02-02 13:47:18 +01:00
Michael Friedrich b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Michael Friedrich 40d68fcce2 Fix object sync for objects in a global zone
fixes #11541
2016-11-14 14:42:47 +01:00
Michael Friedrich 4b86f69c96 Ensure that runtime created objects are synced on (re)connect
refs #11684
2016-11-11 16:29:37 +01:00
Michael Friedrich 2e2de7c340 Enhance log messages for cluster config sync
refs #11684
2016-11-10 17:44:05 +01:00
Michael Friedrich 5dd4898eb3 Ensure that UpdateConfigObject sets the target zone
refs #11684
2016-11-10 17:15:06 +01:00
Gunnar Beutner 0145a32e58 Fix object resync issues
refs #11684
2016-10-11 10:55:13 +02:00
Gunnar Beutner 288b354d11 Improve log message for ignored config updates
fixes #12623
2016-09-02 09:35:35 +02:00
Gunnar Beutner b5b09216c6 Use lambda functions for INITIALIZE_ONCE
fixes #12562
2016-08-27 09:48:36 +02:00
Gunnar Beutner 288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Gunnar Beutner b7a1b58069 Improve performance for type lookups
fixes #12448
2016-08-16 11:02:33 +02:00
Gunnar Beutner ebaf239d3b Replace GetType()->GetName() calls with GetReflectionType()->GetName()
fixes #12438
2016-08-15 14:42:03 +02:00
Michael Friedrich c8a9f45697 ApiListener: Bail out if object could not be created during config sync
refs #11006
2016-02-12 14:15:24 +01:00
Jean Flach fa1d633484 Rephrase some log messages
refs #11122
2016-02-09 15:59:19 +01:00
Gunnar Beutner 14d805e6fe Fix crash in ApiListener::ConfigUpdateObjectAPIHandler
fixes #11006
2016-02-09 09:13:43 +01:00
Gunnar Beutner 599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Gunnar Beutner 4bb9beda19 Don't send cluster config messages for objects with version 0
refs #9927
2015-11-08 21:22:06 +01:00
Michael Friedrich d516d16c9a Fix restore_attribute not working in clusters
fixes #10386
2015-10-22 14:50:43 +02:00
Michael Friedrich 934fb64b9e Fix log message formatting for object version
refs #10355
2015-10-15 16:52:49 +02:00
Michael Friedrich 5852a003d0 Ensure that modified attributes work with clients with local config and no zone attribute
fixes #10371
2015-10-15 14:05:39 +02:00
Michael Friedrich a0631cd351 Fix wrong type for object version
refs #10355
2015-10-15 11:11:07 +02:00
Gunnar Beutner f89877cd28 Fix incorrect variable type in ApiListener::ConfigUpdateObjectAPIHandler
refs #10355
2015-10-15 09:26:58 +02:00
Michael Friedrich 9dcb33e8f4 Change object version to timestamps for diff updates on config sync
fixes #10257
2015-09-30 16:58:18 +02:00
Michael Friedrich 657e749c9b Config sync shouldn't send updates for objects the client doesn't have access to
fixes #10249
2015-09-30 15:08:01 +02:00
Michael Friedrich 19e7524b31 Fix problem with non-existing objects in config sync updates
refs #9851
refs #9927
refs #9081
2015-09-30 10:04:37 +02:00
Gunnar Beutner 7e4953dd35 Improve log messages for HTTP requests
refs #9074
2015-09-30 08:41:09 +02:00
Michael Friedrich bb3b724219 Fix object sync for modified attributes
refs #9851
refs #9927
refs #9081
2015-09-29 14:24:39 +02:00
Michael Friedrich f498ce39f3 Improve api error handling
refs #10194
2015-09-28 16:08:14 +02:00
Jean-Marcel Flach 5ef4204d06 Improve API error handling and fix some whitespace
fixes #10194
2015-09-25 13:57:28 +02:00
Michael Friedrich 57179f3bdd Only sync objects actually belonging to a cluster zone
refs #9927
refs #9100
2015-09-18 12:49:38 +02:00
Michael Friedrich 18d645e4ef Add zone attribute influencing cluster config sync for API objects
1) No zone defined. The object will only be synced in the local zone for HA purposes.
2) Zone is set to 'master'. Only nodes in the master zone will get this object and updates synced.
3) Zone is set to 'satellite'. Only nodes in the satellite zone, or in parent zones above will get this object and updates synced.
4) Zone is set to 'client'. Only nodes in the client zone, and in parent zones (satellite, master) will get object updates.

Furthermore this commit adds a bit more security measures for syncing object
config bottom-up which is clearly restricted at this time. Clients cannot
send their config to the top, but yet we only support the top-down thing we
also have with the cluster file config sync.

The initial sync will also take the zone relation model into account
and only allow object syncs only when the same conditions apply as written
above.

refs #9927
refs #9100
2015-09-17 14:20:44 +02:00
Michael Friedrich 0fd9d3406b Prevent object deletion on shutdown when checking !IsActive()
This is fairly ugly and sets an extension for the ConfigObjectUtility
delete handler to signal the OnActiveChanged handler inside the cluster
configsync to send a delete event to the other nodes.

refs #9927
2015-09-17 14:20:44 +02:00