- actor().tell(new ApplyState(clientActor, identifier,
- replicatedLogEntry), actor());
- newLastApplied = i;
+
+ final ApplyState applyState;
+ final ClientRequestTracker tracker = removeClientRequestTracker(i);
+ if (tracker != null) {
+ applyState = new ApplyState(tracker.getClientActor(), tracker.getIdentifier(), replicatedLogEntry);
+ } else {
+ applyState = new ApplyState(null, null, replicatedLogEntry);
+ }
+
+ log.debug("{}: Setting last applied to {}", logName(), i);
+
+ context.setLastApplied(i);
+ context.getApplyStateConsumer().accept(applyState);