Gehel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/367668 )

Change subject: Add script.max_compilations_per_minute to elasticsearch
......................................................................


Add script.max_compilations_per_minute to elasticsearch

Allows to customize the number of compilations per minute.
Workaround a limitation of the ltr plugin.

Bug: T171579
Change-Id: I927b0dec0ad2909335f8829d3a09f308000ca7ab
---
M modules/elasticsearch/manifests/init.pp
M modules/elasticsearch/templates/elasticsearch_5.yml.erb
M modules/profile/manifests/elasticsearch.pp
3 files changed, 33 insertions(+), 21 deletions(-)

Approvals:
  jenkins-bot: Verified
  DCausse: Looks good to me, but someone else must approve
  Gehel: Looks good to me, approved



diff --git a/modules/elasticsearch/manifests/init.pp 
b/modules/elasticsearch/manifests/init.pp
index 9b5e328..bc7571e 100644
--- a/modules/elasticsearch/manifests/init.pp
+++ b/modules/elasticsearch/manifests/init.pp
@@ -76,6 +76,8 @@
 #        host and port combinations (e.g. otherhost:9243, another:9243,
 #        127.0.10.*:9243, localhost:*). Scheme is ignored by the whitelist - 
only host
 #        and port are used. Defaults to undef, which means no remote reindex 
can occur.
+# - $script_max_compilations_per_minute: integer, max number of script
+#        compilations per minute, defaults to undef (see T171579).
 #
 # == Sample usage:
 #
@@ -114,6 +116,7 @@
     $search_shard_count_limit = 1000,
     $curator_uses_unicast_hosts = true,
     $reindex_remote_whitelist = undef,
+    $script_max_compilations_per_minute = undef,
 ) {
 
     # Check arguments
@@ -128,6 +131,10 @@
 
     validate_bool($gc_log)
 
+    if $script_max_compilations_per_minute != undef and 
$script_max_compilations_per_minute < 0 {
+        fail('script_max_compilations_per_minute should be > 0')
+    }
+
     # if no graylog_host is given, do not send logs
     $send_logs_to_logstash = is_array($graylog_hosts)
 
diff --git a/modules/elasticsearch/templates/elasticsearch_5.yml.erb 
b/modules/elasticsearch/templates/elasticsearch_5.yml.erb
index b81932a..971cdd7 100644
--- a/modules/elasticsearch/templates/elasticsearch_5.yml.erb
+++ b/modules/elasticsearch/templates/elasticsearch_5.yml.erb
@@ -438,3 +438,7 @@
 # Hosts allowed as data sources for reindexing
 reindex.remote.whitelist: "<%= @reindex_remote_whitelist %>"
 <% end %>
+
+<% if @script_max_compilations_per_minute %>
+script.max_compilations_per_minute: <%=script_max_compilations_per_minute%>
+<% end %>
diff --git a/modules/profile/manifests/elasticsearch.pp 
b/modules/profile/manifests/elasticsearch.pp
index 7ace2d5..54ae82f 100644
--- a/modules/profile/manifests/elasticsearch.pp
+++ b/modules/profile/manifests/elasticsearch.pp
@@ -62,39 +62,40 @@
 
     # Install
     class { '::elasticsearch':
-        require                    => [
+        require                            => [
             Package['elasticsearch/plugins'],
             File['/usr/share/elasticsearch/plugins'],
         ],
         # Production elasticsearch needs these plugins to be loaded in order
         # to work properly.  This will keep elasticsearch from starting
         # if these plugins are  not available.
-        plugins_mandatory          => [
+        plugins_mandatory                  => [
             'experimental-highlighter',
             'extra',
             'analysis-icu',
         ],
-        plugins_dir                => $plugins_dir,
+        plugins_dir                        => $plugins_dir,
         # Let apifeatureusage create their indices
-        auto_create_index          => '+apifeatureusage-*,-*',
+        auto_create_index                  => '+apifeatureusage-*,-*',
         # Production can get a lot of use out of the filter cache.
-        filter_cache_size          => '20%',
-        bulk_thread_pool_executors => $bulk_thread_pool_executors,
-        bulk_thread_pool_capacity  => 1000,
-        rack                       => $rack,
-        row                        => $row,
-        awareness_attributes       => $awareness_attributes,
-        cluster_name               => $cluster_name,
-        unicast_hosts              => $unicast_hosts,
-        minimum_master_nodes       => $minimum_master_nodes,
-        recover_after_time         => $recover_after_time,
-        recover_after_nodes        => $recover_after_nodes,
-        heap_memory                => $heap_memory,
-        expected_nodes             => $expected_nodes,
-        master_eligible            => $master_eligible,
-        graylog_hosts              => $graylog_hosts,
-        version                    => 5,
-        reindex_remote_whitelist   => $reindex_remote_whitelist,
+        filter_cache_size                  => '20%',
+        bulk_thread_pool_executors         => $bulk_thread_pool_executors,
+        bulk_thread_pool_capacity          => 1000,
+        rack                               => $rack,
+        row                                => $row,
+        awareness_attributes               => $awareness_attributes,
+        cluster_name                       => $cluster_name,
+        unicast_hosts                      => $unicast_hosts,
+        minimum_master_nodes               => $minimum_master_nodes,
+        recover_after_time                 => $recover_after_time,
+        recover_after_nodes                => $recover_after_nodes,
+        heap_memory                        => $heap_memory,
+        expected_nodes                     => $expected_nodes,
+        master_eligible                    => $master_eligible,
+        graylog_hosts                      => $graylog_hosts,
+        version                            => 5,
+        reindex_remote_whitelist           => $reindex_remote_whitelist,
+        script_max_compilations_per_minute => 10000,
     }
 
     class { '::elasticsearch::https':

-- 
To view, visit https://gerrit.wikimedia.org/r/367668
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I927b0dec0ad2909335f8829d3a09f308000ca7ab
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: DCausse <[email protected]>
Gerrit-Reviewer: DCausse <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to