You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Run SaveABCIResponses and Commit in parallel #3290
Currently both SaveABCIResponses and Commit are ran in sequence during ApplyBlock. I think we should run these in parallel, as they both have I/O and CPU logic. Especially as SaveABCIResponses can increase in time.
Problem Definition
Certain things like large event loads or Beginblock/Endblock loads, can make the SaveABCIResponses time quite expensive. So we want to lower the amount of time spent on this in the critical path.
Proposal
Start SaveABCIResponses and app.Commit in parallel in blockexecutor.ApplyBlock
This may be my naiveness, I thought this call (after Commit completes) is what handles crash recovery (makes us not re-run commit), which is here: blockExec.store.Save(state)
Before touching "delicate" parts of the code, we would like to see evidence, via profiling, that the (big?) performance improvement is worth the risk of changing this part of the code, just as we did with many other improvements that @ValarDragon initiated. One important risk being on the crash-recovery mechanism pointed out by @cason, which isn't easy to test exhaustively, and -- to this day -- isn't well specified either.
We would need to check whether this is used during recovery or not.
It is, and we are planning to refactor that part of the code (now that the SDK accepted to return the app hash in FinalizeBlock rather than in Commit). The current logic there is in quite a messy state TBH. Once that code gets cleaner, we can re-evaluate the change proposed in this issue (or even get rid of saving ABCI responses altogether).
Activity
cason commentedon Jun 19, 2024
How would this impact on recovery?
What the node crashes after
Commitwas executed but the ABCI responses were not yet persisted?ValarDragon commentedon Jun 19, 2024
This may be my naiveness, I thought this call (after Commit completes) is what handles crash recovery (makes us not re-run commit), which is here:
blockExec.store.Save(state)
cason commentedon Jun 21, 2024
I sincerely don't know why we write ABCI responses in a different DB/schema. We would need to check whether this is used during recovery or not.
sergio-mena commentedon Jul 22, 2024
Before touching "delicate" parts of the code, we would like to see evidence, via profiling, that the (big?) performance improvement is worth the risk of changing this part of the code, just as we did with many other improvements that @ValarDragon initiated. One important risk being on the crash-recovery mechanism pointed out by @cason, which isn't easy to test exhaustively, and -- to this day -- isn't well specified either.
sergio-mena commentedon Jul 22, 2024
It is, and we are planning to refactor that part of the code (now that the SDK accepted to return the app hash in
FinalizeBlockrather than inCommit). The current logic there is in quite a messy state TBH. Once that code gets cleaner, we can re-evaluate the change proposed in this issue (or even get rid of saving ABCI responses altogether).fix(tm2): fsync the ABCI responses record and stop the block when its…
Sync develop with upstream master after the batch port (#49)