Skip to content

Commit a61f111

Browse files
committed
logging
1 parent 3f7d64e commit a61f111

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

store/store.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,11 @@ func (s *Store[H]) deleteRange(ctx context.Context, from, to uint64) (rerr error
437437
defer func() {
438438
// make new context to always save progress
439439
ctx := context.Background()
440+
441+
log.Infow("deleted headers", "from_height", from, "to_height", to)
440442
newTailHeight := to
441443
if rerr != nil {
444+
log.Warnw("partial delete with error", "expected_to_height", newTailHeight, "actual_to_height", height, "err", err)
442445
newTailHeight = height
443446
}
444447

@@ -480,7 +483,6 @@ func (s *Store[H]) deleteRange(ctx context.Context, from, to uint64) (rerr error
480483
s.pending.DeleteRange(height, height+1)
481484
}
482485

483-
log.Infow("deleted headers", "from_height", from, "to_height", to)
484486
return nil
485487
}
486488

@@ -498,7 +500,8 @@ func (s *Store[H]) setTail(ctx context.Context, batch datastore.Batch, to uint64
498500
if err := writeHeaderHashTo(ctx, batch, newTail, tailKey); err != nil {
499501
return fmt.Errorf("writing tailKey in batch: %w", err)
500502
}
501-
log.Debug("set tail", "height", to)
503+
log.Infow("new tail", "height", newTail.Height(), "hash", newTail.Hash())
504+
s.metrics.newTail(newTail.Height())
502505

503506
// update head as well, if delete went over it
504507
head, err := s.Head(ctx)

0 commit comments

Comments
 (0)