| The "Total number of facts exceeds" warning generated from https://github.com/puppetlabs/puppet/blob/main/lib/puppet/configurer.rb#L190 seems to incorrectly count the total number of facts. A fact which returns a Hash containing hashes (Hash[String, Hash]) will result in each hash entry being counted. A fact which returns an Array of Hashes, say (Array[Hash[String, Scalar]), will result in each element in the array being counted. However, an array consisting of scalar entries (Array[Scalar]) will only count as one fact entry. This behavior seems inconsistent, a bit confusing and nowhere have I found clear documentation on exactly what should count toward the maximum fact count nor the optimal data structure to use if we just can't avoid returning a very large number of structured elements (e.g. is it an Array[Hash], a Hash[String, Hash], something else? or maybe there is no significant difference?) If the fact check is either overcounting (Hashes in Arrays) or undercounting (Scalars in Arrays) then it should be corrected. If the current behavior is correct then it would be great to get some documentation on what is "good" and what is "bad" for very large facts. Thanks! |