From 8e4c8dd94aad54c26f5a2515e309eae662f6673b Mon Sep 17 00:00:00 2001 From: Jie Yao Date: Tue, 20 Aug 2024 18:29:24 -0700 Subject: [PATCH] add comments --- src/lib/logstore/log_dev.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/logstore/log_dev.cpp b/src/lib/logstore/log_dev.cpp index 5684eeda8..e70c7b0f5 100644 --- a/src/lib/logstore/log_dev.cpp +++ b/src/lib/logstore/log_dev.cpp @@ -435,6 +435,9 @@ bool LogDev::flush() { return false; } + // the amount of logs which one logGroup can flush has a upper limit. here we want to make sure all the logs that + // need to be flushed will definitely be flushed to physical dev, so we need this loop to create multiple log groups + // if necessary for (; m_last_flush_idx < new_idx;) { LogGroup* lg = prepare_flush(new_idx - m_last_flush_idx + 4); // Estimate 4 more extra in case of parallel writes