THUMarkLau commented on code in PR #12476:
URL: https://github.com/apache/iotdb/pull/12476#discussion_r1632189743


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/buffer/WALBuffer.java:
##########
@@ -535,12 +535,13 @@ public void run() {
       memTableIdsOfWal
           .computeIfAbsent(currentWALFileVersion, memTableIds -> new 
HashSet<>())
           .addAll(info.metaData.getMemTablesId());
-      
checkpointManager.updateCostOfActiveMemTables(info.memTableId2WalDiskUsage);
+      
checkpointManager.updateCostOfActiveMemTables(info.memTableId2WalDiskUsage, 
compressionRate);
 
       boolean forceSuccess = false;
       // try to roll log writer
       if (info.rollWALFileWriterListener != null
-          || (forceFlag && currentWALFileWriter.size() >= 
config.getWalFileSizeThresholdInByte())) {
+          || (forceFlag
+              && currentWALFileWriter.originalSize() >= 
config.getWalFileSizeThresholdInByte())) {

Review Comment:
   The original WAL file open/close control used the size of the WAL file. This 
PR only made some simple modifications on top of that to accommodate 
compression. It is reasonable to control the opening and closing of WAL files 
using the number of WALFlushListeners, but this goes beyond the scope of this 
PR and would make the PR's integration cycle longer and the impact more 
unpredictable. Therefore, it is suggested that controlling the opening and 
closing of WAL files using WALFlushListeners be planned for future work.



-- 
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-unsubscr...@iotdb.apache.org

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

Reply via email to