This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a5c90293da ConfigManager confirms leader before create schema 
partition #13693
4a5c90293da is described below

commit 4a5c90293da0a4ce1b55e17100ad6c7c53fa819d
Author: Li Yu Heng <[email protected]>
AuthorDate: Wed Oct 9 17:07:15 2024 +0800

    ConfigManager confirms leader before create schema partition #13693
---
 .../java/org/apache/iotdb/confignode/manager/ConfigManager.java   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index 87dd13e654c..9d3f7fff9b8 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -882,6 +882,14 @@ public class ConfigManager implements IManager {
   @Override
   public TSchemaPartitionTableResp getOrCreateSchemaPartition(
       Map<String, List<TSeriesPartitionSlot>> dbSlotMap) {
+
+    TSStatus status = confirmLeader();
+    if (status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+      // Construct empty response
+      TSchemaPartitionTableResp resp = new TSchemaPartitionTableResp();
+      return resp.setStatus(status);
+    }
+
     // Construct empty response
     TSchemaPartitionTableResp resp;
     GetOrCreateSchemaPartitionPlan getOrCreateSchemaPartitionPlan =

Reply via email to