Skip to content

Scripting: Deprecate general cache settings #55038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
feaab71
Scripting: Deprecate general cache settings
stu-elastic Apr 2, 2020
1542a26
Add script.disable_max_compilations_rate setting
stu-elastic Apr 9, 2020
260cea3
Merge branch 'master' of github.com:elastic/elasticsearch into fix/50…
stu-elastic Apr 9, 2020
d586a34
Move construction to ScriptCache
stu-elastic Apr 9, 2020
601c587
Merge branch 'master' of github.com:elastic/elasticsearch into fix/50…
stu-elastic Apr 9, 2020
dabdcb4
Merge branch 'master' of github.com:elastic/elasticsearch into fix/50…
stu-elastic Apr 9, 2020
816047a
Use ScriptService to do updates of CacheHolder
stu-elastic Apr 9, 2020
2a82476
Remove fallbacks
stu-elastic Apr 9, 2020
16888fb
Add SCRIPT_DISABLE_MAX_COMPILATIONS_RATE_SETTING to ClusterSettings
stu-elastic Apr 10, 2020
76ebe3a
Node scope
stu-elastic Apr 10, 2020
8c2e723
Use back compat
stu-elastic Apr 10, 2020
98b6bb4
8.0 for bwc
stu-elastic Apr 10, 2020
b6497e5
script.max_compilations_rate=2048/1m -> script.disable_max_compilatio…
stu-elastic Apr 14, 2020
2373a6b
do not guard in esnode
stu-elastic Apr 14, 2020
e143617
Doc update
stu-elastic Apr 14, 2020
b61dd06
isSnapshotBuild() -> systemProperty 'es.script.disable_max_compilatio…
stu-elastic Apr 14, 2020
5807716
Do not use snapshot in gradle to set max_compilations_rate
stu-elastic Apr 20, 2020
4532e51
Merge branch 'master' of github.com:elastic/elasticsearch into fix/50…
stu-elastic Apr 20, 2020
36eff06
Expose cacheHolder as package private
stu-elastic Apr 21, 2020
760fdb7
monospace 75/5m in cbreaker docs, single space in using
stu-elastic Apr 21, 2020
5d2c9ea
More detail in general compilation rate error
stu-elastic Apr 21, 2020
bb2fdba
Test: don't modify defaultConfig on upgrade
stu-elastic Apr 21, 2020
6ceb923
Merge 58ec9c3
stu-elastic Apr 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,11 @@ private void createConfiguration() {
baseConfig.put("cluster.routing.allocation.disk.watermark.low", "1b");
baseConfig.put("cluster.routing.allocation.disk.watermark.high", "1b");
// increase script compilation limit since tests can rapid-fire script compilations
baseConfig.put("script.max_compilations_rate", "2048/1m");
if (getVersion().getMajor() >= 8) {
baseConfig.put("script.disable_max_compilations_rate", "true");
} else {
baseConfig.put("script.max_compilations_rate", "2048/1m");
}
if (getVersion().getMajor() >= 6) {
baseConfig.put("cluster.routing.allocation.disk.watermark.flood_stage", "1b");
}
Expand Down
4 changes: 0 additions & 4 deletions distribution/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
- xpack.security.enabled=true
- xpack.security.transport.ssl.enabled=true
Expand Down Expand Up @@ -64,7 +63,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
- xpack.security.enabled=true
- xpack.security.transport.ssl.enabled=true
Expand Down Expand Up @@ -113,7 +111,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
volumes:
- ./build/oss-repo:/tmp/es-repo
Expand Down Expand Up @@ -147,7 +144,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
volumes:
- ./build/oss-repo:/tmp/es-repo
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/modules/indices/circuit_breaker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ within a period of time.
See the "prefer-parameters" section of the <<modules-scripting-using,scripting>>
documentation for more information.

`script.max_compilations_rate`::
`script.context.$CONTEXT.max_compilations_rate`::

Limit for the number of unique dynamic scripts within a certain interval
that are allowed to be compiled. Defaults to 75/5m, meaning 75 every 5
minutes.
that are allowed to be compiled for a given context. Defaults to `75/5m`,
meaning 75 every 5 minutes.
8 changes: 5 additions & 3 deletions docs/reference/scripting/using.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ second version is only compiled once.

If you compile too many unique scripts within a small amount of time,
Elasticsearch will reject the new dynamic scripts with a
`circuit_breaking_exception` error. By default, up to 15 inline scripts per
minute will be compiled. You can change this setting dynamically by setting
`script.max_compilations_rate`.
`circuit_breaking_exception` error. By default, up to 75 scripts per
5 minutes will be compiled for most contexts and 375 scripts per 5 minutes
for ingest contexts. You can change these settings dynamically by setting
`script.context.$CONTEXT.max_compilations_rate` eg.
`script.context.field.max_compilations_rate=100/10m`.

========================================

Expand Down
2 changes: 0 additions & 2 deletions qa/remote-clusters/docker-compose-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
volumes:
- ./build/oss-repo:/tmp/es-repo
Expand Down Expand Up @@ -50,7 +49,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
volumes:
- ./build/oss-repo:/tmp/es-repo
Expand Down
2 changes: 0 additions & 2 deletions qa/remote-clusters/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
- xpack.security.enabled=true
- xpack.security.transport.ssl.enabled=true
Expand Down Expand Up @@ -65,7 +64,6 @@ services:
- cluster.routing.allocation.disk.watermark.low=1b
- cluster.routing.allocation.disk.watermark.high=1b
- cluster.routing.allocation.disk.watermark.flood_stage=1b
- script.max_compilations_rate=2048/1m
- node.store.allow_mmap=false
- xpack.security.enabled=true
- xpack.security.transport.ssl.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ public void apply(Settings value, Settings current, Settings previous) {
ScriptService.SCRIPT_GENERAL_MAX_COMPILATIONS_RATE_SETTING,
ScriptService.SCRIPT_CACHE_SIZE_SETTING,
ScriptService.SCRIPT_CACHE_EXPIRE_SETTING,
ScriptService.SCRIPT_DISABLE_MAX_COMPILATIONS_RATE_SETTING,
ScriptService.SCRIPT_MAX_COMPILATIONS_RATE_SETTING,
ScriptService.SCRIPT_MAX_SIZE_IN_BYTES,
ScriptService.TYPES_ALLOWED_SETTING,
Expand Down
Loading