raghavyadav01 commented on code in PR #19892:
URL: https://github.com/apache/pinot/pull/19892#discussion_r4505327749
##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java:
##########
@@ -786,6 +786,13 @@ public static class Broker {
"pinot.broker.enable.single.pool.segments.metric";
public static final boolean DEFAULT_ENABLE_SINGLE_POOL_SEGMENTS_METRIC =
false;
+ /// Whether the broker may route to an unhealthy server when no healthy
replica is available for a segment.
+ /// Precedence is cluster config, then broker config, then the default
(false). The cluster value overrides the
+ /// broker value at listener registration during startup and on subsequent
updates, ensuring a consistent cluster
+ /// policy. Removing the cluster setting restores the broker value (or the
default if unset).
+ public static final String CONFIG_OF_ENABLE_FAIL_OPEN =
"pinot.broker.enable.fail.open";
Review Comment:
Nothing reads `isEnabled()` yet, so setting this key has no effect until the
routing follow-up lands. Should this merge with that change, or at least say in
the key's Javadoc that it's a no-op for now?
##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/FailOpenPolicy.java:
##########
@@ -0,0 +1,76 @@
+/**
+ * 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.pinot.broker.routing;
+
+import java.util.Map;
+import java.util.Set;
+import javax.annotation.concurrent.ThreadSafe;
+import org.apache.pinot.spi.config.provider.PinotClusterConfigChangeListener;
+import org.apache.pinot.spi.utils.CommonConstants.Broker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/// Thread-safe policy for broker fail-open routing.
+///
+/// Precedence is cluster config, then broker config, then the default
(false). Listener registration immediately
Review Comment:
At registration in `BaseBrokerStarter` the cluster-config handler isn't
attached to Helix yet, so the cluster value isn't applied here; it comes later
via the initial callback. Should the Javadoc be fixed, or registration moved
after the handler is connected?
--
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]