From 2f3c912ad93c25aacd8b43d4873a121add7102b7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 28 Jan 2021 11:17:09 -0800 Subject: [PATCH 1/2] improve upgrade logging --- chain/stmgr/forks.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index b36f2c0bd..0e950a2b1 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -261,13 +261,13 @@ func (sm *StateManager) handleStateForks(ctx context.Context, root cid.Cid, heig u := sm.stateMigrations[height] if u != nil && u.upgrade != nil { startTime := time.Now() - log.Warnw("STARTING migration", "height", height) + log.Warnw("STARTING migration", "height", height, "from", root) // Yes, we clone the cache, even for the final upgrade epoch. Why? Reverts. We may // have to migrate multiple times. tmpCache := u.cache.Clone() retCid, err = u.upgrade(ctx, sm, tmpCache, cb, root, height, ts) if err != nil { - log.Errorw("FAILED migration", "height", height, "error", err) + log.Errorw("FAILED migration", "height", height, "from", root, "error", err) return cid.Undef, err } // Yes, we update the cache, even for the final upgrade epoch. Why? Reverts. This @@ -276,6 +276,8 @@ func (sm *StateManager) handleStateForks(ctx context.Context, root cid.Cid, heig u.cache.Update(tmpCache) log.Warnw("COMPLETED migration", "height", height, + "from", root, + "to", retCid, "duration", time.Since(startTime), ) } From 53271729b668846097bfb01635fef9a7eb0467ba Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 28 Jan 2021 11:17:28 -0800 Subject: [PATCH 2/2] tweak migration perf --- chain/stmgr/forks.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index 0e950a2b1..ca3b52d52 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -922,7 +922,12 @@ func UpgradeActorsV3(ctx context.Context, sm *StateManager, cache MigrationCache workerCount = 1 } - config := nv10.Config{MaxWorkers: uint(workerCount)} + config := nv10.Config{ + MaxWorkers: uint(workerCount), + JobQueueSize: 1000, + ResultQueueSize: 100, + ProgressLogPeriod: 10 * time.Second, + } newRoot, err := upgradeActorsV3Common(ctx, sm, cache, root, epoch, ts, config) if err != nil { return cid.Undef, xerrors.Errorf("migrating actors v3 state: %w", err)