-
Notifications
You must be signed in to change notification settings - Fork 59
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
fix storage provider restart in publish stage #657
Conversation
9f4a7d4
to
abaa6b1
Compare
abaa6b1
to
292d744
Compare
// 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) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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
There was a problem hiding this 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
* 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)
Solution to filecoin-project/lotus#7815