lizhanhui commented on code in PR #8915:
URL: https://github.com/apache/rocketmq/pull/8915#discussion_r1842040726


##########
broker/src/main/java/org/apache/rocketmq/broker/config/v2/ConfigStorage.java:
##########
@@ -105,6 +141,15 @@ public byte[] get(ByteBuffer key) throws RocksDBException {
 
     public void write(WriteBatch writeBatch) throws RocksDBException {
         db.write(ableWalWriteOptions, writeBatch);
+        accountWriteOpsForWalFlush();
+    }
+
+    private void accountWriteOpsForWalFlush() throws RocksDBException {
+        int writeCount = writeOpsCounter.incrementAndGet();
+        if (writeCount >= messageStoreConfig.getRocksdbFlushWalFrequency()) {
+            this.db.flushWal(false);

Review Comment:
   The frequency of commit-offset may be very high, I prefer to keep this 
periodic flush async. 



-- 
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: commits-unsubscr...@rocketmq.apache.org

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

Reply via email to