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/04/29 14:26:31 UTC

[GitHub] [iotdb] qiaojialin commented on a diff in pull request #5695: [IOTDB-3020][IOTDB-3022]Multi-thread MLog recovery & Fix SchemaFile dirty page loses

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


##########
server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java:
##########
@@ -430,10 +430,20 @@ public void createTimeseries(CreateTimeSeriesPlan plan) throws MetadataException
 
   @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
   public void createTimeseries(CreateTimeSeriesPlan plan, long offset) throws MetadataException {
-    if (!memoryStatistics.isAllowToCreateNewSeries()) {
-      throw new MetadataException(
-          "IoTDB system load is too large to create timeseries, "
-              + "please increase MAX_HEAP_SIZE in iotdb-env.sh/bat and restart");
+    try {
+      while (!memoryStatistics.isAllowToCreateNewSeries()) {
+        if (!config.getSchemaEngineMode().equals(SchemaEngineMode.Schema_File.toString())) {
+          throw new MetadataException(
+              "IoTDB system load is too large to create timeseries, "
+                  + "please increase MAX_HEAP_SIZE in iotdb-env.sh/bat and restart");
+        }
+
+        logger.warn("IoTDB loads too many timeseries, waiting for IO swapping...");
+        Thread.sleep(10000L);
+      }
+    } catch (InterruptedException e) {
+      e.printStackTrace();

Review Comment:
   use logger.log



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