Skip to content

Logn script compilation can bring cluster down #52058

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

Closed
probakowski opened this issue Feb 7, 2020 · 3 comments
Closed

Logn script compilation can bring cluster down #52058

probakowski opened this issue Feb 7, 2020 · 3 comments
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team v7.3.2 v8.0.0-alpha1

Comments

@probakowski
Copy link
Contributor

If you try to use scripted field during search or add scripted field in Kibana index pattern with script that is very hard to compile it can leave long running tasks and finally overcome cluster.
This was confirmed on 7.3 and master, on cloud and local, using script like below:

def field = doc['a'].value;

return
    (field == '1' ? 'a1' :
    field == '2' ? 'a2' :
    field == '3' ? 'a3' :
    field == '4' ? 'a4' :
    field == '5' ? 'a5' :
    field == '6' ? 'a6' :
    field == '7' ? 'a7' :
    field == '8' ? 'a8' :
    field == '9' ? 'a9' :
    field == '10' ? 'a10' :
    field == '11' ? 'a11' :
    field == '12' ? 'a12' :
    field == '13' ? 'a13' :
    field == '14' ? 'a14' :
    field == '15' ? 'a15' :
    field == '16' ? 'a16' :
    field == '17' ? 'a17' :
    field == '18' ? 'a18' :
    field == '19' ? 'a19' :
    field == '20' ? 'a20' :
    field == '21' ? 'a21' :
    field == '22' ? 'a22' :
    field == '23' ? 'a23' :
    field == '24' ? 'a24' :
    field);

This script takes 1h+ to compile and when search using it targets multiple indices there will be a lot of stuck tasks which will make cluster unusable

@probakowski probakowski added the :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache label Feb 7, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Scripting)

@jdconrad
Copy link
Contributor

@probakowski Can this issue be closed with the commit of #52056?

@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@DmitryOlshansky
Copy link

Just hit this hard in production, for now we limited number of clauses we allow our users to specify.
7.7 doesn't have the issue, we are running 7.6.1.

@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@stu-elastic stu-elastic removed the needs:triage Requires assignment of a team area label label Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache Team:Core/Infra Meta label for core/infra team v7.3.2 v8.0.0-alpha1
Projects
None yet
Development

No branches or pull requests

7 participants