Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion chain/indexer/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"go.opencensus.io/tag"
"go.opentelemetry.io/otel"
"golang.org/x/sync/errgroup"
"golang.org/x/xerrors"
"k8s.io/utils/keymutex"

"github.com/filecoin-project/lily/metrics"
Expand Down Expand Up @@ -63,7 +64,7 @@ func (me *ModelExporter) ExportResult(ctx context.Context, strg model.Storage, h

if err := strg.PersistBatch(ctx, res.Model); err != nil {
stats.Record(ctx, metrics.PersistFailure.M(1))
return err
return xerrors.Errorf("persist result (%s.%T): %w", res.Name, res.Model, err)
}
mdlLog.Infow("model data persisted", "height", height, "task", res.Name, "duration", time.Since(start), "reporter", me.name)
return nil
Expand Down
2 changes: 1 addition & 1 deletion storage/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func (d *Database) PersistBatch(ctx context.Context, ps ...model.Persistable) er

for _, p := range ps {
if err := p.Persist(ctx, txs, d.version); err != nil {
return err
return xerrors.Errorf("persisting %T: %w", p, err)
}
}

Expand Down