Skip to content

Commit

Permalink
fix deferred migration
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jan 3, 2024
1 parent 575a3b6 commit 0439243
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion migration/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package migration

import (
"context"
"errors"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -86,7 +87,7 @@ func RunMigration(ctx context.Context, cfg Config, cache MigrationCache, store c
for job := range jobCh {
result, err := job.run(ctx, store)
if err != nil {
if err == errMigrationDeferred {
if errors.Is(err, errMigrationDeferred) {
atomic.AddUint32(&doneCount, 1)
continue
}
Expand Down
3 changes: 2 additions & 1 deletion migration/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package migration

import (
"context"
"errors"
"sync"
"time"

Expand Down Expand Up @@ -232,7 +233,7 @@ func (d DeferredMigrator) MigratedCodeCID() cid.Cid {
panic("this can't be called")
}

var errMigrationDeferred = xerrors.Errorf("migration deferred")
var errMigrationDeferred = errors.New("migration deferred")

func (d DeferredMigrator) MigrateState(ctx context.Context, store cbor.IpldStore, in ActorMigrationInput) (*ActorMigrationResult, error) {
d.ds.lk.Lock()
Expand Down

0 comments on commit 0439243

Please sign in to comment.