icingadb-migrate: Mitigate NULL names in {comment,downtime}_query#767
Merged
julianbrost merged 1 commit intomainfrom Jul 31, 2024
Merged
icingadb-migrate: Mitigate NULL names in {comment,downtime}_query#767julianbrost merged 1 commit intomainfrom
julianbrost merged 1 commit intomainfrom
Conversation
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.
Al2Klimov
reviewed
Jul 9, 2024
Al2Klimov
approved these changes
Jul 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.