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 0fb31a70bca Make the root.__system database has a normal number of 
replicas (no longer forcing the replica to be 1) (#14127)
0fb31a70bca is described below

commit 0fb31a70bca430c63c5a20b55bb7ecd435e5a05f
Author: Li Yu Heng <[email protected]>
AuthorDate: Tue Nov 19 11:16:47 2024 +0800

    Make the root.__system database has a normal number of replicas (no longer 
forcing the replica to be 1) (#14127)
---
 .../confignode/service/thrift/ConfigNodeRPCServiceProcessor.java  | 8 ++------
 .../apache/iotdb/metrics/reporter/iotdb/IoTDBSessionReporter.java | 2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
index 36a7349e486..95997bff47d 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java
@@ -397,9 +397,7 @@ public class ConfigNodeRPCServiceProcessor implements 
IConfigNodeRPCService.Ifac
               .setMessage("Failed to create database. The TTL should be 
positive.");
     }
 
-    if (isSystemDatabase) {
-      databaseSchema.setSchemaReplicationFactor(1);
-    } else if (!databaseSchema.isSetSchemaReplicationFactor()) {
+    if (!databaseSchema.isSetSchemaReplicationFactor()) {
       
databaseSchema.setSchemaReplicationFactor(configNodeConfig.getSchemaReplicationFactor());
     } else if (databaseSchema.getSchemaReplicationFactor() <= 0) {
       errorResp =
@@ -408,9 +406,7 @@ public class ConfigNodeRPCServiceProcessor implements 
IConfigNodeRPCService.Ifac
                   "Failed to create database. The schemaReplicationFactor 
should be positive.");
     }
 
-    if (isSystemDatabase) {
-      databaseSchema.setDataReplicationFactor(1);
-    } else if (!databaseSchema.isSetDataReplicationFactor()) {
+    if (!databaseSchema.isSetDataReplicationFactor()) {
       
databaseSchema.setDataReplicationFactor(configNodeConfig.getDataReplicationFactor());
     } else if (databaseSchema.getDataReplicationFactor() <= 0) {
       errorResp =
diff --git 
a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/iotdb/IoTDBSessionReporter.java
 
b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/iotdb/IoTDBSessionReporter.java
index 968fa4cc476..b70ecebfff2 100644
--- 
a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/iotdb/IoTDBSessionReporter.java
+++ 
b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/iotdb/IoTDBSessionReporter.java
@@ -77,7 +77,7 @@ public class IoTDBSessionReporter extends IoTDBReporter {
             this.sessionPool.executeQueryStatement(
                 "CREATE DATABASE "
                     + metricConfig.getInternalDatabase()
-                    + " WITH SCHEMA_REPLICATION_FACTOR=1, 
DATA_REPLICATION_FACTOR=1, SCHEMA_REGION_GROUP_NUM=1, 
DATA_REGION_GROUP_NUM=1")) {
+                    + " WITH SCHEMA_REGION_GROUP_NUM=1, 
DATA_REGION_GROUP_NUM=1")) {
           if (!result2.hasNext()) {
             LOGGER.error("IoTDBSessionReporter checkOrCreateDatabase failed.");
           }

Reply via email to