Skip to content

Commit 9ea3b2e

Browse files
committed
fix state bug
1 parent aa8054b commit 9ea3b2e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

raft/src/main/scala/zio/raft/Raft.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,8 @@ class Raft[S, A <: Command](
177177
for
178178
appState <- appStateRef.get
179179
now <- zio.Clock.instant // TODO (eran): are we ok with using now? it means we are using older heartbeat based on the response time instead of the send time
180-
before = l.pendingReads
181-
leader <- l.withHeartbeatResponse(m.from, now, appState, numberOfServers / 2)
182-
after = l.pendingReads
183-
_ <- ZIO.logDebug(s"pendingReads before: $before, after: $after")
184-
_ <- raftState.set(leader)
180+
l <- l.withHeartbeatResponse(m.from, now, appState, numberOfServers / 2)
181+
_ <- raftState.set(l)
185182

186183
wasPaused = l.replicationStatus.isPaused(m.from)
187184
leader = l.withResume(m.from)

0 commit comments

Comments
 (0)