Commit Graph

118 Commits

Author SHA1 Message Date
Alexander Aleksandrovič Klimov ca9ce92b69
Merge pull request #8698 from Icinga/feature/icingadb-cache-environment-id
Icinga DB: cache environment ID instead of recomputing it every time
2021-03-26 17:16:42 +01:00
Noah Hilverling 5c8b32618c RedisConnection::WriteRESP: Use one asio::async_write instead of many 2021-03-24 13:14:01 +01:00
Julian Brost 41f7124692 Icinga DB: cache environment ID instead of recomputing it every time 2021-03-23 17:09:32 +01:00
Alexander A. Klimov 31dacb8390 IcingaDB#UpdateAllConfigObjects(): don't modify map concurrently 2021-03-08 18:11:24 +01:00
Julian Brost a4cf81194a
Merge pull request #8650 from Icinga/feature/icingadb-delta
Icinga DB: re-insert only changed object attributes
2021-03-08 15:11:21 +01:00
Alexander A. Klimov 4eddac0e64 Icinga DB: re-insert only changed object attributes 2021-03-04 17:29:39 +01:00
Alexander Aleksandrovič Klimov 618c778430
Merge pull request #8649 from Icinga/bugfix/icingadb-deduplicate-cvs
Icinga DB: HMSET the same fields only once
2021-03-03 16:57:27 +01:00
Alexander A. Klimov ed57d31400 Icinga DB: HMSET the same fields only once 2021-02-24 13:37:36 +01:00
Alexander A. Klimov d4a91ec50d Icinga DB: don't write all types 2021-02-17 12:41:45 +01:00
Alexander Aleksandrovič Klimov ca52366a61
Merge pull request #8602 from Icinga/bugfix/icingadb-activation-priority
Delay start of IcingaDB until most config objects are activated
2021-01-28 10:01:37 +01:00
Alexander Aleksandrovič Klimov b1719883a3
Merge pull request #8604 from Icinga/bugfix/icingadb-initial-sync-delay
IcingaDB: start initial dump in callback instead of timer
2021-01-21 13:47:12 +01:00
Julian Brost 2d080f14eb IcingaDB: start initial dump in callback instead of timer
Previously, the initial config dump was started in a timer executed
every 15 seconds. During the first execution of the timer, the Redis
connection is typically not established yet. Therefore, this delayed the
initial sync by up to 15 seconds.

This commit instead triggers the sync from a callback that is executed
after the connection is successfully established.

The timer is removed completely. On first glance, it looks like it would
ensure that a lost connection is reestablished, but this is handled
internally by RedisConnection. After the config has been dumped once,
that timer wouldn't ever attempt a reconnect anyways.
2021-01-20 09:31:27 +01:00
Julian Brost 174f7f75a8 IcingaDB: wait for queries to be executed in inital sync
This delays the log message stating that the initial dump is done until
all queries are actually done and now logs a meaningful duration. In
addition, this delays the return of the function and therefore when
state variables are updated by the caller.
2021-01-19 17:14:42 +01:00
Julian Brost 509db4ab94 Delay start of IcingaDB until most config objects are activated
This commit sets the activation priority if IcingaDB objects to 100 (the
same value as IDO uses) so that it get's activated after most regular
config objects (hosts, services, ...).

Before (note how Icinga 2 continues to active objects for over a minute
after IcingaDB is started and thinks the initial dump is done):

    [2021-01-19 08:33:19 +0000] information/IcingaDB: 'icingadb' started.
    [2021-01-19 08:34:02 +0000] information/IcingaDB: Initial config/status dump finished in 28.247 seconds.
    [2021-01-19 08:35:49 +0000] information/ConfigItem: Activated all objects.

After (now activation of objects is done right after IcingaDB is
started, as it's one of the last objects to be activated):

    [2021-01-19 08:39:01 +0000] information/IcingaDB: 'icingadb' started.
    [2021-01-19 08:39:02 +0000] information/ConfigItem: Activated all objects.
    [2021-01-19 08:39:38 +0000] information/IcingaDB: Initial config/status dump finished in 21.6606 seconds.
2021-01-19 09:45:47 +01:00
Yonas Habteab 5b0bbd6351 IcingaDB: Check whether or not cr is nullptr 2021-01-18 11:38:31 +01:00
Alexander A. Klimov fc72cca70e Icinga DB: don't use the work queue for publishing stats 2020-05-15 11:17:25 +02:00
Alexander A. Klimov 35f25e99b4 IcingaDB::SerializeState(): include whether an ack is sticky 2020-04-20 14:53:55 +02:00
Noah Hilverling 595ffc438e Icinga DB - Flapping history: Add percent_state_change_start/end 2020-03-10 14:44:08 +01:00
Noah Hilverling 5ec31aed14 Downtime, Comment, Notification: Add host_id, if object_type is service 2020-03-09 10:50:02 +01:00
Alexander A. Klimov ff0efbc2a2 Drop IcingaDB#HandleEvents() 2020-03-04 14:37:17 +01:00
Alexander A. Klimov 54d555bd92 Drop IcingaDB#SendEvent() 2020-03-04 14:36:43 +01:00
Alexander A. Klimov 867481de7c Connect IcingaDB::StateChangeHandler to Checkable::OnAcknowledgementSet instead of calling it in IcingaDB#SendEvent() 2020-03-04 14:36:07 +01:00
Alexander A. Klimov efa548fbdf Connect IcingaDB::UpdateState to Checkable::OnNewCheckResult instead of calling it in IcingaDB#SendEvent() 2020-03-04 14:34:43 +01:00
Alexander A. Klimov 0d58f87b37 IcingaDB: make signal handlers synchronous
refs #7885
2020-03-04 11:09:35 +01:00
Michael Insel 5930d640e4 IcingaDB: Fix enumeral mismatch compiler warnings
This fixes 3 enumeral mismatch compiler warnings when building the
IcingaDB target.
2020-02-10 18:56:11 +01:00
Noah Hilverling b77bc7b963 IcingaDB: Fix last_update 2020-01-29 14:43:29 +01:00
Noah Hilverling 0d28ef5abe IcingaDB::UpdateState: Check for Redis connection before calling FireAndForgetQuery() 2020-01-17 13:53:05 +01:00
Alexander Aleksandrovič Klimov f11cccf874
Merge pull request #7760 from Icinga/bugfix/icingadb-manually-rescheduling-a-check-does-not-update-next_update-and-next_check-7707
IcingaDB: Fix rescheduling a check not always updating state in Redis
2020-01-16 11:58:28 +01:00
Noah Hilverling cbe1c181a1 IcingaDB: Fix rescheduling check not always updating state in Redis
fixes #7707
2020-01-16 10:51:56 +01:00
Michael Friedrich 8f5375d2bb Use IoEngine::Spawn wrapper in RedisConnection class
This avoids multiple locations for `asio::spawn` calls.
2020-01-16 09:53:24 +01:00
Noah Hilverling 6575ce920e
Merge pull request #7721 from Icinga/bugfix/icingadb-pending
IcingaDB: suppress state sync until config sync finished
2020-01-08 17:30:22 +01:00
Noah Hilverling 275ab08303 IcingaDB - Runtime updates: Use one pub/sub channel per config object type 2020-01-07 16:40:29 +01:00
Alexander A. Klimov f6f7d9b635 IcingaDB: suppress state sync until config sync finished 2019-12-18 13:41:56 +01:00
Michael Friedrich 387c2c8b79
Merge pull request #7717 from Icinga/bugfix/redisconnection-shared_ptr
RedisConnection: replace std::shared_ptr<T> with Shared<T>::Ptr
2019-12-18 13:32:16 +01:00
Michael Friedrich cbbff6b37d
Merge pull request #7716 from Icinga/bugfix/redisconnection-long-logs
RedisConnection: shorten log messages
2019-12-18 13:31:51 +01:00
Alexander A. Klimov de5b3eb2c7 RedisConnection: replace std::shared_ptr<T> with Shared<T>::Ptr 2019-12-17 12:13:30 +01:00
Alexander A. Klimov 955b612703 RedisConnection: shorten log messages 2019-12-17 11:49:54 +01:00
Alexander A. Klimov b1cc0cd767 Document RedisConnection 2019-12-17 11:44:00 +01:00
Alexander A. Klimov c6ea9bc7fe IcingaDB: update icinga:nextupdate:* on Checkable#next_check changes
refs #7707
2019-12-10 16:11:51 +01:00
Noah Hilverling 77e02031f9
Merge pull request #7690 from Icinga/feature/flapping-acknowledgement-start-time-7689
IcingaDB: include consistent IDs, start time and end time in icinga:history:stream:{flapping,acknowledgement}
2019-12-10 14:49:17 +01:00
Noah Hilverling ee40fedb2a
Merge pull request #7700 from Icinga/bugfix/icingadb-don-t-hash-hashes-7692
IcingaDB: don't hash hashes
2019-12-10 13:39:12 +01:00
Alexander A. Klimov 78189d70ef IcingaDB: don't hash hashes
refs #7692
2019-12-10 11:23:05 +01:00
Alexander A. Klimov d69cb676a7 Introduce IcingaDB#GetObjectIdentifiersWithoutEnv()
refs #7692
2019-12-10 11:22:35 +01:00
Alexander A. Klimov 4f68cfd299 IcingaDB: include consistent IDs, start time and end time in icinga:history:stream:{flapping,acknowledgement}
refs #7689
2019-12-10 10:44:26 +01:00
Alexander A. Klimov 829d07aefe Introduce Checkable#acknowledgement_last_change
refs #7689
2019-12-10 10:44:23 +01:00
Noah Hilverling e8f352f4d7 IcingaDB history: Add cancelled_by & removed_by to downtime & comment history 2019-12-09 10:30:52 +01:00
Noah Hilverling f0b8892e4a
Merge pull request #7676 from Icinga/feature/icingadb-localendpoint-id
IcingaDB#GetStats(): add endpoint_id to IcingaApplication
2019-12-06 16:59:36 +01:00
Noah Hilverling 5e23414197
Merge pull request #7699 from Icinga/bugfix/icingadb-hash-arrays-7691
Get rid of IcingaDB#CalculateCheckSum*()
2019-12-06 16:37:24 +01:00
Alexander A. Klimov e109063333 IcingaDB#GetStats(): add endpoint_id to IcingaApplication 2019-12-06 15:52:47 +01:00
Alexander A. Klimov 783586978f Get rid of IcingaDB#CalculateCheckSumProperties()
refs #7691
2019-12-06 11:25:41 +01:00