diff --git a/backfill/backfill.go b/backfill/backfill.go index 8a418892..59ece660 100644 --- a/backfill/backfill.go +++ b/backfill/backfill.go @@ -526,7 +526,7 @@ func (b *Backfiller) BackfillRepo(ctx context.Context, job Job) (string, error) go func() { defer r.Close() defer close(recordQueue) - err := repo.StreamRepoRecords(ctx, r, b.NSIDFilter, onCommit, func(recordPath string, nodeCid cid.Cid, data []byte) error { + err := repo.StreamRepoRecords(ctx, repoDID, r, b.NSIDFilter, onCommit, func(recordPath string, nodeCid cid.Cid, data []byte) error { numRecords++ recordQueue <- recordQueueItem{recordPath: recordPath, nodeCid: nodeCid, data: data} return nil diff --git a/cmd/gosky/main.go b/cmd/gosky/main.go index 9ce64b52..1f26f37a 100644 --- a/cmd/gosky/main.go +++ b/cmd/gosky/main.go @@ -671,7 +671,7 @@ var listAllRecordsCmd = &cli.Command{ vals := cctx.Bool("values") cids := cctx.Bool("cids") - if err := repo.StreamRepoRecords(ctx, bytes.NewReader(repob), collection, nil, func(k string, cc cid.Cid, v []byte) error { + if err := repo.StreamRepoRecords(ctx, arg, bytes.NewReader(repob), collection, nil, func(k string, cc cid.Cid, v []byte) error { if !strings.HasPrefix(k, collection) { return repo.ErrDoneIterating } diff --git a/repo/stream.go b/repo/stream.go index cd3e1f86..83b92d9d 100644 --- a/repo/stream.go +++ b/repo/stream.go @@ -131,7 +131,7 @@ func (bs *readStreamBlockstore) Put(ctx context.Context, blk block.Block) error // and iteration continues; errors from cb do not stop the walk and are not // returned from this function. To signal intentional early termination, cb can // return ErrDoneIterating, which is handled silently without logging. -func StreamRepoRecords(ctx context.Context, r io.Reader, prefix string, onCommit func(*SignedCommit) error, cb func(k string, c cid.Cid, v []byte) error) error { +func StreamRepoRecords(ctx context.Context, repoDID string, r io.Reader, prefix string, onCommit func(*SignedCommit) error, cb func(k string, c cid.Cid, v []byte) error) error { ctx, span := otel.Tracer("repo").Start(ctx, "RepoStream") defer span.End() @@ -168,7 +168,7 @@ func StreamRepoRecords(ctx context.Context, r io.Reader, prefix string, onCommit return cb(k, val, data) }); err != nil { if err != ErrDoneIterating { - slog.Error("failed to get record from tree", "key", k, "cid", val, "error", err) + slog.Error("failed to get record from tree", "repo", repoDID, "key", k, "cid", val, "error", err) } return nil }