Skip to content

Commit

Permalink
server: Handle V2Request when analysis WAL entries
Browse files Browse the repository at this point in the history
  • Loading branch information
serathius committed Dec 2, 2021
1 parent 2777fd3 commit a3150d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions server/storage/wal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ func visitEntryData(entryType raftpb.EntryType, data []byte, visitor Visitor) er
switch entryType {
case raftpb.EntryNormal:
var raftReq etcdserverpb.InternalRaftRequest
err := pbutil.Unmarshaler(&raftReq).Unmarshal(data)
if err != nil {
return err
if err := pbutil.Unmarshaler(&raftReq).Unmarshal(data); err != nil {
// try V2 Request
var r etcdserverpb.Request
if pbutil.Unmarshaler(&r).Unmarshal(data) != nil {
// return original error
return err
}
msg = proto.MessageReflect(&r)
break
}
msg = proto.MessageReflect(&raftReq)
if raftReq.ClusterVersionSet != nil {
Expand Down

0 comments on commit a3150d8

Please sign in to comment.