Skip to content

Commit 87eec4c

Browse files
mhashizumegithub-actions[bot]
authored andcommitted
Clarify soft limit on number of facts
Puppet warns when the total number of fact values exceeds a soft limit, as PuppetDB performance can start to degrade as that number grows. However, the language that Puppet currently uses to talk about this limit can be ambiguous. We want to emphasize that the total number of fact values--counting all children of all facts (every value in all arrays, hashes, etc.)--is what is relevant to performance. This commit adds more explicit language about what this number is counting. (cherry picked from commit f7dfc72)
1 parent 3e6ed12 commit 87eec4c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/puppet/configurer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def convert_catalog(result, duration, facts, options = {})
130130
end
131131

132132
def warn_number_of_facts(size, max_number)
133-
Puppet.warning _("The current total number of facts: %{size} exceeds the number of facts limit: %{max_size}") % { size: size, max_size: max_number }
133+
Puppet.warning _("The current total number of fact values: %{size} exceeds the fact values limit: %{max_size}") % { size: size, max_size: max_number }
134134
end
135135

136136
def warn_fact_name_length(name, max_length)

lib/puppet/defaults.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,9 @@ def self.initialize_default_settings!(settings)
17681768
:number_of_facts_soft_limit => {
17691769
:default => 2048,
17701770
:type => :integer,
1771-
:desc => "The soft limit for the total number of facts.",
1771+
:desc => "The soft limit for the total number of fact values. This counts the
1772+
child elements of all facts (e.g. all items of an array or a hash), not just top
1773+
level facts.",
17721774
},
17731775
:payload_soft_limit => {
17741776
:default => 16 * 1024 * 1024,

spec/unit/configurer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
}
269269
Puppet::Node::Facts.indirection.save(facts)
270270

271-
expect(Puppet).to receive(:warning).with(/The current total number of facts: [1-9]* exceeds the number of facts limit: [1-9]*/)
271+
expect(Puppet).to receive(:warning).with(/The current total number of fact values: [1-9]* exceeds the fact values limit: [1-9]*/)
272272
configurer.run
273273
end
274274

0 commit comments

Comments
 (0)