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/03/16 06:12:26 UTC

[GitHub] [iotdb] qiaojialin commented on a change in pull request #5214: [IOTDB-2737] Fix ID Table compaction bug

qiaojialin commented on a change in pull request #5214:
URL: https://github.com/apache/iotdb/pull/5214#discussion_r827603119



##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/idtable/IDTable.java
##########
@@ -130,6 +131,15 @@ void updateLastCache(
    */
   public DeviceEntry getDeviceEntry(String deviceName);
 
+  /**
+   * get schema from device and measurements
+   *
+   * @param deviceName device name of the time series

Review comment:
       ```suggestion
      * @param deviceName origin device name of the time series, e.g., root.sg.d
   ```

##########
File path: server/src/main/java/org/apache/iotdb/db/metadata/idtable/AppendOnlyDiskSchemaManager.java
##########
@@ -180,7 +155,13 @@ public void recover(IDTable idTable) {
         loc += cur.entrySize;
       }
     } catch (IOException | MetadataException e) {
-      logger.error("ID table can't recover from log: {}", dataFile);
+      logger.info("Last entry is incomplete, we recover as much as we can");
+      try {
+        outputStream.getChannel().truncate(loc);
+      } catch (IOException ex) {
+        logger.error("Failed at truncate file");

Review comment:
       which file? add exception in logger




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