BBVA / qed

The scalable, auditable and high-performance tamper-evident log project
https://qed.readthedocs.io/
Apache License 2.0
96 stars 19 forks source link

Remove snapshot channel from the FSM #94

Closed aalda closed 5 years ago

aalda commented 5 years ago

The process of sending newer snapshots to the snapshot channel (now named agentsQueue) after inserting the event into the balloon must get removed out the critical path of the insertion operation.

Given that the process of applying changes to the FSM is executed in a serialized way with one single thread, the queuing could lead to a potential stalling situation if the channel gets full. Snapshots should be sent to the channel after committing the command into the WAL, just after resolving the Apply future in the Raft node. This way, the goroutine that handles the HTTP request is responsible for the sending the snapshots freeing up the Raft applying thread.