You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/02 09:54:00 UTC

[GitHub] [iotdb] qiaojialin commented on a diff in pull request #5767: Fix concurrent failure of testInsertMultiTabletPlanParallel

qiaojialin commented on code in PR #5767:
URL: https://github.com/apache/iotdb/pull/5767#discussion_r862722170


##########
server/src/main/java/org/apache/iotdb/db/localconfignode/LocalConfigNode.java:
##########
@@ -539,7 +539,17 @@ public List<IStorageGroupMNode> getAllStorageGroupNodes() {
    */
   public SchemaRegionId getBelongedSchemaRegionId(PartialPath path) throws MetadataException {
     PartialPath storageGroup = storageGroupSchemaManager.getBelongedStorageGroup(path);
-    return schemaPartitionTable.getSchemaRegionId(storageGroup, path);
+    SchemaRegionId schemaRegionId = schemaPartitionTable.getSchemaRegionId(storageGroup, path);
+    if (schemaRegionId == null) {
+      throw new MetadataException(
+          String.format("Storage group %s has not been prepared well.", storageGroup));

Review Comment:
   Print the schema region id.
   SchemaRegion-x of Storage group %s is not registered?



##########
server/src/main/java/org/apache/iotdb/db/localconfignode/LocalConfigNode.java:
##########
@@ -539,7 +539,17 @@ public List<IStorageGroupMNode> getAllStorageGroupNodes() {
    */
   public SchemaRegionId getBelongedSchemaRegionId(PartialPath path) throws MetadataException {
     PartialPath storageGroup = storageGroupSchemaManager.getBelongedStorageGroup(path);
-    return schemaPartitionTable.getSchemaRegionId(storageGroup, path);
+    SchemaRegionId schemaRegionId = schemaPartitionTable.getSchemaRegionId(storageGroup, path);
+    if (schemaRegionId == null) {
+      throw new MetadataException(
+          String.format("Storage group %s has not been prepared well.", storageGroup));
+    }
+    ISchemaRegion schemaRegion = schemaEngine.getSchemaRegion(schemaRegionId);
+    if (schemaRegion == null) {
+      throw new MetadataException(
+          String.format("Storage group %s has not been prepared well.", storageGroup));

Review Comment:
   SchemaRegion-x of Storage Group %s is not initiated.



-- 
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