FrankChen021 commented on code in PR #20442:
URL: https://github.com/apache/druid/pull/20442#discussion_r4122026202
##########
server/src/main/java/org/apache/druid/client/BrokerViewOfBrokerConfig.java:
##########
@@ -64,27 +54,6 @@ public class BrokerViewOfBrokerConfig extends
BaseBrokerViewOfConfig<BrokerDynam
private volatile QueryConfigSnapshot querySnapshot;
@Inject
- public BrokerViewOfBrokerConfig(
- @Json final ObjectMapper jsonMapper,
- @EscalatedGlobal final ServiceClientFactory clientFactory,
- @Coordinator final ServiceLocator serviceLocator,
- final DefaultQueryConfig defaultQueryConfig
- )
- {
- this.defaultQueryConfig = defaultQueryConfig;
- this.querySnapshot = new
QueryConfigSnapshot(QueryContext.of(defaultQueryConfig.getContext()).asMap(),
null);
- this.coordinatorClient =
- new CoordinatorClientImpl(
- clientFactory.makeClient(
- NodeRole.COORDINATOR.getJsonName(),
- serviceLocator,
- StandardRetryPolicy.builder().maxAttempts(15).build()
- ),
- jsonMapper
- );
- }
-
- @VisibleForTesting
public BrokerViewOfBrokerConfig(
final CoordinatorClient coordinatorClient,
Review Comment:
[P2] Preserve broker config fetch retries
**Finding:** This constructor now receives the shared CoordinatorClient,
whose default CoordinatorClientConfig.maxAttempts is 6, but the removed
constructor built this broker startup client with maxAttempts(15).
BaseBrokerViewOfConfig.start() fails broker startup when the initial
Coordinator fetch exhausts retries, so transient leader failovers that
previously recovered during attempts 7–15 can now prevent a broker from
starting; the same regression applies to BrokerViewOfCoordinatorConfig.
**Suggestion:** Keep the broker dynamic-config views on their previous
15-attempt default or give them a separate configurable retry policy while
applying this setting to the general Coordinator client.
##########
server/src/main/java/org/apache/druid/client/coordinator/CoordinatorClientConfig.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.client.coordinator;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class CoordinatorClientConfig
+{
+ /**
+ * Attempts per request to the Coordinator, the first one included, before
giving up on a retryable error.
+ */
+ @JsonProperty
+ private int maxAttempts = 6;
Review Comment:
[P2] Reject non-positive retry counts
**Finding:** The new runtime property is deserialized without a lower-bound
constraint. A configured value of 0 reaches StandardRetryPolicy and makes
service-client provisioning fail, while any negative value is accepted as an
unlimited policy by ServiceClientImpl.shouldTry(), so a typo such as -1 turns
every retryable Coordinator call into an unbounded retry and can keep
operations hanging indefinitely.
**Suggestion:** Validate maxAttempts as a positive value at configuration
binding time, and document any explicitly supported unlimited mode separately.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]