datamanager: error if there're wals but not a datastatus in ost

This commit is contained in:
Simone Gotti 2019-07-18 14:54:28 +02:00
parent c034819087
commit 18c5ae0492
1 changed files with 4 additions and 0 deletions

View File

@ -1025,6 +1025,10 @@ func (d *DataManager) InitEtcd(ctx context.Context, dataStatus *DataStatus) erro
lastCommittedStorageWalSequence := ""
wroteWals := 0
for wal := range d.ListOSTWals("") {
// if there're wals in ost but not a datastatus return an error
if dataStatus == nil {
return errors.Errorf("no datastatus in etcd but some wals are present, this shouldn't happen")
}
d.log.Debugf("wal: %s", wal)
if wal.Err != nil {
return wal.Err