Commit graph

73 commits

Author SHA1 Message Date
Eric Lippmann
0b1610c69b Use cancelCtx() instead of just cancel() 2021-08-09 10:29:47 +02:00
Eric Lippmann
e35a1609fc Stream state updates from icinga:runtime:state
Icinga now sends runtime updates in two separate channels,
icinga:runtime for config updates and icinga:runtime:state for
state updates. With this change, Icinga DB reads from these two
streams. This is a preparation so that state updates can be
streamed directly after a (re)start of Icinga or Icinga DB without
waiting for the config sync, as it is currently done.
2021-08-03 14:06:55 +02:00
Eric Lippmann
725e70f0b9 Pointer receivers, Cond usage, pass ctx and Godoc for Heartbeat
Heartbeat now uses pointer receivers for its methods because
some methods actually change the heartbeat values.
The context is no longer stored in the structure,
but passed to the controller loop.
The beat and the lost channels are replaced by Cond and
the last heartbeat is stored independently to not be affected by
a slow HA receiver. If the database connections are occupied by
the config, HA cannot update the instance and does not read from
the beat channel in time.
In addition, heartbeat errors are no longer swallowed,
but handled in HA.
2021-07-20 10:17:05 +02:00
Eric Lippmann
e12425d8dc Wrap errors 2021-06-21 12:13:24 +02:00
Alexander A. Klimov
8cbf24932e Add stack of current goroutine to errors 2021-05-31 16:53:57 +02:00
Alexander A. Klimov
35349262ce Use time.NewTicker(), not time.Tick() 2021-05-28 14:24:36 +02:00
Alexander A. Klimov
5a084ba7a9 Simplify code 2021-05-28 14:24:36 +02:00
Alexander A. Klimov
c3ea4d9490 Avoid unreachable code 2021-05-28 14:24:36 +02:00
Eric Lippmann
372f5cae7c Also log environment info 2021-05-25 16:25:04 +02:00
Noah Hilverling
44c734f72d Improve database and HA logging 2021-05-25 09:49:48 +02:00
Alexander A. Klimov
1026d4cabf Wrap Redis errors 2021-05-19 11:57:58 +02:00
Alexander A. Klimov
d08f32397a Introduce icingaredis.WrapCmdErr() 2021-05-19 11:57:58 +02:00
Julian Brost
f82de0c1a9 Make Redis/MySQL concurrency and batch sizes configurable 2021-05-12 11:54:36 +02:00
Eric Lippmann
442e04bbf1 Use type common.SyncSubject 2021-05-11 16:40:08 +02:00
Eric Lippmann
51d2532f18 Introduce func icingaredis.Client.YieldAll() 2021-05-11 16:40:08 +02:00
Noah Hilverling
b05a00a8d5 icingaredis.Client: Add StreamLastId() 2021-05-04 11:46:33 +02:00
Alexander A. Klimov
3304f0486c HMYield(): handle missing values 2021-04-21 15:26:31 +02:00
Alexander A. Klimov
fac47fb330 Delta: don't over-lock 2021-04-12 17:41:18 +02:00
Alexander A. Klimov
4dffbad76e Make channels more specific 2021-03-15 16:34:58 +01:00
Eric Lippmann
bb9a2b0251 Implement sync 2021-03-04 00:49:23 +01:00
Eric Lippmann
77267fa60c Introducte type icingaredis.Heartbeat 2021-03-04 00:49:23 +01:00
Eric Lippmann
50b3b6ea30 Add types necessary for heartbeat and HA 2021-03-04 00:49:23 +01:00
Eric Lippmann
5f12ca9b82 Add type icingaredis.Client
icingaredisClient is a wrapper around redis.Client with streaming
and logging capabilities.
2021-03-03 21:04:50 +01:00