@@ -303,9 +305,8 @@ For this callback we have to serialize a ``msg_appendentries_t`` struct, and the
assert(0 == e);
bufs[1].len = sz;
bufs[1].base = ptr;
e = uv_write(&conn->write, conn->stream, bufs, 2, __peer_write_cb);
if (-1 == e)
e = uv_try_write(conn->stream, bufs, 2);
if (e < 0)
uv_fatal(e);
tpl_free(tn);
...
...
@@ -313,8 +314,8 @@ For this callback we have to serialize a ``msg_appendentries_t`` struct, and the
else
{
/* keep alive appendentries only */
e = uv_write(&conn->write, conn->stream, bufs, 1, __peer_write_cb);
if (-1 == e)
e = uv_try_write(conn->stream, bufs, 1);
if (e < 0)
uv_fatal(e);
}
...
...
@@ -324,7 +325,7 @@ For this callback we have to serialize a ``msg_appendentries_t`` struct, and the
**applylog()**
This callback is all what is needed to interface the FSM with the Raft library.
This callback is all what is needed to interface the FSM with the Raft library. Depending on your application, you might want to save the commit_idx to disk inside this callback.
**persist_vote() & persist_term()**
...
...
@@ -388,5 +389,4 @@ The table below shows the structs that you need to deserialize-to or deserialize