This is an automated email from the ASF dual-hosted git repository. liyuheng pushed a commit to branch lyh/cp/14127 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit d5eaf2d03d9f7402b4c4849f84173f9b6ea53665 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) (cherry picked from commit 0fb31a70bca430c63c5a20b55bb7ecd435e5a05f) --- .../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 0daf96f0d25..b8ec6f773bd 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 @@ -392,9 +392,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 = @@ -403,9 +401,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."); }
