readdb: error if there's no wal in etcd
This commit is contained in:
parent
3f64bda0cc
commit
3a963ef95f
|
@ -351,15 +351,10 @@ func (r *ReadDB) SyncRDB(ctx context.Context) error {
|
|||
r.log.Debugf("firstAvailableWalData: %s", util.Dump(firstAvailableWalData))
|
||||
r.log.Debugf("revision: %d", revision)
|
||||
if firstAvailableWalData == nil {
|
||||
if curWalSeq != "" {
|
||||
// this happens if etcd has been reset
|
||||
return errors.Errorf("our curwalseq is %q but there's no wal data on etcd", curWalSeq)
|
||||
return errors.Errorf("no wal data in etcd")
|
||||
}
|
||||
}
|
||||
if firstAvailableWalData != nil {
|
||||
if curWalSeq < firstAvailableWalData.WalSequence {
|
||||
return errors.Errorf("current applied wal seq %q is smaller than the first available wal on etcd %q", curWalSeq, firstAvailableWalData.WalSequence)
|
||||
}
|
||||
return errors.Errorf("current applied wal seq %q is smaller than the first available wal in etcd %q", curWalSeq, firstAvailableWalData.WalSequence)
|
||||
}
|
||||
|
||||
r.log.Infof("syncing from wals")
|
||||
|
|
|
@ -591,15 +591,10 @@ func (r *ReadDB) SyncObjectStorage(ctx context.Context) error {
|
|||
r.log.Debugf("firstAvailableWalData: %s", util.Dump(firstAvailableWalData))
|
||||
r.log.Debugf("revision: %d", revision)
|
||||
if firstAvailableWalData == nil {
|
||||
if curWalSeq != "" {
|
||||
// this happens if etcd has been reset
|
||||
return errors.Errorf("our curwalseq is %q but there's no wal data on etcd", curWalSeq)
|
||||
return errors.Errorf("no wal data in etcd")
|
||||
}
|
||||
}
|
||||
if firstAvailableWalData != nil {
|
||||
if curWalSeq < firstAvailableWalData.WalSequence {
|
||||
return errors.Errorf("current applied wal seq %q is smaller than the first available wal on etcd %q", curWalSeq, firstAvailableWalData.WalSequence)
|
||||
}
|
||||
return errors.Errorf("current applied wal seq %q is smaller than the first available wal in etcd %q", curWalSeq, firstAvailableWalData.WalSequence)
|
||||
}
|
||||
|
||||
r.log.Infof("syncing from wals")
|
||||
|
|
Loading…
Reference in New Issue