You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2026/03/21 03:06:29 UTC
(doris) branch branch-4.1 updated: branch-4.1: [fix](cloud) reject ADMIN SET REPLICA VERSION in cloud #60875 (#61587)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 33093212bbb branch-4.1: [fix](cloud) reject ADMIN SET REPLICA VERSION in cloud #60875 (#61587)
33093212bbb is described below
commit 33093212bbbcab99b800c2b660e86b03e9587094
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Sat Mar 21 11:06:21 2026 +0800
branch-4.1: [fix](cloud) reject ADMIN SET REPLICA VERSION in cloud #60875 (#61587)
Cherry-picked from #60875
Co-authored-by: deardeng <de...@selectdb.com>
---
.../commands/AdminSetReplicaVersionCommand.java | 6 +++++
.../AdminSetReplicaVersionCommandTest.java | 27 ++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommand.java
index 1f2896b1fa2..594696442a2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommand.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommand.java
@@ -19,6 +19,7 @@ package org.apache.doris.nereids.trees.plans.commands;
import org.apache.doris.catalog.Env;
import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.DdlException;
import org.apache.doris.common.ErrorCode;
import org.apache.doris.common.ErrorReport;
import org.apache.doris.mysql.privilege.PrivPredicate;
@@ -132,6 +133,11 @@ public class AdminSetReplicaVersionCommand extends Command implements ForwardWit
}
}
+ @Override
+ protected void checkSupportedInCloudMode(ConnectContext ctx) throws DdlException {
+ throw new DdlException("Unsupported operation");
+ }
+
@Override
public <R, C> R accept(PlanVisitor<R, C> visitor, C context) {
return visitor.visitAdminSetReplicaVersionCommand(this, context);
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommandTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommandTest.java
index 182a8e046aa..0aba1b81412 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommandTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/commands/AdminSetReplicaVersionCommandTest.java
@@ -24,6 +24,8 @@ import org.apache.doris.catalog.OlapTable;
import org.apache.doris.catalog.Partition;
import org.apache.doris.catalog.Replica;
import org.apache.doris.catalog.Tablet;
+import org.apache.doris.common.Config;
+import org.apache.doris.common.DdlException;
import org.apache.doris.common.Pair;
import org.apache.doris.nereids.parser.NereidsParser;
import org.apache.doris.nereids.trees.plans.logical.LogicalPlan;
@@ -33,7 +35,9 @@ import com.google.common.collect.Lists;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
public class AdminSetReplicaVersionCommandTest extends TestWithFeService {
@Override
@@ -139,4 +143,27 @@ public class AdminSetReplicaVersionCommandTest extends TestWithFeService {
Assertions.assertDoesNotThrow(() -> ((AdminSetReplicaVersionCommand) plan4).run(connectContext, null));
Assertions.assertEquals(-1L, replica.getLastFailedVersion());
}
+
+ @Test
+ public void testUnsupportedInCloudMode() {
+ String originDeployMode = Config.deploy_mode;
+ String originCloudUniqueId = Config.cloud_unique_id;
+ try {
+ Config.deploy_mode = "cloud";
+ Config.cloud_unique_id = "";
+
+ Map<String, String> properties = new HashMap<>();
+ properties.put("tablet_id", "1");
+ properties.put("backend_id", "2");
+ properties.put("version", "3");
+ AdminSetReplicaVersionCommand command = new AdminSetReplicaVersionCommand(properties);
+
+ DdlException ex = Assertions.assertThrows(DdlException.class,
+ () -> command.verifyCommandSupported(connectContext));
+ Assertions.assertTrue(ex.getMessage().contains("Unsupported operation"));
+ } finally {
+ Config.deploy_mode = originDeployMode;
+ Config.cloud_unique_id = originCloudUniqueId;
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org