Skip to content

Commit f7dfc72

Browse files
committed
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.
1 parent 267684a commit f7dfc72

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
@@ -132,7 +132,7 @@ def convert_catalog(result, duration, facts, options = {})
132132
end
133133

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

138138
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
@@ -1805,7 +1805,9 @@ def self.initialize_default_settings!(settings)
18051805
:number_of_facts_soft_limit => {
18061806
:default => 2048,
18071807
:type => :integer,
1808-
:desc => "The soft limit for the total number of facts.",
1808+
:desc => "The soft limit for the total number of fact values. This counts the
1809+
child elements of all facts (e.g. all items of an array or a hash), not just top
1810+
level facts.",
18091811
},
18101812
:payload_soft_limit => {
18111813
: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)