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

Snap Deals full unseal #8478

Merged
merged 9 commits into from
May 24, 2022
Merged

Snap Deals full unseal #8478

merged 9 commits into from
May 24, 2022

Conversation

geoff-vball
Copy link
Contributor

Related Issues

resolves #8230

Proposed Changes

Lotus can now recover unsealed data from a replica-update sector if the sector key has been deleted.

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@geoff-vball geoff-vball requested a review from a team as a code owner April 12, 2022 21:49
@geoff-vball geoff-vball requested a review from ZenGround0 April 12, 2022 21:49
@codecov
Copy link

codecov bot commented Apr 12, 2022

Codecov Report

Merging #8478 (17c3eb0) into master (88f8c7d) will decrease coverage by 0.06%.
The diff coverage is 60.00%.

❗ Current head 17c3eb0 differs from pull request most recent head 94ceb03. Consider uploading reports for the commit 94ceb03 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8478      +/-   ##
==========================================
- Coverage   40.86%   40.79%   -0.07%     
==========================================
  Files         686      685       -1     
  Lines       75710    75646      -64     
==========================================
- Hits        30939    30863      -76     
- Misses      39445    39447       +2     
- Partials     5326     5336      +10     
Impacted Files Coverage Δ
extern/storage-sealing/input.go 56.54% <0.00%> (ø)
extern/sector-storage/manager.go 61.51% <44.44%> (-0.59%) ⬇️
...xtern/storage-sealing/lib/nullreader/nullreader.go 75.00% <50.00%> (-25.00%) ⬇️
extern/sector-storage/ffiwrapper/sealer_cgo.go 58.75% <61.40%> (-1.70%) ⬇️
extern/sector-storage/worker_local.go 62.14% <100.00%> (+1.45%) ⬆️
extern/storage-sealing/states_sealing.go 38.54% <100.00%> (ø)
lib/rpcenc/reader.go 71.78% <100.00%> (-0.55%) ⬇️
chain/events/state/fastapi.go 75.00% <0.00%> (-25.00%) ⬇️
chain/actors/builtin/miner/diff.go 48.52% <0.00%> (-10.30%) ⬇️
chain/events/observer.go 73.79% <0.00%> (-7.59%) ⬇️
... and 33 more

@magik6k magik6k self-requested a review April 13, 2022 10:03
Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

A few things but this is close to ready

extern/sector-storage/ffiwrapper/sealer_cgo.go Outdated Show resolved Hide resolved
extern/sector-storage/manager.go Outdated Show resolved Hide resolved
extern/sector-storage/ffiwrapper/sealer_cgo.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

LGTM after a bit of out of band analysis

Copy link
Contributor

@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.

Generally looks good, just a few comments.

Looks like there is unintentional extern/filecoin-ffi change committed.

Snapdeals test appears to be unhappy:

2022-04-15T14:58:54.849Z	WARN	stores	stores/local.go:599	RemoveCopies: no primary copies of sector {1000 1} (sealed), not removing anything
2022-04-15T14:58:54.849Z	WARN	stores	stores/remote.go:73	remote RemoveCopies: no primary copies of sector {1000 1} (sealed), not removing anything
2022-04-15T14:58:54.849Z	WARN	stores	stores/local.go:599	RemoveCopies: no primary copies of sector {1000 1} (cache), not removing anything
2022-04-15T14:58:54.849Z	WARN	stores	stores/remote.go:73	remote RemoveCopies: no primary copies of sector {1000 1} (cache), not removing anything
Release Sector Key
Unseal Replica
    manager_test.go:323: 
        	Error Trace:	manager_test.go:323
        	Error:      	Received unexpected error:
        	            	worker UnsealPiece call:
        	            	    github.com/filecoin-project/lotus/extern/sector-storage.(*Manager).SectorsUnsealPiece
        	            	        /home/circleci/project/extern/sector-storage/manager.go:327
        	            	  - storage call error 0: %!w(failed to acquire sector {1000 1} from remote(2): sector not found [Hostname: cba2a59638c7])
        	Test:       	TestSnapDeals
--- FAIL: TestSnapDeals (24.09s)

lib/rpcenc/reader.go Outdated Show resolved Hide resolved
lib/rpcenc/reader_test.go Outdated Show resolved Hide resolved
if _, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy)); err != nil {
return xerrors.Errorf("copy sealed/cache sector data: %w", err)
_, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy))
if err != nil && !xerrors.Is(err, storiface.ErrSectorNotFound) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Those errors won't get propagated, would need filecoin-project/go-jsonrpc#36 (Maybe worth finally landing for this?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@magik6k I found the issue that was causing these errors to be returned as strings and it is fixed in the latest commit. Is there still a codepath where this might hit RPC? If so, could you show me where it is?

Copy link
Contributor

Choose a reason for hiding this comment

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

worker.Fetch is an rpc call.

This will only work with the miner built-in worker, as that one doesn't go through rpc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@magik6k Talked this over with Zen and we decided that not checking the error type will still give us the desired result in all cases. If you agree, I think we can land this PR

extern/sector-storage/ffiwrapper/sealer_cgo.go Outdated Show resolved Hide resolved
@jennijuju
Copy link
Member

@geoff-vball could you plz update the pr title format as suggested in the template?

@arajasek
Copy link
Contributor

Blocked by filecoin-project/go-jsonrpc#36

@geoff-vball geoff-vball force-pushed the gstuart/replica-update-unseal branch 4 times, most recently from 79ce3c6 to 17c3eb0 Compare April 23, 2022 19:38
@geoff-vball geoff-vball force-pushed the gstuart/replica-update-unseal branch from 17c3eb0 to 94ceb03 Compare May 2, 2022 13:59
Copy link
Contributor

@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.

I don't see anything obviously wrong here, and it's definitely better that the current state of things.

@magik6k magik6k merged commit 4b1bfa9 into master May 24, 2022
@magik6k magik6k deleted the gstuart/replica-update-unseal branch May 24, 2022 12:48
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.

Snap Deals full unseal
5 participants