Skip to content

Commit

Permalink
RATIS-2059. Missing reference count when putting log entries to cache…
Browse files Browse the repository at this point in the history
… on follower. (apache#1067)
  • Loading branch information
duongkame authored Apr 17, 2024
1 parent cf9d229 commit ee09075
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ protected CompletableFuture<Long> appendEntryImpl(ReferenceCountedObject<LogEntr
// to statemachine first and then to the cache. Not following the order
// will leave a spurious entry in the cache.
final Task write = fileLogWorker.writeLogEntry(entryRef, removedStateMachineData, context);
if (stateMachineCachingEnabled) {
if (stateMachineCachingEnabled && (removedStateMachineData != entry)) {
// The stateMachineData will be cached inside the StateMachine itself.
cache.appendEntry(LogSegment.Op.WRITE_CACHE_WITH_STATE_MACHINE_CACHE,
ReferenceCountedObject.wrap(removedStateMachineData));
Expand Down

0 comments on commit ee09075

Please sign in to comment.