12863 Commits

Author SHA1 Message Date
Julian Brost
9b2f95d6d2 InfluxdbCommonWriter: use atomic_size_t to data buffer size from stats function
m_DataBuffer may be modified concurrently while StatsFunc() is called, thus
it's unsafe to call size() on it. As write access to m_DataBuffer is already
synchronized by only modifying it from the single work queue thread, instead of
adding a mutex, this commit adds a new std::atomic_size_t which is additionally
updated when modifying m_DataBuffer and can safely be accessed in StatsFunc().
2022-02-21 15:11:56 +01:00
Julian Brost
6b69235e15 InfluxdbCommonWriter: only flush from work queue
There is no explicit synchronization of access to m_DataBuffer which is fine if
it is only accessed from the single-threaded work queue. However, Stop() also
called Flush() in another thread, leading to concurrent write access to
m_DataBuffer which can result in a crash due to use after free/double free.

Changes in this commit:
* Flush() is renamed to FlushWQ() to show that it should only be called from
  the work queue. Additionally, it now asserts that it is running on the work
  queue.
* Visibility of some data members is changed from protected to private. No
  other classes have to access these at the moment. By this change, accidental
  concurrent access from derived classes in the future is prevented.
* Stop() now flushes by posting FlushWQ() to the work queue and joining it.
2022-02-21 15:11:56 +01:00
Alexander Aleksandrovič Klimov
d2c90ad66e
Merge pull request #9231 from Icinga/bugfix/gha-drop-centos8-2.13
GHA: drop CentOS 8
2022-02-21 14:04:42 +01:00
Alexander Aleksandrovič Klimov
3be3426238 GHA: drop CentOS 8
It's EOL.
2022-02-18 16:06:31 +01:00
Julian Brost
3b15ae532c
Merge pull request #9217 from Icinga/feature/installation-instructions
Update installation instructions for easier navigation on icinga.com
2022-02-16 12:24:33 +01:00
Blerim Sheqa
659dfc0c52 Update installation instructions for easier navigation on icinga.com 2022-02-16 10:29:27 +01:00
Julian Brost
af94ed58dc
Merge pull request #9157 from Icinga/bugfix/downtime-trigger-time-2.13
Set downtime trigger time deterministically
2022-01-21 18:06:29 +01:00
Julian Brost
cd2ae9a886
Merge pull request #9182 from Icinga/bugfix/icinga-db-notification-history-might-use-incorrect-previous_hard_state-9132-213
IcingaDB#SendSentNotification(): make stream deterministic via CheckResult#previous_hard_state
2022-01-21 18:05:49 +01:00
Julian Brost
b11ac709d1
Merge pull request #9181 from Icinga/bugfix/icingadb-cmd-arg-order-int-213
Icinga DB: ensure icinga:*command:argument#order is an int
2022-01-21 18:05:28 +01:00
Julian Brost
4616804be7
Merge pull request #9158 from Icinga/bugfix/dont-trigger-fixed-downtime-as-flexible-2.13
Don't trigger a fixed downtime like a flexible one
2022-01-21 18:03:48 +01:00
Julian Brost
2741491ee8
Merge pull request #9159 from Icinga/bugfix/downtime-all-services-on-child-hosts-2.13
Fix scheduling of downtimes for all services on child hosts
2022-01-21 18:03:04 +01:00
Alexander A. Klimov
2e7fe4da95 IcingaDB#SendSentNotification(): make stream deterministic via CheckResult#previous_hard_state
Now it gets everything from one source, the CheckResult.

refs #9132
2022-01-20 11:27:19 +01:00
Alexander A. Klimov
50e3e31e04 Icinga DB: ensure icinga:*command:argument#order is an int
The config parser requires *Command#arguments#order to be a Number, i.e. 42,
4.2 or even "4.2". That's int-casted where needed, now also for Icinga DB.

Before:

```
object CheckCommand "9117" {
	command = [ "true" ]
	arguments = {
		"4.2" = { order = "4.2" }
	}
}
```

2022-01-03T13:25:07.166+0100	FATAL	icingadb	json: cannot unmarshal string into Go value of type int64
2022-01-20 11:17:22 +01:00
Julian Brost
28de8bd4ad
Merge pull request #9124 from Icinga/bugfix/icinga2-crashes-when-sending-notifications-8186
Avoid "type" key in dicts being part of object state attrs
2022-01-19 15:48:17 +01:00
Alexander Aleksandrovič Klimov
d416aa97ed
Merge pull request #9176 from Icinga/feature/github-actions-windows-preinstalled-deps-2.13
GitHub Actions: Use preinstalled dependencies on Windows (2.13)
2022-01-17 12:19:16 +01:00
Julian Brost
9aca722f5e GitHub Actions: Use preinstalled dependencies on Windows
The Windows image provided by GitHub already includes most of our dependencies,
so the installation of all Chocolatey packages except winflexbison3 was
redundant. Visual Studio is provided in the Enterprise version instead of
Community, so that has to be added to the search path as well.
2022-01-14 14:04:19 +01:00
Alexander Aleksandrovič Klimov
1f0f174df1
Merge pull request #9169 from Icinga/bugfix/gha-windows-throwonnativefailure-2.13
doc/win-dev.ps1: actually utilize ThrowOnNativeFailure
2022-01-10 17:55:06 +01:00
Alexander A. Klimov
7fc5dcf6dc doc/win-dev.ps1: actually utilize ThrowOnNativeFailure
refs #8935
2022-01-10 14:28:47 +01:00
Julian Brost
f9e371e109
Merge pull request #9139 from Icinga/bugfix/mysql-schema-versions-2.13
Make MySQL schema version in full schema file and upgrade files consistent (2.13)
2022-01-10 09:54:50 +01:00
Julian Brost
0a93beaa29
Merge pull request #9164 from Icinga/feature/gha2133
Update GHA
2022-01-05 18:30:05 +01:00
Julian Brost
2d7b9acc88
Merge pull request #9155 from Icinga/bugfix/git-describe-escapes-to-parent-dirs-2.13
third-party: update GetGitRevisionDescription CMake module
2022-01-05 18:11:44 +01:00
Alexander Aleksandrovič Klimov
d0b0256fc0 GHA: drop SUSE 15.2 and add 15.3 2022-01-05 13:15:01 +01:00
Alexander Aleksandrovič Klimov
bd6752161d GHA: Add Ubuntu impish 2022-01-05 13:15:01 +01:00
Alexander Aleksandrovič Klimov
fb31d0f7d8 GHA: add Raspbian bullseye 2022-01-05 13:15:01 +01:00
Alexander Aleksandrovič Klimov
025aad890f Put -latomic to the other -ls
to make it compiling on Raspberry Pi OS bullseye.
2022-01-05 13:15:01 +01:00
Alexander A. Klimov
c5c2d20995 GHA: Raspbian: install more recent QEMU
to workaround "semop(1): encountered an error: Function not implemented".
2022-01-05 13:15:01 +01:00
Alexander Aleksandrovič Klimov
0ee074ab24 GHA: add Fedora 35 2022-01-04 18:57:12 +01:00
Alexander Aleksandrovič Klimov
68133b87d2 GHA: drop Fedora 33
It's EOL.
2022-01-04 18:57:12 +01:00
Alexander A. Klimov
e9e555468d Handle "type" key in dicts being part of object state attrs
i.e. the confusion of the state file deserializator with e.g. `"type":32` on startup.
That would unexpectedly restore (the now ignored) null (not `{"type":32}`) as there's no type "32".

refs #8186
2022-01-04 17:17:20 +01:00
Julian Brost
a07a749e92 Document which other downtimes are deleted by /v1/actions/remove-downtime 2022-01-03 18:47:32 +01:00
Julian Brost
754943c15f Prevent duplicate donwtimes when combining child_options and all_services 2022-01-03 18:47:32 +01:00
Julian Brost
2de9904676 Fix scheduling of downtimes for all services on child hosts
The loop iterated over the services of the wrong host resulting in duplicate
downtimes scheduled for services of the parent host instead of downtimes for
services of the child host.
2022-01-03 18:47:32 +01:00
Julian Brost
8937daac74 Don't trigger a fixed downtime like a flexible one
When creating a fixed downtime that starts immediately while the checkable is
in a non-OK state, previously the code path for flexible downtimes was used to
trigger this downtime. This is fixed by this commit which resolves two issued:

1. Missing downtime start notification: notifications work differently for
   fixed and flexible downtimes. This resulted in missing downtime start
   notifications under the conditions described above.
2. Incorrect downtime trigger time: this code path would incorrectly assume the
   timestamp of the last checkable as the trigger time which is incorrect for
   fixed downtimes.
2022-01-03 18:45:16 +01:00
Julian Brost
91e120cd28 Set downtime trigger time deterministically
When triggering a downtime, the time of the causing event is now passed on as
the trigger time. That time is:

* For fixed downtimes: the later one of start and entry time.
* If a check result triggers the downtime: The execution end of the check
  result.
* If another downtime triggers the downtime: The trigger time of the first
  downtime.

This is done so two nodes in a HA setup can write consistent Icinga DB downtime
history streams.

refs #9101
2022-01-03 18:42:50 +01:00
Julian Brost
1275a5a245 third-party: update GetGitRevisionDescription CMake module
The new version includes functionality to prevent using version information
from parent directories of the source root directory.

wget -O third-party/cmake/GetGitRevisionDescription.cmake https://raw.githubusercontent.com/rpavlik/cmake-modules/main/GetGitRevisionDescription.cmake
wget -O third-party/cmake/GetGitRevisionDescription.cmake.in https://raw.githubusercontent.com/rpavlik/cmake-modules/main/GetGitRevisionDescription.cmake.in
2022-01-03 18:37:02 +01:00
Alexander Aleksandrovič Klimov
93c1e313bc
Merge pull request #9094 from Icinga/bugfix/non-unity-build-2.13
Add missing include to fix non-unity builds
2021-12-20 10:22:31 +01:00
Julian Brost
1d49e5c405 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. Additionally, the version number in the
full schema is also bumped to the correct version 1.15.1.
2021-12-16 16:01:04 +01:00
Alexander A. Klimov
eb71fb7529 Avoid "type" key in dicts being part of object state attrs
not to confuse the state file deserializator with e.g. `"type":32` on startup.
That would unexpectedly restore null (not `{"type":32}`) as there's no type "32".

refs #8186
2021-12-13 17:56:12 +01:00
Julian Brost
a107792d06 Add missing include to fix non-unity builds
This commit fixes the following build error:

    [ 55%] Building CXX object lib/icinga/CMakeFiles/icinga.dir/usergroup.cpp.o
    lib/icinga/usergroup.cpp:79:24: error: incomplete type ‘icinga::Notification’ used in nested name specifier
       79 | std::set<Notification::Ptr> UserGroup::GetNotifications() const
          |                        ^~~
2021-11-19 13:49:10 +01:00
Noah Hilverling
31c4ba31b8
Merge pull request #9087 from Icinga/feature/2.13.2-changelog-and-version
Add 2.13.2 CHANGELOG and bump version
v2.13.2
2021-11-12 18:34:48 +01:00
Noah Hilverling
dbe546570c
Merge pull request #9089 from Icinga/bugfix/icingadb-runtime-updates-delete-relationships-2.13
Icinga DB: Make sure object relationships are handled correctly during runtime updates
2021-11-12 18:34:26 +01:00
Noah Hilverling
4a9e77f711 Add 2.13.2 CHANGELOG and bump version 2021-11-12 18:14:58 +01:00
Noah Hilverling
950b78d8cd
Merge pull request #9088 from Icinga/bugfix/icingadb-log-queries-debug-level-2.13
Icinga DB: only log queries at debug level
2021-11-12 17:57:48 +01:00
Noah Hilverling
4fd1b153fa IcingaDB::AddObjectDataToRuntimeUpdates(): Copy data before modifying 2021-11-12 17:55:47 +01:00
Noah Hilverling
6ddac83d81 Dictionary: Make sure underlaying map is ordered 2021-11-12 17:55:47 +01:00
Noah Hilverling
2d2b165a79 Icinga DB: Make sure object relationships are handled correctly 2021-11-12 17:55:47 +01:00
Julian Brost
3254ebd0be Icinga DB: only log queries at debug level 2021-11-12 16:37:34 +01:00
Noah Hilverling
73d98cc2ff
Merge pull request #9083 from Icinga/bugfix/icingadb-improve-object-identifier-function-2.13
IcingaDB: Remove GetObjectIdentifiersWithoutEnv()
2021-11-12 13:04:07 +01:00
Noah Hilverling
65a39bfd27
Merge pull request #9085 from Icinga/bugfix/icingadb-prefix-command_id-2.13
IcingaDB: Prefix command_id with command type
2021-11-12 13:03:57 +01:00
Noah Hilverling
b55e924e8b IcingaDB: Prefix command_id with command type 2021-11-12 10:19:18 +01:00