-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
storagefsm: Rewrite input handling #5375
Conversation
bb0f31b
to
ad3aae1
Compare
3ce30b6
to
43184b4
Compare
43184b4
to
1336d88
Compare
extern/storage-sealing/input.go
Outdated
} | ||
|
||
m.inputLk.Lock() | ||
if _, exist := m.pendingPieces[*deal.PublishCid]; exist { |
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.
Doing this by publishcid is very broken with multiple deals per message, needs fixing
Another bug this has:
|
(did a bunch of manual testing on my miner, it seems to work quite well now) |
I think we need to figure out a way to make the FSM more expressive, it is still a lot of boilerplate. |
return true, ctx.Send(SectorStartPacking{}) | ||
} | ||
|
||
if used.Padded() == abi.PaddedPieceSize(ssize) { |
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 should probably have some leeway, there is no reason to wait for the timeout because there is room for a 10byte deal.
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.
Well, you,ll never have less than the minimum deal size free, which is already configurable - but yes, we could add a separate config for this
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.
Weak 👍 from me, with the code moving from one file to the other (and there not being a good commit to look at the changes to the moved code) review is harder than it could be.
Also, there are few TODOs in the code, it would be awesome if they got their own issue so if we ever hit these todos we can refer to them.
34d5081
to
dd82729
Compare
…efactor-fsm-input storagefsm: Rewrite input handling
Closes #5356
The main goal here is to enable ingesting deal data in parallel - the old storagefsm interface had a global lock which meant that only one deal could be added to a sector at a time. It also wasn't very robust and could create corrupted sectors if the miner process was restarted at a wrong time (this PR doesn't fully solve this issue, but it makes it much better. Full fix will come in a followup PR and will require changing some worker APIs)
With this PR up to configured
Sealing.MaxWaitDealsSectors
deals can be processed in parallel (before it was only possible to process one deal in parallel per lotus-miner)Status
(Probably should land soon after v1.5.0 as it's a rather big refactor, so putting it in a mandatory release may not be a good idea)