This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 026ef3c4bdd [fix](merge-cloud) update modify backend's cluster name
(#33263)
026ef3c4bdd is described below
commit 026ef3c4bdd04fbbf23d45453747e76033d491f7
Author: yujun <[email protected]>
AuthorDate: Fri Apr 5 23:35:59 2024 +0800
[fix](merge-cloud) update modify backend's cluster name (#33263)
---
.../doris/cloud/system/CloudSystemInfoService.java | 29 ++++++++++++++++++++++
.../org/apache/doris/system/SystemInfoService.java | 4 ---
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/cloud/system/CloudSystemInfoService.java
b/fe/fe-core/src/main/java/org/apache/doris/cloud/system/CloudSystemInfoService.java
index 59ba7340dfc..ea250b63abf 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/cloud/system/CloudSystemInfoService.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/cloud/system/CloudSystemInfoService.java
@@ -284,6 +284,7 @@ public class CloudSystemInfoService extends
SystemInfoService {
}
}
+ @Override
public void replayAddBackend(Backend newBackend) {
super.replayAddBackend(newBackend);
List<Backend> toAdd = new ArrayList<>();
@@ -291,6 +292,7 @@ public class CloudSystemInfoService extends
SystemInfoService {
updateCloudClusterMap(toAdd, new ArrayList<>());
}
+ @Override
public void replayDropBackend(Backend backend) {
super.replayDropBackend(backend);
List<Backend> toDel = new ArrayList<>();
@@ -298,6 +300,23 @@ public class CloudSystemInfoService extends
SystemInfoService {
updateCloudClusterMap(new ArrayList<>(), toDel);
}
+ @Override
+ public void replayModifyBackend(Backend backend) {
+ Backend memBe = getBackend(backend.getId());
+ // for rename cluster
+ String originalClusterName = memBe.getCloudClusterName();
+ String originalClusterId = memBe.getCloudClusterId();
+ String newClusterName =
backend.getTagMap().getOrDefault(Tag.CLOUD_CLUSTER_NAME, "");
+ if (!originalClusterName.equals(newClusterName)) {
+ // rename
+ updateClusterNameToId(newClusterName, originalClusterName,
originalClusterId);
+ LOG.info("cloud mode replay rename cluster, "
+ + "originalClusterName: {}, originalClusterId: {},
newClusterName: {}",
+ originalClusterName, originalClusterId, newClusterName);
+ }
+ super.replayModifyBackend(backend);
+ }
+
public boolean availableBackendsExists() {
if (FeConstants.runningUnitTest) {
return true;
@@ -313,6 +332,16 @@ public class CloudSystemInfoService extends
SystemInfoService {
return clusterNameToId.containsKey(clusterName);
}
+ @Override
+ public int getMinPipelineExecutorSize() {
+ if (ConnectContext.get() != null
+ &&
Strings.isNullOrEmpty(ConnectContext.get().getCloudCluster(false))) {
+ return 1;
+ }
+
+ return super.getMinPipelineExecutorSize();
+ }
+
@Override
public List<Backend> getBackendsByCurrentCluster() throws UserException {
ConnectContext ctx = ConnectContext.get();
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java
b/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java
index 891a6dc36fd..9580656d7c5 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/system/SystemInfoService.java
@@ -1004,10 +1004,6 @@ public class SystemInfoService {
}
public int getMinPipelineExecutorSize() {
- if (Config.isCloudMode() && ConnectContext.get() != null
- &&
Strings.isNullOrEmpty(ConnectContext.get().getCloudCluster(false))) {
- return 1;
- }
List<Backend> currentBackends = null;
try {
currentBackends = getBackendsByCurrentCluster();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]