alievmirza commented on code in PR #7512:
URL: https://github.com/apache/ignite-3/pull/7512#discussion_r2758733905
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -315,6 +322,21 @@ private void reset() {
}
this.tasks.clear();
}
+
+ private void decrementApplyQueueByteSize() {
+ long maxQueueSize =
NodeImpl.this.raftOptions.getMaxApplyQueueByteSize();
+
+ if (maxQueueSize > 0) {
+ long totalSize = 0;
+ for (LogEntryAndClosure task : tasks) {
+ ByteBuffer data = task.entry.getData();
+ totalSize += data.remaining();
+ }
Review Comment:
Please take a look at `NodeImpl#executeApplyingTasks`, we already iterate
through tasks in that context, hence second iteration through tasks doesn't
affect asymptotic.
We aggregate tasks and in `this.tasks.add(event);` and call
`decrementApplyQueueByteSize` and `executeApplyingTasks(this.tasks);` only when
tasks size >= batchSize or endOfBach is true.
--
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]