From 226dcdde0f6e38ca48b626ee1f5880096f3d2c96 Mon Sep 17 00:00:00 2001 From: Matias Chomicki Date: Fri, 25 Oct 2024 10:53:03 +0200 Subject: [PATCH] Query splitting: limit retries (#95364) --- public/app/plugins/datasource/loki/querySplitting.ts | 2 +- public/app/plugins/datasource/loki/shardQuerySplitting.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/loki/querySplitting.ts b/public/app/plugins/datasource/loki/querySplitting.ts index acd0458ca1e..262b8708289 100644 --- a/public/app/plugins/datasource/loki/querySplitting.ts +++ b/public/app/plugins/datasource/loki/querySplitting.ts @@ -128,7 +128,7 @@ export function runSplitGroupedQueries(datasource: LokiDatasource, requests: Lok const key = `${requestN}-${requestGroup}`; const retries = retriesMap.get(key) ?? 0; - if (retries > 3) { + if (retries > 0) { return false; } diff --git a/public/app/plugins/datasource/loki/shardQuerySplitting.ts b/public/app/plugins/datasource/loki/shardQuerySplitting.ts index d1b74e9de67..dfb201fdf6c 100644 --- a/public/app/plugins/datasource/loki/shardQuerySplitting.ts +++ b/public/app/plugins/datasource/loki/shardQuerySplitting.ts @@ -40,7 +40,7 @@ import { LokiQuery } from './types'; * . nextRequest() will use the current cycle and group size to determine the next request or complete execution with done(). * - If the response is unsuccessful: * . If the response is not a query error, and the group size bigger than 1, it will decrease the group size. - * . If the group size is already 1, it will retry the request up to 4 times. + * . If the group size is already 1, it will retry the request up to 2 times. * . If there are retry attempts, it will retry the current cycle, or else stop querying. * - Once all request groups have been executed, it will be done(). */ @@ -122,7 +122,7 @@ function splitQueriesByStreamShard( const key = `${group}_${cycle}`; const retries = retriesMap.get(key) ?? 0; - if (retries > 3) { + if (retries > 1) { shouldStop = true; return false; }