Copilot commented on code in PR #15234:
URL: https://github.com/apache/iotdb/pull/15234#discussion_r2020522800


##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java:
##########
@@ -248,6 +250,21 @@ public SchemaPartitionResp 
getOrCreateSchemaPartition(final GetOrCreateSchemaPar
         return resp;
       }
 
+      // Here we check if the related Databases exist again,
+      // due to we don't have a transaction mechanism.
+      for (final String database : req.getPartitionSlotsMap().keySet()) {
+        if (!isDatabaseExist(database)) {
+          return new SchemaPartitionResp(
+              new TSStatus(TSStatusCode.DATABASE_NOT_EXIST.getStatusCode())
+                  .setMessage(
+                      String.format(
+                          "Create SchemaPartition failed because the database: 
%s is not exists",

Review Comment:
   Consider correcting the error message to use proper grammar, e.g., replacing 
'is not exists' with 'does not exist'.
   ```suggestion
                             "Create SchemaPartition failed because the 
database: %s does not exist",
   ```



##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java:
##########
@@ -373,6 +395,21 @@ public DataPartitionResp getOrCreateDataPartition(final 
GetOrCreateDataPartition
         return resp;
       }
 
+      // Here we check if the related Databases exist again,
+      // due to we don't have a transaction mechanism.
+      for (final String database : req.getPartitionSlotsMap().keySet()) {
+        if (!isDatabaseExist(database)) {
+          return new DataPartitionResp(
+              new TSStatus(TSStatusCode.DATABASE_NOT_EXIST.getStatusCode())
+                  .setMessage(
+                      String.format(
+                          "Create DataPartition failed because the database: 
%s is not exists",

Review Comment:
   Consider correcting the error message to use proper grammar, e.g., replacing 
'is not exists' with 'does not exist'.
   ```suggestion
                             "Create DataPartition failed because the database: 
%s does not exist",
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to