The cowsql code needs to immediately detect when leadership lost after a raft_step() call, in order to close all client connections. So far, this has been done using a uv_prepare handle, but that is unreliable, since a lot of data might accumulate in the kernel TCP buffers when for example the process is paused (e.g. by the Jepsen nemesis), and the prepare handle does not have a chance to run.
This branch also fixes a few other bugs that were surfaced by Jepsen tests.
The cowsql code needs to immediately detect when leadership lost after a
raft_step()
call, in order to close all client connections. So far, this has been done using auv_prepare
handle, but that is unreliable, since a lot of data might accumulate in the kernel TCP buffers when for example the process is paused (e.g. by the Jepsen nemesis), and the prepare handle does not have a chance to run.This branch also fixes a few other bugs that were surfaced by Jepsen tests.