Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

oxzi
Copy link
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
31 checks passed
@julianbrost julianbrost deleted the icingadb-migrate-null-name-i766 branch July 31, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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