Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ private void removeStateMachineDataIfNeeded(long index) {
.getFollowerNextIndices()).min().getAsLong();
LOG.debug("Removing data corresponding to log index {} min index {} "
+ "from cache", index, minIndex);
stateMachineDataCache.removeIf(k -> k >= (Math.min(minIndex, index)));
stateMachineDataCache.removeIf(k -> k <= (Math.min(minIndex, index)));
}
} catch (Exception e) {
throw new RuntimeException(e);
Expand All @@ -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);
Comment thread
adoroszlai marked this conversation as resolved.
Outdated
}
DispatcherContext.Builder builder =
new DispatcherContext.Builder().setTerm(trx.getLogEntry().getTerm())
Expand Down Expand Up @@ -996,7 +996,7 @@ public void notifyNotLeader(Collection<TransactionContext> pendingEntries) {

@Override
public CompletableFuture<Void> truncate(long index) {
stateMachineDataCache.removeIf(k -> k >= index);
stateMachineDataCache.removeIf(k -> k <= index);
Comment thread
adoroszlai marked this conversation as resolved.
Outdated
return CompletableFuture.completedFuture(null);
}

Expand Down