From e5d3c84ac197e7fd450d181db6b4e604fa80e97f Mon Sep 17 00:00:00 2001 From: Yossi Gottlieb Date: Sun, 4 Mar 2018 15:09:38 +0200 Subject: [PATCH] Add a per-entry custom user data field. This is useful to allow leaders to pass context between raft_recv_entry() and a subsequent execution of the entry (after it was committed) as an applylog callback. This allows an optimized use pattern when entries received locally on the leader can be used without going through an unnecessary deserialization. --- include/raft.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/raft.h b/include/raft.h index 7a8953c7..c7911de0 100644 --- a/include/raft.h +++ b/include/raft.h @@ -89,6 +89,9 @@ typedef struct /** type of entry */ int type; + /** private local data */ + void *user_data; + raft_entry_data_t data; } raft_entry_t;