Reorg-pdpv0-cleanup-task#1213
Conversation
LexLuthr
left a comment
There was a problem hiding this comment.
We should rethink this approach. Whole Eth tx subsystem if forced to be 1 epoch only. it seems unfair that we only care about reverts for PDPv0. This task should be part of message tasks and should works on a much bigger scale. Reverts should also be checked by how forks are detected instead of missing message or receipts. Current method is not a reliable one.
|
Reverting after reorg:
After all this we still have issues from newer messages landing on chain correctly after a reorg and taking up dataSet IDs and pieceIDs. We also need to account for that. We need to understand impact of and guard against user mistakes like importing wrong snapshot, long running forks, bad build, What we really need to question is: Is this worth doing with so many conditions instead of just removing the bad data? |
|
@LexLuthr Since we are going for clean-up rather than re-run, most just erase the ask from DB. Delete is the most sensitive because our deleter must be chain-aware. |
LexLuthr
left a comment
There was a problem hiding this comment.
We need to account for some missing chain reorg caveats here. I would also suggest checking what impact 8 hour time line has on proving subsystem. AFAIK, we would have faulted by then and this might not even be adding any value to it.
|
@LexLuthr I see some conflicting things here. I thought this was a "clean-up" task, but If we reduce it to 5 blocks, we are making a guess about reorgs & not solving clean-up unless we "permit" failures for longer (more tables & states). If we run less frequently than proving period (30m?), they'll see a fault. A high volume of uploads cannot get chain walks one-by-one, so this must be a batched operation. I see these options: B: "Two bumps each" C: "Fewest faults, gambling on definition of reorg" These each do something different. I could see a world with A & partial-C being useful. You seem to not want me to build "A". Where do I go from here? |
|
To anchor the conversation a little just an FYI that lotus handles reorgs in a best effort way by re-inserting messages into the mpool whenever it notices a head change reverting its local chain: https://github.com/filecoin-project/lotus/blob/master/chain/messagepool/messagepool.go#L1298 While it's true that things can go wrong and messages can be missed, note that the original motivation for issue #970 is purely theoretical at this point. We've never observed to my knowledge messages getting mysteriously missed after confirmation. All of this to say -- its great to be paranoid and have something to handle long tail risk. But let's not boil the ocean. |
ZenGround0
left a comment
There was a problem hiding this comment.
I'll finish later today. So far I like what I see
|
I suspect this will happen one random day in a few months, and by the time we look at BetterStack traces, everything will have cleared up with the 7.5h Finality. |
ZenGround0
left a comment
There was a problem hiding this comment.
At this point I don't see a reason to block.
ZenGround0
left a comment
There was a problem hiding this comment.
Oh I had missed this
Create and Add Message: Affects data tables, piece tables, index, IPNI records. We also need to be careful with pdp_pieceref table here. Due design choices there is no guarantee that ref now does not have a correct piece attached to it. Ideally, we should use delete flow (modified) for this to be reliable.
Add Message: Same suggestion as above
I agree this is a problem. My suggestion would be to only handle reorgs of creates and deletes (deletes were kind of the original scope of the issue). If you want to go with a full solution here then I think you do need to think about index, ipni and using a delete flow for DB state is probably the way to go.
This creates a whole new set of scope.
Again, until we have a working delete flow, I cannot modify it for either of these needs. |
|
Currently blocked by #1239 landing |
We're going to move forward landing this ~ as is and plug in full deletion pipeline integration in a follow on issue. The main reasons being that
|
I've switched to log-only under a dedicated logger for easy locating. |
|
from claude review 1. Main candidate SELECT blows up
|
This task ensures messages are on chain or otherwise alerts about the related rows for FUTURE clean-up processes to delete disk data.
Proposed as situation monitoring for theoretical problem #970