From 4a68f8a2944547d70f4cea0e670072acd181bfec Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Wed, 26 Jul 2023 15:12:20 -0700 Subject: [PATCH] Fix maxCompletedTasks parameter in OverlordClientImpl. (#14667) It was sent to the server as "maxCompletedTasks", but the server expects "max". This caused it to be ignored. This bug was introduced in #14581. --- .../org/apache/druid/rpc/indexing/OverlordClientImpl.java | 2 +- .../org/apache/druid/rpc/indexing/OverlordClientImplTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java b/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java index dcfe0b2c589..306c909e404 100644 --- a/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java +++ b/server/src/main/java/org/apache/druid/rpc/indexing/OverlordClientImpl.java @@ -147,7 +147,7 @@ public class OverlordClientImpl implements OverlordClient } if (maxCompletedTasks != null) { - pathBuilder.append(params == 0 ? '?' : '&').append("maxCompletedTasks=").append(maxCompletedTasks); + pathBuilder.append(params == 0 ? '?' : '&').append("max=").append(maxCompletedTasks); } return FutureUtils.transform( diff --git a/server/src/test/java/org/apache/druid/rpc/indexing/OverlordClientImplTest.java b/server/src/test/java/org/apache/druid/rpc/indexing/OverlordClientImplTest.java index 2d89bded802..7e747956a1a 100644 --- a/server/src/test/java/org/apache/druid/rpc/indexing/OverlordClientImplTest.java +++ b/server/src/test/java/org/apache/druid/rpc/indexing/OverlordClientImplTest.java @@ -184,7 +184,7 @@ public class OverlordClientImplTest serviceClient.expectAndRespond( new RequestBuilder( HttpMethod.GET, - "/druid/indexer/v1/tasks?state=RUNNING&datasource=foo%3F&maxCompletedTasks=0" + "/druid/indexer/v1/tasks?state=RUNNING&datasource=foo%3F&max=0" ), HttpResponseStatus.OK, ImmutableMap.of(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON), @@ -203,7 +203,7 @@ public class OverlordClientImplTest serviceClient.expectAndRespond( new RequestBuilder( HttpMethod.GET, - "/druid/indexer/v1/tasks?maxCompletedTasks=0" + "/druid/indexer/v1/tasks?max=0" ), HttpResponseStatus.OK, ImmutableMap.of(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON),