diff --git a/internal/services/configstore/readdb/readdb.go b/internal/services/configstore/readdb/readdb.go index 098e1b5..005c3a7 100644 --- a/internal/services/configstore/readdb/readdb.go +++ b/internal/services/configstore/readdb/readdb.go @@ -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) - } + if 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") diff --git a/internal/services/runservice/readdb/readdb.go b/internal/services/runservice/readdb/readdb.go index 4f98696..1974cd6 100644 --- a/internal/services/runservice/readdb/readdb.go +++ b/internal/services/runservice/readdb/readdb.go @@ -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) - } + if 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")