Skip to content

Commit

Permalink
Do not use scroll when finding duplicate API key (elastic#45026)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bizybot authored Aug 1, 2019
1 parent 6d7b232 commit e765a00
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ private void checkDuplicateApiKeyNameAndCreateApiKey(Authentication authenticati
boolQuery.filter(expiredQuery);

final SearchRequest searchRequest = client.prepareSearch(SECURITY_MAIN_ALIAS)
.setScroll(DEFAULT_KEEPALIVE_SETTING.get(settings))
.setQuery(boolQuery)
.setVersion(false)
.setSize(1)
Expand Down

0 comments on commit e765a00

Please sign in to comment.