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 storage provider restart in publish stage #657

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Dec 20, 2021

@dirkmc dirkmc force-pushed the feat/stgprov-restart-publish branch 2 times, most recently from 9f4a7d4 to abaa6b1 Compare December 20, 2021 14:42
@dirkmc dirkmc force-pushed the feat/stgprov-restart-publish branch from abaa6b1 to 292d744 Compare December 20, 2021 14:46
Comment on lines -617 to -623
// re-track all deals for whom we still have a local blockstore.
for _, d := range deals {
if _, err := os.Stat(d.InboundCAR); err == nil && d.Ref != nil {
_, _ = p.stores.GetOrOpen(d.ProposalCid.String(), d.InboundCAR, d.Ref.Root)
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This piece of code was causing the problem - we shouldn't need to do this as stores.GetOrOpen() will be called lazily

@@ -107,36 +108,8 @@ func (p *providerDealEnvironment) GeneratePieceCommitment(proposalCid cid.Cid, c
}
}()

// dump the CARv1 payload of the CARv2 file to the Commp Writer and get back the CommP.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this code to its own file so it can be used from the test - no logical changes

}

// Generate commP
pieceCID, err := shared.GenerateCommp(pieceReader, uint64(pieceSize), uint64(pieceSize))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added commp generation to the test so if the data is bad the test will fail

Copy link
Collaborator

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me

@dirkmc dirkmc merged commit 00ea88b into feat/restartable-padded-reader Dec 21, 2021
@dirkmc dirkmc deleted the feat/stgprov-restart-publish branch December 21, 2021 10:14
dirkmc added a commit that referenced this pull request Dec 21, 2021
* feat: add SeekStart method to inflator reader, so we can seek back to the start when retrying AddPiece

* fix: storage provider restart in publish stage (#657)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants