Skip to content

Commit

Permalink
move truncate outside if-stat
Browse files Browse the repository at this point in the history
  • Loading branch information
SzyWilliam committed May 30, 2024
1 parent cd467d9 commit 1473601
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1851,9 +1851,9 @@ CompletableFuture<Message> applyLogToStateMachine(ReferenceCountedObject<LogEntr
* @param logEntry the log entry being truncated
*/
void notifyTruncatedLogEntry(LogEntryProto logEntry) {
Optional.ofNullable(getState()).ifPresent(s -> s.truncate(logEntry.getIndex()));
if (logEntry.hasStateMachineLogEntry()) {
getTransactionManager().remove(TermIndex.valueOf(logEntry));
Optional.ofNullable(getState()).ifPresent(s -> s.truncate(logEntry.getIndex()));

final ClientInvocationId invocationId = ClientInvocationId.valueOf(logEntry.getStateMachineLogEntry());
final CacheEntry cacheEntry = getRetryCache().getIfPresent(invocationId);
Expand Down

0 comments on commit 1473601

Please sign in to comment.