Commit graph

602 commits

Author SHA1 Message Date
Alexander Aleksandrovič Klimov
99de1079f8
Merge pull request #593 from Icinga/wait-for-database-to-start-rather-than-crashing-561
Merge network and database error retryability detection functions
2023-07-27 17:58:06 +02:00
Julian Brost
68d26a6873
Merge pull request #601 from Icinga/flatten-empty-custom-vars-correctly
Write a hint for empty arrays/dicts into `customvar_flat`
2023-07-25 15:28:07 +02:00
Julian Brost
536c808bca
Merge pull request #605 from Icinga/yaml.DisallowUnknownField
Config parsing: fail on unknown fields and print them
2023-07-25 10:29:29 +02:00
Julian Brost
ef09059549
Merge pull request #612 from Icinga/bool-binary-unixmilli-marshaljson-return-valid-json-not-empty-string
{Bool,Binary,UnixMilli}#MarshalJSON(): return valid JSON, not empty string
2023-07-25 10:28:44 +02:00
Alexander A. Klimov
af868b1762 Config parsing: unit test failure due to unknown fields 2023-07-11 09:57:54 +02:00
Alexander A. Klimov
b8ed25c87a Test UnixMilli#MarshalJSON() 2023-07-07 16:47:45 +02:00
Alexander A. Klimov
7568c47378 Test Bool#MarshalJSON() 2023-07-07 16:47:45 +02:00
Alexander A. Klimov
0745ba7d9e Test Binary#MarshalJSON() 2023-07-07 16:47:45 +02:00
Alexander A. Klimov
0291c860a1 {Bool,Binary,UnixMilli}#MarshalJSON(): return valid JSON, not empty string
in case an instance is null.
2023-07-04 15:38:17 +02:00
Yonas Habteab
fa0a712bac Flatten empty custom vars of type array & map correctly 2023-06-29 13:43:33 +02:00
Alexander A. Klimov
6dc4998802 Support Percona XtraDB Cluster by not using SERIALIZABLE transactions directly
The RDBMS rejects them by default. But it doesn't rejects their equivalent:
Append "LOCK IN SHARE MODE" to every SELECT in a REPEATABLE READ transaction.
Now we do the latter with MySQL.
2023-06-22 15:13:40 +02:00
Alexander A. Klimov
a163694dc6 Config parsing: fail on unknown fields and print them
Useful against config validation or runtime failures
caused by wrong field spelling or YAML indentation.
2023-06-19 17:38:52 +02:00
Julian Brost
78fa223cab
Merge pull request #559 from Icinga/segv
Heartbeat#sendEvent(m): nil-check m before dereferencing it
2023-06-05 12:54:29 +02:00
Alexander A. Klimov
a3c1007d47 retry.Retryable(): treat ENOENT (AF_UNIX) like ECONNREFUSED, i.e. also retry
During connect(2) we may get ECONNREFUSED between server's bind(2) and
listen(2), but the most downtime between boot and service start the socket
won't exist, yet. I.e. ENOENT is the de facto ECONNREFUSED of *nix sockets.
2023-06-05 11:21:45 +02:00
Alexander A. Klimov
e776c99ede Merge network and database error retryability detection functions
so that connection attempts will also be re-tried on RDBMS-specific errors,
e.g. Postgres' 57P03 (the database system is starting up), not to crash.
On the other hand, SQL operations which are safe to retry on SQL errors
are also safe to retry on network errors.
2023-05-26 12:21:09 +02:00
Alexander A. Klimov
5a79a72ff5 Heartbeat#sendEvent(m): nil-check m before dereferencing it
as it can be nil.
2023-01-19 16:55:11 +01:00
Alexander A. Klimov
ab14413393 Log UNIX socket address w/o port number
E.g. not
Connecting to database at '/var/lib/mysql/mysql.sock:0'
Connecting to Redis at '/run/icingadb-redis/icingadb-redis-server.sock:6380'
2022-11-09 11:03:50 +01:00
Julian Brost
a327ef0275
Merge pull request #525 from Icinga/save-memory
Save memory during config sync via SyncSubject#FactoryForDelta()
2022-11-02 12:27:06 +01:00
Alexander A. Klimov
f7d132ccfa Make checkDbSchema() reusable as DB#CheckSchema() 2022-10-11 16:32:22 +02:00
Alexander A. Klimov
adcd004231 Introduce DB#CreateIgnoreStreamed() 2022-10-11 12:46:48 +02:00
Alexander A. Klimov
f063687b2b DB#BuildInsertIgnoreStmt(): handle primary key being not "id" 2022-10-11 12:46:47 +02:00
Alexander A. Klimov
581270ffee cmd/ido2icingadb: support Postgres 2022-10-11 12:46:20 +02:00
Alexander A. Klimov
6209b5b376 Save memory during config sync via SyncSubject#FactoryForDelta()
Code comment TL;DR: Allocate the same amount of smaller data structures
2022-09-13 17:57:23 +02:00
Alexander Aleksandrovič Klimov
305800fdb0
Merge pull request #503 from Icinga/parseString-DRY
parseString(): Don't Repeat Yourself
2022-08-19 11:46:34 +02:00
Eric Lippmann
cf8e12f391 Set Redis server port to 6380 by default
All Icinga DB components use 6380 as default Redis port.
2022-06-29 15:42:04 +02:00
Julian Brost
5d25d81922
Merge pull request #508 from Icinga/state-soft_state
icinga:*:state: rename state to soft_state
2022-06-29 13:25:11 +02:00
Alexander A. Klimov
ae2c40e998 icinga:*:state: rename state to soft_state 2022-06-29 11:56:29 +02:00
Julian Brost
924d455348
Merge pull request #504 from Icinga/retry
Fixes related to the retry functionality
2022-06-29 10:41:31 +02:00
Eric Lippmann
df72c81708 Retry down and unreachable host or network errors 2022-06-29 09:59:12 +02:00
Eric Lippmann
9cb8bf36a6 Fix comment 2022-06-28 21:14:28 +02:00
Eric Lippmann
444332a682 Retry ECONNRESET
ECONNRESET is treated as a temporary error by Go only if it comes from
calling accept.
2022-06-28 19:58:02 +02:00
Julian Brost
e8f611ddc6
Merge pull request #505 from Icinga/make-json-keys-and-db-columns-consistent
Make json keys and DB columns consistent
2022-06-28 16:45:52 +02:00
Eric Lippmann
6a5db1ca94 Retry: Detect ECONNREFUSED properly
Also the order of the checks has been adjusted and the documentation has
been adapted to it. In addition, EAGAIN is no longer checked, since this
is already done via Timeout().
2022-06-28 16:09:32 +02:00
Eric Lippmann
cd96f0de6f Block XREADs for a maxium of one second
I just had the observation that blocking XREADs without timeouts (BLOCK
0) on multiple consecutive Redis restarts and I/O timeouts exceeds Redis
internal retries and eventually leads to fatal errors. @julianbrost
looked at this for clarification, here is his finding:

go-redis only considers a command successful when it returned something,
so a successfully started blocking XREAD consumes a retry attempt each
time the underlying Redis connection is terminated. If this happens
often before any element appears in the stream, this error is
propagated. (This also means that even with this PR, when restarting
Redis often enough so that a query never reaches the BLOCK 1sec, this
would still happen.)

https://github.com/Icinga/icingadb/pull/504#issuecomment-1164589244
2022-06-28 16:09:29 +02:00
Eric Lippmann
d9e876905f Fix Redis MaxRetries
Previously, we set the maximum number of retries to the pool size + 1,
but increased the pool size immediately after this assignment, so the
maximum number of retries was always too low for systems with less than
4 cores. Now it is set the other way around.
2022-06-28 16:09:04 +02:00
Eric Lippmann
5f29caecbe
Merge pull request #464 from Icinga/OwnHeartbeat
Write own status into Redis
2022-06-28 15:21:03 +02:00
Julian Brost
061660b023 Telemetry: use mutex for synchronizing last database error
The old CompareAndSwap based code tended to end up in an endless loop. Replace
it by simple syncrhonization mechanisms where this can't happen.
2022-06-28 13:30:00 +02:00
Julian Brost
def7c5f22c Telemetry: change stats names in Redis
The same names are used in perfdata names and config_sync sounds more natural
than sync_config.
2022-06-28 13:30:00 +02:00
Julian Brost
741460c935 Telemetry: rename keys in heartbeat stream
In both C++ and Go, the keys are only used as constant strings, so namespacing
them just adds clutter for the `general:*` keys, therefore remove it.
2022-06-28 13:30:00 +02:00
Julian Brost
36d5f7b33c Telemetry: send Go metrics as performance data string
Rather than using a JSON structure to convey these values, simply use the
existing format to communicate performance data to Icinga 2.

Also removes the reference to Go in the Redis structure, allowing this string
to be extended with more metrics in the future without running into naming
issues.
2022-06-28 13:30:00 +02:00
Yonas Habteab
fa6c23d634 Make json keys and DB columns consistent 2022-06-24 16:00:11 +02:00
Alexander A. Klimov
e1ff704aff Write own heartbeat into icingadb:telemetry:heartbeat
including version, current DB error and HA status quo.
2022-06-23 18:31:45 +02:00
Alexander A. Klimov
80ab823294 Introduce Atomic[T] 2022-06-23 18:31:45 +02:00
Alexander A. Klimov
64d7f1be43 Remove unused StreamLastId() 2022-06-23 18:31:45 +02:00
Alexander A. Klimov
d85d070d1f Clear icinga:runtime* and read from 0-0 later
instead of preserving the (never read) data and reading beyond its end later.
This indicates the correct number of pending runtime updates
(for monitoring by Icinga 2) from the beginning.
2022-06-23 18:31:45 +02:00
Alexander A. Klimov
9b618c690a XTRIM data XREAD from icinga:runtime*
for Icinga 2 to monitor pending runtime updates.
2022-06-22 17:38:58 +02:00
Alexander A. Klimov
6627ecbfad parseString(): Don't Repeat Yourself 2022-06-22 15:27:00 +02:00
Alexander A. Klimov
2bda98cbe4 oneBulk(): terminate once input closed (like the regular bulker)
instead of outputting zero values.
2022-06-22 12:32:30 +02:00
Alexander A. Klimov
fac9f5e4e5 Write ops/s by op and s to icingadb:telemetry:stats 2022-06-15 09:51:59 +02:00
Alexander A. Klimov
0e5d098be4 DB#CleanupOlderThan(): allow to get done work counted in real time 2022-06-15 09:51:59 +02:00
Alexander A. Klimov
48b7bb4c35 DB#Delete(): allow monitoring succeeded items 2022-06-15 09:51:59 +02:00
Alexander A. Klimov
cc352252ec DB#CreateStreamed(): allow monitoring succeeded items 2022-06-15 09:51:59 +02:00
Alexander A. Klimov
db4725218e DB#{*BulkExec,*Streamed}(): replace succeeded channel with callbacks
to allow to avoid a goroutine reading that channel.
2022-06-15 09:51:59 +02:00
Julian Brost
1c02f89b9b
Merge pull request #493 from Icinga/schema-consistency-for-relations
Schema consistency for relations
2022-06-09 10:19:46 +02:00
Yonas Habteab
154f46c2f0 Checkable: Adjust the naming of the struct/json keys according to the new scheme 2022-05-31 15:15:29 +02:00
Julian Brost
cd78d96f04 Fix icingadb --version output when using older Git versions
When building Icinga DB from a tarball generated using `git archive` using a
Git version older than 2.32, the version output could incorrectly state "Icinga
DB version: %(describe)". This commit detects this situation and implements a
fallback.
2022-05-24 17:53:19 +02:00
Julian Brost
64aca11bcb
Merge pull request #489 from Icinga/retry-dns-errors
Streamline IsRetryable functions and retry DNS errors
2022-05-24 16:43:54 +02:00
Eric Lippmann
51068fff46
Merge pull request #487 from Icinga/feature/version-details
Add more information to `icingadb --version` ouput
2022-05-24 16:04:38 +02:00
Eric Lippmann
53cee3ee04 Streamline IsRetryable functions and retry DNS errors
Aligns the behavior of the IsRetryable functions for Redis and database.
It now also checks if the error implements timeout, even if the error
implements temporary, where previously only the temporary bool was
returned and timeout was ignored. The idea here is that an error could
implement both, returning false for temporary and true for timeout.
Also, all DNS errors are now considered retryable.
2022-05-24 16:02:34 +02:00
Julian Brost
c6e843146f Add more information to icingadb --version ouput
This commit adds the build information (Go version, Git commit) and system
information (distribution with version) to the output of `icingadb --version`.

When exporting the source code using `git archive`, Git will insert the version
information using the export-subst attribute (adds both a pretty version string
like `git describe` and the commit hash).

`go build` also adds some Git commit information to the resulting binary when
building from a Git working directory (only the commit hash and a flag if there
are uncommitted changes, but no pretty version string).

Note that `go build` does not include Git version information in the binary, so
when running directly from a Git working directory, commit information won't be
available in the binary, but when doing this, you should be well aware which
version you're running anyways.

System information is obtained from the `os-release` file.
2022-05-23 16:03:56 +02:00
Julian Brost
5f5b3fb919
Merge pull request #482 from Icinga/feature/parameter-delimiters-check-execution-6277
Add CommandArgument#Separator
2022-05-23 13:23:51 +02:00
Alexander A. Klimov
c1c15331e4 Quote column names for the case they're reserved 2022-05-17 17:57:55 +02:00
Alexander A. Klimov
1cacfbe7ba Add CommandArgument#Separator 2022-05-16 17:26:25 +02:00
Eric Lippmann
5e3a85976d Expect serverName only in TLS.MakeConfig()
With recent changes to Unix domain socket support, port and address
handling in SQL and Redis configuration, the function can now be reduced
to just expecting the server name.
2022-05-16 17:01:09 +02:00
Eric Lippmann
399b6a3d32 Split Redis address into host and port
The port is set to 6379 by default to keep it consistent with standard
Redis installations, but the example configuration explicitly specifies
6380 since that is the default port of the icingadb-redis package.
2022-05-16 17:01:09 +02:00
Julian Brost
eccac78ff3 Retention: take environment_id into account
This commit ensures that the retention feature only deletes history from the
current environment. Previously, the deletion queries where missing an
appropriate WHERE clause.
2022-05-13 17:19:03 +02:00
Julian Brost
da3fa88707
Merge pull request #477 from Icinga/feature/more-config-validation
Check for required database and Redis config options during config validation
2022-05-13 16:09:00 +02:00
Julian Brost
21bc728783 CleanupOlderThan: no longer return number of rounds
This value is not used anymore, so instead of returning a struct, the function
can just return the number of rows deleted as uint64.
2022-05-13 15:30:06 +02:00
Julian Brost
5b6c37feca Retention: remove StartWithCallback
This was added for the tests but the corresponding test was rewritten in #467
so it's no longer used or needed.
2022-05-13 15:30:06 +02:00
Julian Brost
3335595587 Build fix
Two PRs (#247, #480) were merged without hard merge conflicts but the resulting
code missed a change of a variable leading to a build failure.
2022-05-13 15:27:25 +02:00
Julian Brost
772e9bddfd
Merge pull request #480 from Icinga/feature/retention-logging
Retention: periodically log number of items removed
2022-05-13 15:17:18 +02:00
Julian Brost
5081ded974 Check for required database and Redis config options during config validation 2022-05-13 15:09:31 +02:00
Eric Lippmann
8480ba949a
Merge pull request #483 from Icinga/bugfix/sql-port-numbers
DB: use default ports and allow setting port for PostgreSQL Unix domain sockets
2022-05-13 13:41:16 +02:00
Julian Brost
19170ecbcf SLA reporting: history retention for SLA tables 2022-05-13 12:04:47 +02:00
Julian Brost
e9bd5cd40f SLA reporting: additionally write relevant history events to dedicated SLA tables 2022-05-13 12:04:47 +02:00
Julian Brost
aeeab5918c Use default MySQL port if none is specified 2022-05-12 16:35:41 +02:00
Julian Brost
bfea92e039 Allow setting port for PostgreSQL Unix domain socket
When you specify a socket path like /run/postgresql, the actual socket file is
located at /run/postgresql/.s.PGSQL.5432 where the number is the port number of
the server (as it's used for TCP). So it makes sense also allowing to set the
port for Unix domain sockets.

This commit also omits the port from the connection URI if none is given for
TCP connections, thus also using the default value in this case.
2022-05-12 16:35:41 +02:00
Julian Brost
d5b55ee515 Retention: periodically log number of items removed
Other components log this information periodically at level info, whereas the
retention feature was completely quiet at that level. It's logged at the
interval the retention cleanup is run rather than the global configured logging
interval since retention cleanup is done less often.
2022-05-11 09:30:34 +02:00
Julian Brost
c1bbc037de
Merge pull request #471 from Icinga/embed.lua
go:embed LUA script
2022-05-10 12:53:07 +02:00
Julian Brost
078507122d
Merge pull request #459 from Icinga/424
Ensure icingadb_instance#responsible=n
2022-05-05 15:05:27 +02:00
Alexander A. Klimov
08b72cdf10 go:embed LUA script
for the sake of syntax highlighting.
2022-05-04 19:59:50 +02:00
Alexander A. Klimov
2f3a176bff On HA takeover set other instances' icingadb_instance#responsible = n
for the case they crashed and didn't that by themselves.
2022-05-04 19:41:03 +02:00
Alexander A. Klimov
67267a0f46 On HA handover: always set icingadb_instance#responsible=n
even on lost heartbeat.
2022-05-04 19:40:50 +02:00
Eric Lippmann
6cb452c2e6
Merge pull request #469 from Icinga/bugfix/retry-eagain
Retry EAGAIN
2022-05-04 16:38:06 +02:00
Julian Brost
ef0ccc3555 Retry EAGAIN 2022-05-03 14:30:31 +02:00
Alexander A. Klimov
4f9fda66d5 RDBMS: support *nix sockets as documented 2022-05-02 12:17:27 +02:00
Alexander A. Klimov
f843b06288 Do x.UnixMilli(), not utils.UnixMilli(x)
and remove redundant utils.UnixMilli().
2022-04-14 12:59:37 +02:00
Alexander A. Klimov
2bc92cbab7 UnixMilli(x): don't overflow on 4/11/2262 (UTC)
but on 8/17/292278994 by not converting x into int64 ns and those to ms.
2022-04-14 12:59:37 +02:00
Alexander A. Klimov
7b352c52db Merge Bulker and EntityBulker 2022-04-04 16:49:35 +02:00
Alexander A. Klimov
5b3a5cc163 Remove unused XMessageBulker 2022-03-30 13:40:26 +02:00
Alexander A. Klimov
b076f838bf Reuse generic com.Bulk() instead of redundant com.BulkXMessages() 2022-03-30 13:40:26 +02:00
Alexander A. Klimov
82cff812c6 Make Bulker generic 2022-03-30 13:40:26 +02:00
Eric Lippmann
c123276e2c Start history retention immediately 2022-03-22 15:55:04 +01:00
Eric Lippmann
17a7b026ce Add immediate option for periodic tasks 2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
c4c89c2cae Allow history retention configuration
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
5340805834 Introduce config.HistoryRetention
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
5b99f74062 Introduce history.Retention
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-22 15:55:04 +01:00
Ravi Kumar Kempapura Srinivasa
5f4c36cc5b Introduce db.CleanupOlderThan()
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2022-03-21 16:48:12 +01:00
Eric Lippmann
3f6b303f4d Remove null bytes from strings
PostgreSQL does not allow null bytes in varchar, char and
text fields.
2022-03-10 17:07:06 +01:00
Alexander A. Klimov
d898681d3c Wrap "icingadb-*sql" in constants
refs #136
2022-03-10 17:07:06 +01:00
Alexander A. Klimov
b84fc62112 Simplify BulkChunkSplitPolicy
refs #136
2022-03-10 17:04:22 +01:00
Alexander A. Klimov
8da164c50f Throw BulkChunkSplitPolicy#Reset() away
refs #136
2022-03-10 17:04:22 +01:00
Alexander A. Klimov
10a70e8b71 Pass BulkChunkSplitPolicyFactory-s, not BulkChunkSplitPolicy-s
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
3eb14274dd DB#BuildDeleteStmt(): don't pre-rebind ?s
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
7f4b895ea9 NamedBulkExec(): allow custom BulkChunkSplitPolicy
By the way avoid duplicate rows in the same upsert chunk to avoid Postgres
error 21000 (ON CONFLICT DO UPDATE command cannot affect row a second time).

refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
db2c3af769 BulkEntities(): allow custom BulkChunkSplitPolicy
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
d4f2c13d9c NewEntityBulker(): allow custom BulkChunkSplitPolicy
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
3854424a91 Introduce SplitOnDupId 2022-03-10 17:04:21 +01:00
Alexander A. Klimov
6b59f2e47c Introduce NeverSplit 2022-03-10 17:04:21 +01:00
Alexander A. Klimov
dccf02e11d Introduce BulkChunkSplitPolicy 2022-03-10 17:04:21 +01:00
Alexander A. Klimov
5b87fd94ee Don't re-invent sqlx.DB#Rebind()
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
908bb42004 Postgres: upsert: only handle primary key conflicts
refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
eca23a95ed DB#Build*Stmt(): quote table names
Rationale: see https://dba.stackexchange.com/q/73136

refs #136
2022-03-10 17:04:21 +01:00
Alexander A. Klimov
1c3bfcf99d Support Postgres
refs #136
2022-03-09 18:49:45 +01:00
Alexander A. Klimov
ad895b560d Handle Postgres-specific errors
refs #136
2022-03-09 18:49:45 +01:00
Alexander A. Klimov
aed0e9124f Avoid SQL syntax Postgres doesn't understand
refs #136
2022-03-09 18:49:45 +01:00
Alexander A. Klimov
879b683041 Add previous_soft_state to host_state and service_state
refs #437
2022-02-17 13:48:17 +01:00
Eric Lippmann
b65e427232
Merge pull request #432 from Icinga/bugfix/crash-after-interuption-of-mysql-connection-427
HA#realize(): re-try transaction on temporary error
2022-02-03 16:58:29 +01:00
Eric Lippmann
bf92290507 Don't embed TLS config
When embedding TLS, the field name is implicitly specified as TLS,
which conflicts with the YAML key tls,
which currently does not allow TLS to be enabled.
I'm not entirely sure if this is a bug in goccy/go-yaml,
but if a struct field name other than TLS is specified,
the configuration works again.
2022-02-03 13:10:16 +01:00
Eric Lippmann
59cf6ccc41 Rename TLS.Tls to TLS.Enable
Enable is more self-documenting.
2022-02-03 10:03:46 +01:00
Alexander A. Klimov
943133a4ac HA#realize(): re-try transaction on temporary error
and don't just crash.

refs #427
2022-02-02 13:23:37 +01:00
Noah Hilverling
12b99eda89 Make sure Redis connection pool is large enough
The default Redis PoolSize is 10 * CPU, which isn't enough to run Icinga DB on machines with only 1 CPU.
Most of our open connections come from blocking XREADs. (e.g. Heartbeat, Runtime, Overdue, History)
2021-12-09 15:55:24 +01:00
Eric Lippmann
68943a64c4
Merge pull request #410 from Icinga/bugfix/improve-notification-recipient
Make NotificationRecipient struct readable
2021-11-12 18:07:06 +01:00
Noah Hilverling
a938cfa175 Make NotificationRecipient struct readable 2021-11-12 16:33:33 +01:00
Eric Lippmann
f21f50e958 Reduce max_hmget_connections to 8 2021-11-12 16:29:59 +01:00
Eric Lippmann
69a0897847 Change default configuration file path 2021-11-12 16:29:59 +01:00
Julian Brost
f710c48394
Merge pull request #408 from Icinga/retry-broken
Fix broken retry mechanics
2021-11-12 14:32:31 +01:00
Eric Lippmann
a811c43727
Merge pull request #394 from Icinga/bugfix/unbulk-rtu
RuntimeUpdates#Sync(): force FIFO for config updates
2021-11-12 12:56:34 +01:00
Eric Lippmann
6a8163cdbc Runtime Updates: Use proper buffer channel sizes 2021-11-12 12:39:24 +01:00
Alexander A. Klimov
7d6474f6b5 Add special handling for entity bulks of size 1
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2021-11-12 12:39:22 +01:00
Alexander A. Klimov
d356909edc Add special handling for bulks of size 1
Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2021-11-12 12:38:33 +01:00
Alexander A. Klimov
fecf332b8e RuntimeUpdates#Sync(): force FIFO for config updates
so they don't interfer.

Co-authored-by: Eric Lippmann <eric.lippmann@icinga.com>
2021-11-12 12:35:12 +01:00
Yonas Habteab
54c563d1c7 Add service_state.host_id column 2021-11-12 11:28:02 +01:00
Yonas Habteab
6faa84d94a Downtime: Add duration & scheduled_duration columns 2021-11-12 11:28:02 +01:00
Eric Lippmann
7f3621e980 Fix broken retry mechanics
dc7511c introduced a parent context check to suppress logging if
it was canceled.
If it was not canceled, the check overwrites the variable err,
which resets every previous real error to nil,
which then leads to fatals because the OnError callback or
the IsRetryable function expect a non-nil error.
Since I cannot reproduce which logs should have been suppressed by
the changes, I removed them completely.
2021-11-11 21:26:11 +01:00
Noah Hilverling
c19cfdf406 Schema: Prefix command_id with command type (check, event, notification)
Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
2021-11-09 15:11:09 +01:00
Eric Lippmann
94abcef7bf
Merge pull request #388 from Icinga/bugfix/gpl2
Replace Apache 2.0 licensed gopkg.in/yaml.v3 with MIT licensed github.com/goccy/go-yaml
2021-11-09 11:13:29 +01:00
Eric Lippmann
ea74dc172a Rename periodic.Stoper to periodic.Stopper 2021-11-05 17:57:27 +01:00
Eric Lippmann
886c60c95a Use custom logger with 1 second interval for delta tests 2021-11-05 17:57:27 +01:00
Eric Lippmann
ccda48234e Use custom logger for accessing the interval for periodic logging 2021-11-05 17:57:22 +01:00
Eric Lippmann
8ec157e39b Add periodic logging for runtime updates 2021-11-05 17:52:48 +01:00
Eric Lippmann
6232773943 Use debug instead of info for some log messages
These log messages are not relevant for the info level.
2021-11-05 17:52:48 +01:00
Eric Lippmann
2d4b5419af Log which history sync started 2021-11-05 17:52:48 +01:00
Eric Lippmann
5fd4d35907 Remove syncing $subject log message
This info message just pollutes the logs and
for debugging we log the execution anyway
2021-11-05 17:52:46 +01:00
Eric Lippmann
43bcd2bbee Remove syncing $redisKey log message
This info message just pollutes the logs and
for debugging we log the execution anyway.
2021-11-05 17:52:11 +01:00
Eric Lippmann
8ce917d45a Remove waiting for heartbeat message
If a heartbeat is pending,
we log it every 60 seconds anyway.
2021-11-05 17:52:11 +01:00
Eric Lippmann
bd23f17eda Use pkg periodic for database logs 2021-11-05 17:52:10 +01:00
Eric Lippmann
8e7564b2aa Log which delta finished 2021-11-05 17:18:05 +01:00
Eric Lippmann
d6a28d7672 Use pkg periodic for history sync logs 2021-11-05 17:18:05 +01:00
Eric Lippmann
4b239d69bb Use debug instead of info for overdue refresh logs 2021-11-05 17:18:05 +01:00