Skip to content

Commit 3d108c5

Browse files
committed
fix viewchange bug
Signed-off-by: Utkarsh Srivastava <[email protected]>
1 parent bfb6224 commit 3d108c5

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
*.pprof
1+
*.pprof
2+
*.log

internal/simulator/simulator.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ func (r *Simulator) clusterSanityChecks() {
161161
state := replica.VSRState()
162162
assert.Assert(
163163
state.OpNum >= state.CommitNumber,
164-
"expected opNum to be <= commitNum, found opNum: %d, commitNum: %d",
164+
"expected opNum to be <= commitNum, found opNum: %d, commitNum: %d (viewNum: %d)",
165165
state.OpNum,
166166
state.CommitNumber,
167+
state.ViewNumber,
167168
)
168169
}
169170
}

pkg/replica/replica.go

+1
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,7 @@ func (r *Replica) finalizeViewChange() {
10391039
}
10401040
}
10411041

1042+
r.state.OpNum = bestOpNum
10421043
r.state.Logs = bestLogs
10431044
r.state.CommitNumber = bestCommit
10441045
r.state.Status = ReplicaStatusNormal

records/regression_seeds

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1234

0 commit comments

Comments
 (0)