StevenLuMT commented on code in PR #3342:
URL: https://github.com/apache/bookkeeper/pull/3342#discussion_r903198790
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java:
##########
@@ -793,6 +843,13 @@ public void checkpoint(Checkpoint checkpoint) throws
IOException {
}
}
+ private void cloneFlushedCache2LastFlushCache(WriteCache
writeCacheBeingFlushed, WriteCache writeCacheLastFlushed) {
+ writeCacheLastFlushed.clear();
+ writeCacheBeingFlushed.forEach((ledgerId, entryId, data) -> {
Review Comment:
> this looks like an expensive operation. Is there any reason to not swap
two caches like in `swapWriteCache()`?
I think this way can make your data more safe
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]