Commit edf417f6 authored by Willem Thiart's avatar Willem Thiart
Browse files

Remove entry->id != 0 check

parent fb7da237
......@@ -101,9 +101,6 @@ int log_append_entry(log_t* me_, raft_entry_t* c)
log_private_t* me = (log_private_t*)me_;
int e = 0;
if (0 == c->id)
return -1;
__ensurecapacity(me);
if (me->cb && me->cb->log_offer)
......
......@@ -126,22 +126,6 @@ void TestRaft_server_starts_with_request_timeout_of_200ms(CuTest * tc)
CuAssertTrue(tc, 200 == raft_get_request_timeout(r));
}
void TestRaft_server_entry_append_cant_append_if_id_is_zero(CuTest* tc)
{
raft_entry_t ety = {};
char *str = "aaa";
ety.data.buf = str;
ety.data.len = 3;
ety.id = 0;
ety.term = 1;
void *r = raft_new();
CuAssertTrue(tc, 0 == raft_get_current_idx(r));
raft_append_entry(r, &ety);
CuAssertTrue(tc, 0 == raft_get_current_idx(r));
}
void TestRaft_server_entry_append_increases_logidx(CuTest* tc)
{
raft_entry_t ety = {};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment