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

Handle cid.Undef in manager.ReadPiece when there is no unsealed sector #3558

Closed
hannahhoward opened this issue Sep 4, 2020 · 0 comments · Fixed by #3615 or #3655
Closed

Handle cid.Undef in manager.ReadPiece when there is no unsealed sector #3558

hannahhoward opened this issue Sep 4, 2020 · 0 comments · Fixed by #3615 or #3655
Labels
kind/bug Kind: Bug P1 P1: Must be resolved

Comments

@hannahhoward
Copy link
Contributor

The retrieval adapters implementation of UnsealSector depends on GetSectorInfo, which can return a sector info with no CommD.

To our knowledge this only happens if the sector is not finished sealing. We handle this by just (passing an undefined CommD to ReadPiece)[https://github.com/filecoin-project/lotus/blob/master/markets/retrievaladapter/provider.go#L66) (the PR we changed this was here -- previously we were getting panics from nil pointer deferencing)

The implementation of ReadPiece is here. ReadPiece only uses CommD when it needs to unseal the sector. We believe that any time we get a nil CommD from GetSectorInfo it means that sealing isn't finished, so we should have unsealed piece lying around and we shouldn’t need CommD.

However, we're seeing unseal hangs in certain of multi-miner setups.

As a starting point, we should add an error check if we get to the point of unsealing but https://github.com/filecoin-project/lotus/blob/master/extern/sector-storage/manager.go#L260 but have an undefined commD -- currently we just drop down all the way to the Rust code without this check which could have unpredictable results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Kind: Bug P1 P1: Must be resolved
Projects
None yet
1 participant