Replies: 0 comments 3 replies
-
This commonly occurs with resources like Even though 2712 bytes is a hard limit at which Postgres will refuse to store an entire catalog or report, we may want the test to fail at a much lower value. Each index stores a separate copy of the data and A test that flags resource titles longer than 255 characters may be reasonable. |
Beta Was this translation helpful? Give feedback.
-
From a content perspective, a limit on resource titles in Puppet DB means a limit on resource titles everywhere, as this would otherwise randomly break content as it moves from one use-case to the next. Shouldn't this then become a basic restriction to be enforced at compile time? Especially as |
Beta Was this translation helpful? Give feedback.
-
Enforcing the restriction in Puppet would be a breaking change and so wouldn't take effect until Puppet 8. A test in PDK can be applied to code that runs on older versions. Enforcing a shorter limit, like 255 characters, is also more suited to a test or lint check as these allow for resources to be exempted when needed. |
Beta Was this translation helpful? Give feedback.
-
When PuppetDB stores catalog data in Postgres, it encounters database constraints that may not be present in other parts of the system. A common constraint is that any value inserted into an indexed column must be less than a certain length:
https://www.postgresql.org/docs/11/btree-intro.html
Database pages are nearly always left at the default 8912 bytes long, which means the constraint comes out to 2712 bytes. Long resource titles frequently trigger this constraint as they are covered by many indexes.
A typical error looks like:
These errors are often not visible to puppet module developers as they occur long after the code has been written, tested, and then deployed. The PDK can help developers catch this issue early when writing code by providing a unit test that checks resource title lengths.
Beta Was this translation helpful? Give feedback.
All reactions