From a1a815478bee19c1525e24b17dc51fe601801d63 Mon Sep 17 00:00:00 2001 From: Yogesh Gaikwad <902768+bizybot@users.noreply.github.com> Date: Fri, 2 Aug 2019 09:29:46 +1000 Subject: [PATCH] Do not use scroll when finding duplicate API key (#45026) 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. --- .../org/elasticsearch/xpack/security/authc/ApiKeyService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java index 76943843c77f9..a6050ea4d7de2 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java @@ -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)