Skip to content

icingadb-migrate: Mitigate NULL names in {comment,downtime}_query#767

Merged
julianbrost merged 1 commit intomainfrom
icingadb-migrate-null-name-i766
Jul 31, 2024
Merged

icingadb-migrate: Mitigate NULL names in {comment,downtime}_query#767
julianbrost merged 1 commit intomainfrom
icingadb-migrate-null-name-i766

Conversation

@oxzi
Copy link
Copy Markdown
Member

@oxzi oxzi commented Jul 9, 2024

Historical data from an older Icinga 2 installation contained NULL values for the name column in some rows of the icinga_commenthistory and icinga_downtimehistory tables.

Normally this field contains something like
${name1}!${name2}!${unique_value} where the $unique_value is based on a timestamp for older entries and a UUID for newer ones. For a concrete example, this could be "host.example.com!ping6!123…".

Unfortunately, using an empty string for these NULL values will cause an error later because the new primary key will be calculated based on it. Therefore, a new deterministic name is generated based on the primary keys and the known name1 and name2 values.

Closes #766.

Historical data from an older Icinga 2 installation contained NULL
values for the name column in some rows of the icinga_commenthistory and
icinga_downtimehistory tables.

Normally this field contains something like
${name1}!${name2}!${unique_value} where the $unique_value is based on a
timestamp for older entries and a UUID for newer ones. For a concrete
example, this could be "host.example.com!ping6!123…".

Unfortunately, using an empty string for these NULL values will cause an
error later because the new primary key will be calculated based on it.
Therefore, a new deterministic name is generated based on the primary
keys and the known name1 and name2 values.

Closes #766.
@oxzi oxzi requested a review from Al2Klimov July 24, 2024 09:25
@oxzi oxzi added this to the 1.2.1 milestone Jul 30, 2024
@julianbrost julianbrost merged commit 9946fa5 into main Jul 31, 2024
@julianbrost julianbrost deleted the icingadb-migrate-null-name-i766 branch July 31, 2024 08:29
@oxzi oxzi added the area/migrate cmd/icingadb-migrate label Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/migrate cmd/icingadb-migrate bug Something isn't working cla/signed crash

Projects

None yet

Development

Successfully merging this pull request may close these issues.

icingadb-migrate fails with '"name": converting NULL to string is unsupported'

3 participants