You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "Cpaulyz (via GitHub)" <gi...@apache.org> on 2023/07/17 03:36:23 UTC

[GitHub] [iotdb] Cpaulyz opened a new pull request, #10561: Add database limit threshold configuration and check when creating new database.

Cpaulyz opened a new pull request, #10561:
URL: https://github.com/apache/iotdb/pull/10561

   ## Design and Docs
   
   https://apache-iotdb.feishu.cn/docx/Mu3JdyJivowHhwxpxPgc2vDen5e
   
   ## Demo
   
   set database_limit_threshold=2
   
   ```sql
   IoTDB> create database root.sg1
   Msg: The statement is executed successfully.
   
   IoTDB> create database root.sg2
   Msg: The statement is executed successfully.
   
   IoTDB> show databases
   +--------+----+-----------------------+---------------------+---------------------+
   |Database| TTL|SchemaReplicationFactor|DataReplicationFactor|TimePartitionInterval|
   +--------+----+-----------------------+---------------------+---------------------+
   |root.sg1|null|                      3|                    3|            604800000|
   |root.sg2|null|                      3|                    3|            604800000|
   +--------+----+-----------------------+---------------------+---------------------+
   Total line number = 2
   It costs 1.273s
   
   IoTDB> create database root.sg3
   Msg: 526: The current database number has exceeded the cluster quota. The maximum number of cluster databases allowed is 2,Please review your configuration database_limit_thresholdor delete some existing database to comply with the quota.
   
   IoTDB> insert into root.db3.device(time,s2) values(now(),5)
   Msg: 526: The current database number has exceeded the cluster quota. The maximum number of cluster databases allowed is 2, Please review your configuration database_limit_threshold or delete some existing database to comply with the quota.
   ```
   
   - If database_limit_threshold is changed to a larger value, new Database creation is allowed after reboot.
   - If database_limit_threshold is changed to a smaller value you can reboot normally, but new Database creation is not allowed after reboot.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] JackieTien97 commented on a diff in pull request #10561: Add database limit threshold configuration and check when creating new database.

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 commented on code in PR #10561:
URL: https://github.com/apache/iotdb/pull/10561#discussion_r1266071582


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaManager.java:
##########
@@ -143,12 +145,19 @@ public TSStatus setDatabase(DatabaseSchemaPlan databaseSchemaPlan) {
 
     try {
       clusterSchemaInfo.isDatabaseNameValid(databaseSchemaPlan.getSchema().getName());
+      if (!databaseSchemaPlan.getSchema().getName().equals(IoTDBConfig.SYSTEM_DATABASE)) {
+        clusterSchemaInfo.checkDatabaseLimit();
+      }

Review Comment:
   I think we need to put this check into StateMachine to guarantee the atomicity of `check` and `create`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] JackieTien97 merged pull request #10561: Add database limit threshold configuration and check when creating new database.

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #10561:
URL: https://github.com/apache/iotdb/pull/10561


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org