consensus: remove support for replay by #HEIGHT. closes #567
This commit is contained in:
parent
ec3c91ac14
commit
399fb9aa70
|
@ -115,35 +115,13 @@ func (cs *ConsensusState) catchupReplay(csHeight int) error {
|
||||||
gr, found, err = cs.wal.group.Search("#ENDHEIGHT: ", makeHeightSearchFunc(csHeight-1))
|
gr, found, err = cs.wal.group.Search("#ENDHEIGHT: ", makeHeightSearchFunc(csHeight-1))
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
cs.Logger.Error("Replay: wal.group.Search returned EOF", "#ENDHEIGHT", csHeight-1)
|
cs.Logger.Error("Replay: wal.group.Search returned EOF", "#ENDHEIGHT", csHeight-1)
|
||||||
// if we upgraded from 0.9 to 0.9.1, we may have #HEIGHT instead
|
|
||||||
// TODO (0.10.0): remove this
|
|
||||||
gr, found, err = cs.wal.group.Search("#HEIGHT: ", makeHeightSearchFunc(csHeight))
|
|
||||||
if err == io.EOF {
|
|
||||||
cs.Logger.Error("Replay: wal.group.Search returned EOF", "#HEIGHT", csHeight)
|
|
||||||
return nil
|
|
||||||
} else if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
defer gr.Close()
|
defer gr.Close()
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
// if we upgraded from 0.9 to 0.9.1, we may have #HEIGHT instead
|
return errors.New(cmn.Fmt("Cannot replay height %d. WAL does not contain #ENDHEIGHT for %d.", csHeight, csHeight-1))
|
||||||
// TODO (0.10.0): remove this
|
|
||||||
gr, _, err = cs.wal.group.Search("#HEIGHT: ", makeHeightSearchFunc(csHeight))
|
|
||||||
if err == io.EOF {
|
|
||||||
cs.Logger.Error("Replay: wal.group.Search returned EOF", "#HEIGHT", csHeight)
|
|
||||||
return nil
|
|
||||||
} else if err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
defer gr.Close()
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO (0.10.0): uncomment
|
|
||||||
// return errors.New(cmn.Fmt("Cannot replay height %d. WAL does not contain #ENDHEIGHT for %d.", csHeight, csHeight-1))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cs.Logger.Info("Catchup by replaying consensus messages", "height", csHeight)
|
cs.Logger.Info("Catchup by replaying consensus messages", "height", csHeight)
|
||||||
|
|
Loading…
Reference in New Issue