icinga2 icon indicating copy to clipboard operation
icinga2 copied to clipboard

Icinga DB `state_type` and `is_acknowledged` keys in redis don't match with what's inserted into the DB

Open nilmerg opened this issue 2 years ago • 2 comments

Describe the bug

state_type in redis is a integer instead of 'soft' or 'hard' is_acknowledged is a integer instead of 'y', 'n' or 'sticky'

There may be more cases, didn't check further.

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Version used (icinga2 --version): v2.13.0-369-g73d3323b4

nilmerg avatar Jun 30 '22 09:06 nilmerg

There is a workaround in place at the moment so it’s NOT a production issue.

lippserd avatar Jun 30 '22 15:06 lippserd

This would be an incompatible change to the Redis schema, so what are the options here?

  1. Wait until we want to do another incompatible change and then include it as well.
  2. Include patches in the next releases of icingadb and icingadb-web so that they can handle both integer and string values for these keys but keep icinga2 as-is for now and only change it after it's pretty safe to assume that most users will be on versions that support reading the strings from Redis.

julianbrost avatar Jul 04 '22 07:07 julianbrost

in_downtime is affected as well, it's a boolean, instead of 'y' or 'n'

nilmerg avatar Aug 09 '23 08:08 nilmerg

Is that unexpected? That enum('n', 'y') thing in the database is supposed to represent a boolean after all. You shouldn't find "n" or "y" anywhere in Redis (well, expect if some string attribute is set to that value of course).

julianbrost avatar Aug 09 '23 08:08 julianbrost

The problem with this is, if we apply redis results to database results, it performs an unexpected transformation. In Web's view, the types returned by either source should be identical.

nilmerg avatar Aug 09 '23 09:08 nilmerg