adoroszlai commented on code in PR #4499:
URL: https://github.com/apache/ozone/pull/4499#discussion_r1152889923
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java:
##########
@@ -874,7 +874,7 @@ public CompletableFuture<Message>
applyTransaction(TransactionContext trx) {
// if waitOnBothFollower is false, remove the entry from the cache
// as soon as its applied and such entry exists in the cache.
if (!waitOnBothFollowers) {
- stateMachineDataCache.removeIf(k -> k >= index);
+ stateMachineDataCache.removeIf(k -> k <= index);
Review Comment:
Nit: Can you please extract this to a new method to emphasize the difference
from `truncate`? It would also help avoid calculating `Math.min(minIndex,
index)` for each item at the other call.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]