skip compaction missing data (#143)

This commit is contained in:
Victor Shyba 2024-03-24 05:11:30 -03:00 committed by GitHub
parent 286d38e054
commit eb6e5c97e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -51,7 +51,11 @@ func newNode(
if err := clockStore.Compact(
intrinsicFilter,
); err != nil {
panic(err)
if errors.Is(err, store.ErrNotFound) {
logger.Error("Missing compaction data. Skipping for now.", zap.Error(err))
} else {
panic(err)
}
}
logger.Info("compaction complete")

View File

@ -1277,7 +1277,7 @@ func (p *PebbleClockStore) Compact(
idxValue, closer, err := p.db.Get(clockDataLatestIndex(dataFilter))
if err != nil {
if errors.Is(err, pebble.ErrNotFound) {
return errors.Wrap(err, "compact")
return ErrNotFound
}
return errors.Wrap(err, "compact")
@ -1291,7 +1291,7 @@ func (p *PebbleClockStore) Compact(
value, closer, err := p.db.Get(clockDataFrameKey(dataFilter, frameNumber))
if err != nil {
if errors.Is(err, pebble.ErrNotFound) {
return errors.Wrap(err, "compact")
return ErrNotFound
}
return errors.Wrap(err, "compact")