Commit graph

1972 commits

Author SHA1 Message Date
Eric Lippmann
c5f1b88c0c Merge pull request #4 from lippserd/feature/initer
Make NameCiMeta an Initer
2021-03-17 09:56:10 +01:00
Eric Lippmann
dfd904b064 Merge pull request #1 from lippserd/ha
HA improvements
2021-03-16 10:12:23 +01:00
Alexander A. Klimov
4dffbad76e Make channels more specific 2021-03-15 16:34:58 +01:00
Eric Lippmann
872323a98d Merge pull request #5 from lippserd/bugfix/host-checkable
Host: re-use Checkable
2021-03-15 15:27:02 +01:00
Eric Lippmann
b3e14d6663 Merge pull request #3 from lippserd/bugfix/gomod
Make project a Go module
2021-03-15 10:15:21 +01:00
Alexander A. Klimov
aa3dfc2afc Sync URLs as well 2021-03-12 16:44:19 +01:00
Alexander A. Klimov
02b15e01a3 Host: re-use Checkable 2021-03-12 10:59:40 +01:00
Alexander A. Klimov
cf2fdfe381 New*(): don't re-do Init() 2021-03-12 10:55:28 +01:00
Alexander A. Klimov
8cd62118b2 Auto-init Initers 2021-03-12 10:55:12 +01:00
Alexander A. Klimov
ecf3dd74ae Make NameCiMeta an Initer 2021-03-12 10:55:09 +01:00
Alexander A. Klimov
4d24c97d90 Make project a Go module 2021-03-12 10:47:51 +01:00
Julian Brost
6ccbc7d091 HA: only execute query to remove old instances once 2021-03-08 13:01:52 +01:00
Julian Brost
a474c83651 Replace persisted instance ID with a random one and remove old rows from icingadb_instance 2021-03-08 13:01:52 +01:00
Julian Brost
ab268bfbb6 Always write HA heartbeat 2021-03-08 13:01:52 +01:00
Julian Brost
4293a51c88 Only signal HA takeover if a takeover was attempted 2021-03-08 13:01:52 +01:00
Julian Brost
476d2bc20e Insert endpoint_id into icingadb_instance 2021-03-08 13:01:52 +01:00
Eric Lippmann
6ca9d36c8b Add cmd 2021-03-04 00:50:24 +01:00
Eric Lippmann
41cfa9e0df Add first set of types to sync 2021-03-04 00:49:23 +01:00
Eric Lippmann
34603b5e1d Introduce meta types 2021-03-04 00:49:23 +01:00
Eric Lippmann
bb9a2b0251 Implement sync 2021-03-04 00:49:23 +01:00
Eric Lippmann
262749c575 Add type icingadb.HA 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
Eric Lippmann
facfc16958 Introduce pkg com
pkg com provides concurrency and channel related utilities.
2021-03-03 15:59:52 +01:00
Eric Lippmann
a696157f47 Introduce flatten
Flatten creates flat, one-dimensional maps from arbitrarily nested
values, e.g. JSON.
2021-03-03 15:55:54 +01:00
Eric Lippmann
4131290641 Auto-reconnect database conns 2021-03-03 15:30:51 +01:00
Eric Lippmann
61f8e7f915 Introduce retry functionality
With exponential backoff and context support.
2021-03-03 15:27:20 +01:00
Eric Lippmann
a35eaefae9 Increase timeout to 60s for database connections 2021-03-03 15:20:27 +01:00
Eric Lippmann
6cd2c20e22 Add type icingadb.DB
DB is a wrapper around sqlx.DB with bulk execution,
statement building, streaming and logging capabilities.
2021-03-03 15:20:27 +01:00
Eric Lippmann
64f59cdbf8 Add config.yml.example 2021-03-03 15:20:27 +01:00
Eric Lippmann
af89b2652b Add config utils
This commit introduces utility functions for parsing and validating
CLI flags and YAML configuration files.
2021-03-03 15:20:27 +01:00
Eric Lippmann
140f46af0e Add type config.Redis
Redis defines Redis client configuration.
2021-03-03 15:20:27 +01:00
Eric Lippmann
03f26b5b18 Add type config.Database
Database defines database client configuration.
2021-03-03 15:20:27 +01:00
Eric Lippmann
cac82120c7 Add .gitignore 2021-03-03 15:20:27 +01:00
Eric Lippmann
53f51a053d Add type types.Bool
Bool represents a bool for ENUM ('y', 'n'), which can be NULL.
2021-03-03 15:20:27 +01:00
Eric Lippmann
eecc9bf528 Add type types.UnixMilli
UnixMilli is a nullable millisecond UNIX timestamp in databases and
JSON. We work with milliseconds throughout the Icinga DB, so this
should be the type for every timestamp.
2021-03-03 15:20:27 +01:00
Eric Lippmann
cbdde4b15f Add type types.Binary
Binary is a nullable byte string used for IDs and checksums or
keys in general in databases and Redis. For JSON, Binary is
represented as hex.
2021-03-03 15:20:27 +01:00
Eric Lippmann
03e6e9d0f3 Add utils
This commit introduces various utility functions.
2021-03-03 15:20:27 +01:00
Eric Lippmann
5f5028e637 Add contracts
This commit introduces the abstract type Entity and related components.
Entity has to be implemented by all types that Icinga DB should
synchronize.
2021-03-03 15:19:55 +01:00
Noah Hilverling
d9e3c8b195
Merge pull request #252 from Icinga/bugfix/history-id-hash
Schema: correct comments in flapping_history, acknowledgement_history
2021-03-03 13:22:48 +01:00
Noah Hilverling
923c78908e
Merge pull request #262 from Icinga/dependabot/go_modules/github.com/sirupsen/logrus-1.8.0
Bump github.com/sirupsen/logrus from 1.7.0 to 1.8.0
2021-02-23 13:29:22 +01:00
dependabot[bot]
99e06b7eab
Bump github.com/sirupsen/logrus from 1.7.0 to 1.8.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.7.0...v1.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 10:02:34 +00:00
Noah Hilverling
0c151c7b5c
Merge pull request #261 from Icinga/feature/go-test-timeout
Set an explicit timeout for go test
2021-02-19 12:39:57 +01:00
Julian Brost
4a8be8b296 Set an explicit timeout for go test
The default value is 10 minutes which is the same as the whole action
has as a timeout. If go test itself aborts before, we should hopefully
get more information on what went wrong.
2021-02-19 10:51:54 +01:00
Noah Hilverling
85ba397605
Merge pull request #222 from Icinga/feature/fetch-all
Drop *Bridge
2021-02-18 16:48:38 +01:00
Alexander A. Klimov
c93c84b00f Drop *Bridge 2021-02-18 12:32:49 +01:00
Alexander A. Klimov
1caf544a67 SqlFetchAll*(): return a slice of struct 2021-02-18 12:32:49 +01:00
Alexander A. Klimov
5c8a012ceb Drop unused SqlFetchAll*() 2021-02-18 12:27:53 +01:00
Noah Hilverling
22a727cb19
Merge pull request #239 from Icinga/bugfix/overdue
Make overdue sync HA-aware
2021-02-17 17:56:57 +01:00