lordcheng10 commented on code in PR #3260:
URL: https://github.com/apache/bookkeeper/pull/3260#discussion_r865705053
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java:
##########
@@ -441,7 +468,16 @@ private void triggerFlushAndAddEntry(long ledgerId, long
entryId, ByteBuf entry)
// Write cache is full, we need to trigger a flush so that it gets
rotated
// If the flush has already been triggered or flush has already
switched the
// cache, we don't need to trigger another flush
- if (!isFlushOngoing.get() &&
hasFlushBeenTriggered.compareAndSet(false, true)) {
+ if (maxPendingFlushCacheNum.tryAcquire() &&
hasFlushBeenTriggered.compareAndSet(false, true)) {
Review Comment:
like this?
if (hasFlushBeenTriggered.compareAndSet(false, true) &&
maxPendingFlushCacheNum.tryAcquire()){
.....
}
--
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]