From 53293792066aa7e5a0951d0be04fee94fc93cf0c Mon Sep 17 00:00:00 2001 From: Remi Dettai Date: Thu, 28 Nov 2024 17:41:28 +0100 Subject: [PATCH] Return 429 on ES API when no shards available (#5566) --- quickwit/quickwit-serve/src/elasticsearch_api/bulk_v2.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/quickwit/quickwit-serve/src/elasticsearch_api/bulk_v2.rs b/quickwit/quickwit-serve/src/elasticsearch_api/bulk_v2.rs index d6578c699bc..3a142b82b2e 100644 --- a/quickwit/quickwit-serve/src/elasticsearch_api/bulk_v2.rs +++ b/quickwit/quickwit-serve/src/elasticsearch_api/bulk_v2.rs @@ -273,6 +273,11 @@ fn make_elastic_bulk_response_v2( format!("shard rate limiting [{}]", failure.index_id), StatusCode::TOO_MANY_REQUESTS, ), + IngestFailureReason::NoShardsAvailable => ( + ElasticException::RateLimited, + format!("no shards available [{}]", failure.index_id), + StatusCode::TOO_MANY_REQUESTS, + ), reason => { let pretty_reason = reason .as_str_name()