Skip to content

Commit

Permalink
Merge pull request #11083 from filecoin-project/asr/shut-up
Browse files Browse the repository at this point in the history
chore: stmgr: migrations: do not log noisily on cache misses
  • Loading branch information
arajasek authored Jul 18, 2023
2 parents 3af9fde + e17af65 commit 9e5e77b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions chain/stmgr/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"bytes"
"context"
"encoding/binary"
"errors"
"os"
"sort"
"strings"
"sync"
"time"

"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down Expand Up @@ -177,11 +179,15 @@ func (sm *StateManager) HandleStateForks(ctx context.Context, root cid.Cid, heig
u := sm.stateMigrations[height]
if u != nil && u.upgrade != nil {
migCid, ok, err := u.migrationResultCache.Get(ctx, root)
if err == nil && ok {
log.Infow("CACHED migration", "height", height, "from", root, "to", migCid)
return migCid, nil
} else if err != nil {
if err == nil {
if ok {
log.Infow("CACHED migration", "height", height, "from", root, "to", migCid)
return migCid, nil
}
} else if !errors.Is(err, datastore.ErrNotFound) {
log.Errorw("failed to lookup previous migration result", "err", err)
} else {
log.Debug("no cached migration found, migrating from scratch")
}

startTime := time.Now()
Expand Down

0 comments on commit 9e5e77b

Please sign in to comment.