Skip to content

Commit

Permalink
Review Response
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenGround0 committed Apr 22, 2024
1 parent d941616 commit db143d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions builtin/v13/migration/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,13 @@ func (m *marketMigrator) migrateProviderSectorsAndStatesFromScratch(ctx context.

var oldState market12.DealState
var newState market13.DealState

var cnt int
err = oldStateArray.ForEach(&oldState, func(i int64) error {
// Refresh proposals array periodically to avoid holding onto all ~10GB of memory
// throughout whole migration.
// This has limited impact on caching speedups because the access pattern is sequential.
if i%(int64(proposalsSize)/1000) == 0 {
cnt += 1
if proposalsSize > 0 && cnt%(int(proposalsSize/1000)) == 0 {
proposalsArr, err = adt.AsArray(ctxStore, proposals, market12.ProposalsAmtBitwidth)
if err != nil {
return xerrors.Errorf("failed to load proposals array: %w", err)
Expand Down

0 comments on commit db143d8

Please sign in to comment.