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

Resume Storage Market Data Transfer #430

Merged
merged 8 commits into from
Oct 13, 2020

Conversation

aarshkshah1992
Copy link
Collaborator

PR to merge data transfer work to master.

* first checkpoint

* draft 2

* working client restarts

* more fixes

* comment

* document test failure
* first checkpoint

* draft 2

* working client restarts

* more fixes

* comment

* provider restarts

* provider restarts

* fix tests
Copy link
Collaborator

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

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

I think you're maybe still working on this, but here are two requests

@@ -108,7 +109,8 @@ func NewDependenciesWithTestData(t *testing.T, ctx context.Context, td *shared_t
dtTransport1 := dtgstransport.NewTransport(td.Host1.ID(), gs1)
dt1, err := dtimpl.NewDataTransfer(td.DTStore1, td.DTNet1, dtTransport1, td.DTStoredCounter1)
require.NoError(t, err)
err = dt1.Start(ctx)
testutil.StartAndWaitForReady(ctx, t, dt1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey you don't actually need to use this version -- the function is already present in the shared_testutil for go-fil-markets and will work with go-data-transfer. I should probably extract that whole functionality to common utilities repo at some point :)

@@ -65,6 +65,14 @@ const (
// StorageDealTransferring means data is being sent from the client to the provider via the data transfer module
StorageDealTransferring

// StorageDealProviderTransferRestart means a storage deal data transfer from client to provider will be restarted
Copy link
Collaborator

Choose a reason for hiding this comment

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

at this point, we should put these at the end of the states list -- people are starting to rely on the deal states list not changing

Address review feedback
@codecov-io
Copy link

Codecov Report

Merging #430 into master will decrease coverage by 0.28%.
The diff coverage is 51.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #430      +/-   ##
==========================================
- Coverage   66.33%   66.05%   -0.27%     
==========================================
  Files          48       48              
  Lines        3189     3237      +48     
==========================================
+ Hits         2115     2138      +23     
- Misses        830      850      +20     
- Partials      244      249       +5     
Impacted Files Coverage Δ
storagemarket/impl/client_environments.go 0.00% <0.00%> (ø)
storagemarket/impl/provider_environments.go 2.28% <0.00%> (+2.28%) ⬆️
storagemarket/impl/providerstates/provider_fsm.go 83.34% <0.00%> (-7.57%) ⬇️
storagemarket/impl/requestvalidation/types.go 0.00% <ø> (ø)
storagemarket/types.go 0.00% <ø> (ø)
storagemarket/impl/clientstates/client_fsm.go 95.41% <50.00%> (-4.59%) ⬇️
storagemarket/impl/dtutils/dtutils.go 67.22% <57.15%> (-3.62%) ⬇️
...oragemarket/impl/providerstates/provider_states.go 82.94% <69.24%> (-1.01%) ⬇️
storagemarket/impl/clientstates/client_states.go 86.96% <88.89%> (-0.06%) ⬇️
retrievalmarket/impl/dtutils/dtutils.go 77.46% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf74bf9...e1fe6a6. Read the comment docs.

}),

fsm.Event(storagemarket.ClientEventDataTransferRestarted).
FromMany(storagemarket.StorageDealClientTransferRestart, storagemarket.StorageDealStartDataTransfer).To(storagemarket.StorageDealTransferring).
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should not ideally run when in StorageDealStartDataTransfer right? Why is this in the list?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hannahhoward

We now move from StorageDealStartDataTransfer to StorageDealTransferring only after we see the Accept from the other side.

However, what if the other side sends an accept, we crash before receiving it and then restart. It means the channel exists on both sides and yet, we are restarting in the StorageDealClientTransferRestart state.

}),

fsm.Event(storagemarket.ProviderEventDataTransferRestarted).
FromMany(storagemarket.StorageDealWaitingForData, storagemarket.StorageDealProviderTransferRestart).To(storagemarket.StorageDealTransferring).
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the scenario where this is called in StorageDealWaitingForData?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@hannahhoward

If the provider crashes after the channel is open on it's side but before seeing the corresponding event in the ProviderDataTransferSubscriber, it will never enter the StorageDealTransferring state.

@@ -102,27 +103,30 @@ type MinerDeal struct {

DealID abi.DealID
CreationTime cbg.CborTime

TransferChannelId *datatransfer.ChannelID
Copy link
Collaborator

Choose a reason for hiding this comment

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

On the provider side, we use a pointer to a channelID, while on the client side, we use a channelID value -- what's the rationale for the difference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is an oversight. Let's use pointer on both sides.

@hannahhoward hannahhoward merged commit acfecb0 into master Oct 13, 2020
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.

3 participants