-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema: Enlarge Command Argument and Environment Key
From the beginning, the Icinga DB's schema allowed 64 characters for both the command arguments and environment variable names[0]. In particular, this affects CheckCommand, EventCommand and NotificationCommand 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[1], 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: > object CheckCommand "icingadb-i791" { > import "plugin-check-command" > command = [ "/bin/true" ] > env = { > "THAT_ARE_64_AS_WOW_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" = "huhu" > } > arguments = { > "java.class.that.was.used.as.an.argument.that.was.eighty.seven.characters.long.and.broke" = { > value = "F" > } > } > } Another thing was a type difference between the MySQL and PostgreSQL schemas. While the MySQL schema defined argument_key_override as varchar(64), in PostgreSQL it was a citext. So it was changed to varchar(255) in MySQL and kept as it was in PostgreSQL. Closes #791. [0]: 05d5e97 [1]: #791 (comment)
- Loading branch information
Showing
4 changed files
with
34 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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