schema: Enlarge Command Argument and Environment Key #792
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.
From the beginning, the Icinga DB schema allowed 64 characters for both the command arguments and environment variable names. In particular, this affects
CheckCommand
,EventCommand
andNotificationCommand
Icinga 2 objects.But if a command with either an argument key or an environment variable that is longer than 64 characters was defined in Icinga 2, Icinga DB will try to insert it into the database and may end up crashing. Although it may seem large enough, it is sometimes exceeded.
After evaluating that there was no technical limitation, the limit was increased to 255 characters. This limit was chosen over the wider
text
type as it allows indexes in the future and requires less space.For example, the following
CheckCommand
was not possible before:Another thing was a type difference between the MySQL and PostgreSQL schemas. While the MySQL schema defined
argument_key_override
asvarchar(64)
, in PostgreSQL it was acitext
. So it was changed tovarchar(255)
in MySQL and kept as it was in PostgreSQL.Closes #791.