Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Separate coroutine generation index #547

Merged
merged 3 commits into from
Dec 25, 2024
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ require (
)

replace (
github.com/filecoin-project/dagstore => github.com/ipfs-force-community/dagstore v0.4.4-0.20231218095803-2d4efb48c393
github.com/filecoin-project/dagstore => github.com/ipfs-force-community/dagstore v0.4.4-0.20241209090026-ab2f6df47e8e
github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi
github.com/filecoin-project/go-fil-markets => github.com/ipfs-force-community/go-fil-markets v1.2.6-0.20230822060005-aee2cbae5b01
github.com/filecoin-project/go-jsonrpc => github.com/ipfs-force-community/go-jsonrpc v0.1.9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.2.2/go.mod h1:fa/d1lAdUHxuc1jedx3
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/ipfs-force-community/dagstore v0.4.4-0.20231218095803-2d4efb48c393 h1:DZd7I0MLgFtW8sVeSk7MSEDLC8PQ4Drl01CIKak/JM0=
github.com/ipfs-force-community/dagstore v0.4.4-0.20231218095803-2d4efb48c393/go.mod h1:YKn4qXih+/2xQWpfJsaKGOi4POw5vH5grDmfPCCnx8g=
github.com/ipfs-force-community/dagstore v0.4.4-0.20241209090026-ab2f6df47e8e h1:vo0qbCobRa8pU5e+XZj0FhXwJVXLcdbc35OBG0dzh+Q=
github.com/ipfs-force-community/dagstore v0.4.4-0.20241209090026-ab2f6df47e8e/go.mod h1:YKn4qXih+/2xQWpfJsaKGOi4POw5vH5grDmfPCCnx8g=
github.com/ipfs-force-community/go-fil-markets v1.2.6-0.20230822060005-aee2cbae5b01 h1:sD9/GoGBui1j5fpKepe1v4P5NsjurqbM8WQlk4LNZeI=
github.com/ipfs-force-community/go-fil-markets v1.2.6-0.20230822060005-aee2cbae5b01/go.mod h1:eryxo/oVgIxaR5g5CNr9PlvZOi+u/bak0IsPL/PT1hk=
github.com/ipfs-force-community/go-jsonrpc v0.1.9 h1:5QavBltfvV6fz/+EbYsCkVxJ1MSJncZm6YuPs1SLdZU=
Expand Down
14 changes: 8 additions & 6 deletions storageprovider/deal_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,14 @@ func (storageDealPorcess *StorageDealProcessImpl) HandleOff(ctx context.Context,
}
log.Infof("after publishing deal. piece cid: %s, payload size: %d", deal.Proposal.PieceCID, deal.PayloadSize)

log.Infof("register shard. deal: %d, proposalCid: %s, pieceCid: %s", deal.DealID, deal.ProposalCid, deal.Proposal.PieceCID)
// Register the deal data as a "shard" with the DAG store. Later it can be
// fetched from the DAG store during retrieval.
if err := storageDealPorcess.dagStore.RegisterShard(ctx, deal.Proposal.PieceCID, carFilePath, true, nil); err != nil {
log.Errorf("failed to register shard: %v", err)
}
go func() {
log.Infof("register shard. deal: %d, proposalCid: %s, pieceCid: %s", deal.DealID, deal.ProposalCid, deal.Proposal.PieceCID)
// Register the deal data as a "shard" with the DAG store. Later it can be
// fetched from the DAG store during retrieval.
if err := storageDealPorcess.dagStore.RegisterShard(ctx, deal.Proposal.PieceCID, carFilePath, true, nil); err != nil {
log.Errorf("failed to register shard: %v", err)
}
}()

// Remove temporary car files
storageDealPorcess.removeTemporaryFile(ctx, deal, true)
Expand Down
3 changes: 2 additions & 1 deletion storageprovider/storage_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (p *StorageProviderImpl) start(ctx context.Context) error {
// Run datastore and DAG store migrations
deals, err := p.dealStore.ListDeal(ctx, &types.StorageDealQueryParams{Page: types.Page{Limit: math.MaxInt32}})
if err != nil {
return nil
return fmt.Errorf("failed to list deals: %w", err)
}
// Fire restart event on all active deals
if err := p.restartDeals(ctx, deals); err != nil {
Expand All @@ -262,6 +262,7 @@ func (p *StorageProviderImpl) restartDeals(ctx context.Context, deals []*types.M
continue
}

log.Debugf("restart deal %s, state: %s, piece cid: %s", deal.ProposalCid, deal.State, deal.Proposal.PieceCID)
go func(deal *types.MinerDeal) {
err := p.dealProcess.HandleOff(ctx, deal)
if err != nil {
Expand Down
Loading