Copilot commented on code in PR #65049:
URL: https://github.com/apache/doris/pull/65049#discussion_r3499501349
##########
fe/fe-core/src/main/java/org/apache/doris/system/BeSelectionPolicy.java:
##########
@@ -42,6 +42,7 @@ public class BeSelectionPolicy {
public boolean needScheduleAvailable = false;
public boolean needQueryAvailable = false;
public boolean needLoadAvailable = false;
+ public boolean needNonDecommissioned = false;
// Resource tag. Empty means no need to consider resource tag.
Review Comment:
`BeSelectionPolicy.toString()` is used in debug logs and user-visible errors
(e.g. “No available backend to match the policy: …”), but it currently does not
include the newly added `needNonDecommissioned` flag. That makes diagnostics
misleading when this new constraint is enabled.
##########
fe/fe-core/src/test/java/org/apache/doris/qe/InsertStreamTxnExecutorTest.java:
##########
@@ -18,33 +18,36 @@
package org.apache.doris.qe;
import org.apache.doris.catalog.Env;
+import org.apache.doris.common.jmockit.Deencapsulation;
import org.apache.doris.system.Backend;
import org.apache.doris.system.SystemInfoService;
-import com.google.common.collect.ImmutableMap;
import org.junit.Assert;
import org.junit.Test;
-import org.mockito.MockedStatic;
-import org.mockito.Mockito;
public class InsertStreamTxnExecutorTest {
@Test
public void testSelectBackendForTxnLoadUsesCurrentClusterBackends() throws
Exception {
- SystemInfoService systemInfoService = Mockito.spy(new
SystemInfoService());
+ SystemInfoService originalSystemInfoService =
Env.getCurrentSystemInfo();
+ SystemInfoService systemInfoService = new SystemInfoService();
Backend otherClusterBackend = createBackend(10001L, "127.0.0.1", 9060);
- Backend currentClusterBackend = createBackend(10002L, "127.0.0.2",
9061);
+ otherClusterBackend.setAlive(false);
+ Backend decommissioningBackend = createBackend(10002L, "127.0.0.2",
9061);
+ decommissioningBackend.setDecommissioning(true);
+ Backend currentClusterBackend = createBackend(10003L, "127.0.0.3",
9062);
Review Comment:
The variable name `otherClusterBackend` is misleading in this test: it’s not
assigned to a different cluster, it’s just marked `alive=false` to be filtered
out by the selection policy. Renaming it to something like `deadBackend` would
make the intent clearer.
--
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]