221 Commits

Author SHA1 Message Date
Julian Brost
4ffe88e263
Merge pull request #9732 from Icinga/silence-compiler-warnings-in-code-we-don-t-maintain
Silence compiler warnings in code we don't maintain
2025-01-15 16:33:24 +01:00
Alexander A. Klimov
6195a457a7 Silence compiler warnings in code we don't maintain 2025-01-14 11:48:33 +01:00
Alexander A. Klimov
c6f9de5933 Ido*sqlConnection#FieldToEscapedString(): don't write out of range time
MySQL's FROM_UNIXTIME() NULLs ts <1970, errors for >2038.
Postgres' TO_TIMESTAMP() errors for all ts not between 4713BC - 294276AD.
2024-10-02 11:52:25 +02:00
Alexander A. Klimov
ad6fcda6df Ido*sqlConnection#FieldToEscapedString(): don't overflow timestamps > long 2024-10-01 17:38:52 +02:00
Alexander A. Klimov
ba7102cae3 Explicitly stop started timers and wait for them
before permitting their parent objects' destruction.
For the cases where the handlers have raw pointers to these objects.
2023-04-14 14:52:04 +02:00
Alexander A. Klimov
21b68455ce Use Timer::Create() instead of new Timer()
git ls-files -z |xargs -0 perl -pi -e 's/\bnew Timer\b/Timer::Create/g'

ex. in Timer::Create() itself.
2023-04-04 10:35:20 +02:00
Alexander A. Klimov
83021f8231 CONTEXT: use << everywhere to unify usages 2022-11-30 11:06:51 +01:00
Alexander Aleksandrovič Klimov
f749c7556e
Merge pull request #9314 from Icinga/latin1
IDO MySQL: reason latin1 charset for actually UTF-8 bytes
2022-04-04 11:05:12 +02:00
Alexander A. Klimov
11b8d0f058 IDO MySQL: reason latin1 charset for actually UTF-8 bytes 2022-03-31 18:10:21 +02:00
Alexander Aleksandrovič Klimov
2fa26961ac
Merge pull request #9311 from Icinga/9308
IDO MySQL: explicitly use latin1
2022-03-31 16:44:11 +02:00
Alexander A. Klimov
245fbad1e5 IDO MySQL: explicitly use latin1
for the case the MySQL client lib is compiled with another default
not to turn Unicode chars into ??.
2022-03-31 15:04:45 +02:00
Julian Brost
23693248d4 Make MySQL schema version in full schema file and upgrade files consistent
In the 2.12.6 release, the full schema file sets the version to 1.14.3, whereas
the latest available upgrade file 2.11.0.sql sets it to 1.15.0. Therefore, ship
a new upgrade file 2.12.7.sql for all users who imported their schema with
version 2.11.0 or later and never performed an upgrade since then. Their
databases incorrectly state schema version 1.14.3 and is bumped to the correct
version 1.15.0 by the upgrade.

In the 2.13.2 release, the full schema file sets the version to 1.15.0, whereas
the latest available upgrade file 2.13.0.sql sets it to 1.15.1. Therefore,
rename the incorrectly named upgrade file 2.13.1.sql (it was not shipped in
this or any other release so far) to 2.13.3.sql for users who imported their
schema with version 2.13.0 or later and never performed an upgrade since then.
Their databases incorrectly state schema version 1.15.0 and are bumped to the
correct version 1.15.1 by the upgrade.

The full schema is not touched by this commit as for the current branch, this
was already fixed by 815533b334395c0c1007b2de9e6c317fee50713e.
2021-12-16 15:48:12 +01:00
Alexander Aleksandrovič Klimov
1fbc15bebc
Provide IDO MySQL schema version fix
... for fresh 2.13 installations which didn't make use of previous schema upgrades.
2021-08-05 13:46:07 +02:00
Alexander Aleksandrovič Klimov
815533b334
Fix IDO MySQL schema version
... to match the latest upgrade script.
2021-08-05 13:17:36 +02:00
Alexander Aleksandrovič Klimov
89472a9e51
Merge pull request #8425 from Icinga/bugfix/hosts-128-characters-7472
IDO MySQL: support larger host and service names
2021-07-16 18:34:29 +02:00
Alexander A. Klimov
e4bfb4898d IDO MySQL: support larger host and service names
refs #7472
2021-07-15 11:16:13 +02:00
Julian Brost
f17b97fd7e
Merge pull request from GHSA-wrpw-pmr8-qgj7
Remove passwords from API
2021-07-15 11:12:29 +02:00
Alexander Aleksandrovič Klimov
b63eb2aa3d
Merge pull request #8855 from Icinga/bugfix/inconsistent-ido-schema-versions-8852
Fix IDO MySQL schema version (as in v2.11 upgrade)
2021-07-14 18:09:27 +02:00
Alexander Aleksandrovič Klimov
bee83ead8b
Merge pull request #8730 from Icinga/bugfix/ido-stop-progstat-8727
IDO: update program status on stop
2021-07-06 18:07:38 +02:00
Alexander A. Klimov
e9118d6b09 Fix IDO MySQL schema version (as in v2.11 upgrade) 2021-07-05 19:17:53 +02:00
Alexander A. Klimov
4373acf8ed Ido*sqlConnection::Reconnect(): de-couple MySQL and Postgres schema versions 2021-07-05 19:17:51 +02:00
Alexander A. Klimov
9e2f58ea9f IdoCheckTask: de-couple MySQL and Postgres schema versions 2021-07-05 19:14:07 +02:00
Julian Brost
401d3cdc9e Remove passwords from API
IdoMysqlConnection, IdoPgsqlConnection, IcingaDB, and ElasticsearchWriter
require passwords in their configuration to authenticate against external
services. This commit ensures that these can no longer be accessed using the
API.
2021-07-05 15:09:54 +02:00
Alexander Aleksandrovič Klimov
b7efbd0bba
Merge pull request #8626 from Icinga/bugfix/recreate-object-invisible-ido-8584
Ido*sqlConnection#InternalDeactivateObject(): mark object inactive also in memory
2021-07-02 16:34:28 +02:00
Noah Hilverling
f551e95338 IDO-MySQL: Make sure InternalNewTransaction() and FinishAsyncQueries() get executed during high load 2021-05-19 17:28:11 +02:00
Alexander A. Klimov
306a0f476c Ido*Connection#FieldToEscapedString(): support NULL
refs #8727
2021-04-20 19:30:59 +02:00
Alexander A. Klimov
3d8586ccec Ido*Connection: extend IsPaused() check where the difference matters
refs #8727
2021-04-20 19:04:49 +02:00
Alexander A. Klimov
92df2ce2ca Deduplicate DbConnection#Disconnect() in #Pause()
refs #8727
2021-04-20 18:42:37 +02:00
Alexander A. Klimov
0d34d8951a Abstract Ido*Connection#Disconnect()
refs #8727
2021-04-20 18:40:49 +02:00
Alexander A. Klimov
fd9bdb798d Deduplicate DbConnection#m_QueryQueue.Join() in #Pause()
refs #8727
2021-04-20 18:40:35 +02:00
Yonas Habteab
43ba2da39c Replace std/boost::bind() function with lambda expression 2021-03-10 16:29:40 +01:00
Alexander A. Klimov
e0c13401f7 Ido*sqlConnection#InternalDeactivateObject(): mark object inactive also in memory
Previously:
1. You delete an object from a config file
2. You reload Icinga
3. Icinga fetches all objects and whether they're active from the IDO
4. Icinga recognizes that the just deleted object doesn't exist anymore
5. Icinga marks it as inactive in the IDO, but not in memory
6. You re-create the just deleted object via API
7. Icinga still thinks it's active and doesn't activate it - it's invisible

refs #8584
2021-02-08 16:57:15 +01:00
Noah Hilverling
03af068302 IDO: Make sure to insert program status during reconnect() 2020-10-16 12:30:57 +02:00
Noah Hilverling
8db82ff87d IDO: Do not log stats, if paused 2020-10-15 10:48:41 +02:00
Alexander A. Klimov
cd72eaf2b9 IDO MySQL: actually COMMIT after 25000 async queries 2020-10-14 10:40:57 +02:00
Henrik Triem
7a759a6427 IDO: Implement more accurate logging for query stats 2020-09-22 13:44:02 +02:00
Michael Friedrich
9932f04751 Update doc URL references for the DB IDO feature 2019-08-27 16:46:51 +02:00
Michael Friedrich
8d071c8d30 DB IDO: Fix upgrade script for 2.11.0 (drop index only if existing)
fixes #7393
2019-08-05 13:03:38 +02:00
Michael Friedrich
c77d6eb869 Quality: Drop unused boost/tuple header include 2019-05-24 15:50:43 +02:00
Michael Friedrich
8a258de9bc
Merge pull request #6734 from leeclemens/remove-redundant-indexes
db ido: remove redundant mysql indexes
2019-04-29 09:13:22 +02:00
Michael Friedrich
149f640fd8 Improve DB IDO HA failover behaviour
- Decrease Object Authority updates to 10s (was 30s)
- Decrease failover timeout to 30s (was 60s)
- Decrease cold startup (after (re)start) with no OA updates to 30s (was 60s)
- Immediately connect on Resume()
- Fix query priority which got broken with #6970
- Add more logging when a failover is in progress

```
[2019-03-29 16:13:53 +0100] information/IdoMysqlConnection: Last update by endpoint 'master1' was 8.33246s ago (< failover timeout of 30s). Retrying.

[2019-03-29 16:14:23 +0100] information/IdoMysqlConnection: Last update by endpoint 'master1' was 38.3288s ago. Taking over 'ido-mysql' in HA zone 'master'.
```

- Add more logging for reconnect and disconnect handling
- Add 'last_failover' attribute to IDO*Connection objects

refs #6970
2019-04-01 08:50:00 +02:00
Michael Friedrich
e2df11520e
Merge pull request #6970 from Icinga/bugfix/perfdata-gaps
Improve reload handling for features (metric & queue flush, activation priority)
2019-02-26 15:38:15 +01:00
Michael Friedrich
37b715baf1 Replace a few more copyright strings 2019-02-25 16:30:40 +01:00
Michael Friedrich
458f997a18 Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01: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
1bfe756cb1 DB IDO: Improve queue handling on Pause/Shutdown/Reload 2019-02-20 17:10:46 +01:00
Michael Friedrich
c0c6ea545b DB IDO: Don't enqueue queries when the feature is paused (HA)
fixes #5876
refs #6739
2018-10-30 13:17:28 +01:00
Lee Clemens
6418af3f01 dbido: remove redundant mysql indexes 2018-10-26 18:32:21 -04:00
Michael Friedrich
a2cb542a2e icinga.com: Update '*.sql' 2018-10-18 09:41:54 +02:00
Michael Friedrich
dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00