Skip to content
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

Do not use scroll when finding duplicate API key #45026

Conversation

bizybot
Copy link
Contributor

@bizybot bizybot commented Jul 31, 2019

When we create API key we check if the API key with the name
already exists. It searches with scroll enabled and this causes
the request to fail when creating a large number of API keys in
parallel as it hits the number of open scroll limit (default 500).
We do not need the search context to be created so this commit
removes the scroll parameter from the search request done for
a duplicate API key check.
Manual testing is done by creating 100K API keys (100 threads running in parallel)

When we create API key we check if the API key with the name
already exists. It searches with scroll enabled and this causes
the request to fail when creating large number of API keys in
parallel as it hits the number of open scroll limit (default 500).
We do not need the search context to be created so this commit
removes the scroll parameter from the search request for duplicate
API key.
@bizybot bizybot added >bug :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) v8.0.0 v7.4.0 labels Jul 31, 2019
@bizybot bizybot requested review from tvernum and jkakavas July 31, 2019 04:01
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security

@bizybot
Copy link
Contributor Author

bizybot commented Jul 31, 2019

@elasticmachine run elasticsearch-ci/packaging-sample

Copy link
Member

@jkakavas jkakavas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tvernum
Copy link
Contributor

tvernum commented Aug 1, 2019

Since this is a bug, can we backport to 7.3.1 too ?

@bizybot bizybot added the v7.3.1 label Aug 1, 2019
@bizybot bizybot merged commit e765a00 into elastic:master Aug 1, 2019
bizybot added a commit that referenced this pull request Aug 2, 2019
When we create API key we check if the API key with the name
already exists. It searches with scroll enabled and this causes
the request to fail when creating large number of API keys in
parallel as it hits the number of open scroll limit (default 500).
We do not need the search context to be created so this commit
removes the scroll parameter from the search request for duplicate
API key.
bizybot added a commit that referenced this pull request Aug 2, 2019
When we create API key we check if the API key with the name
already exists. It searches with scroll enabled and this causes
the request to fail when creating large number of API keys in
parallel as it hits the number of open scroll limit (default 500).
We do not need the search context to be created so this commit
removes the scroll parameter from the search request for duplicate
API key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) v7.3.1 v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants