Skip to content

Commit 2776166

Browse files
hsun324facebook-github-bot
authored andcommitted
Support avoiding some deserialization overhead when issuing heartbeats
Summary: Add support for log providers to define a callback that folds over log entries encoded in external term format and to append log entries sent from a leader to a follower without being decoded on the leader. This scheme can help some types of log provider implementations avoid deserialization overheads on leaders sending heartbeats to followers. Reviewed By: jaher Differential Revision: D76298284 Privacy Context Container: L1141030 fbshipit-source-id: 7aeeb3c08a88bd03203b7808d6c3918233deec13
1 parent f0d69e0 commit 2776166

File tree

5 files changed

+269
-121
lines changed

5 files changed

+269
-121
lines changed

include/wa_raft.hrl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@
260260
(?RAFT_APP_CONFIG(App, {?RAFT_LOG_ROTATION_BY_TRIM_INDEX, use_trim_index}, false) =:= true)
261261
).
262262

263+
%% Whether or not the log should return entries in external term format
264+
%% when log entries are fetched for heartbeats
265+
-define(RAFT_LOG_HEARTBEAT_BINARY_ENTRIES, raft_log_heartbeat_binary_entries).
266+
-define(RAFT_LOG_HEARTBEAT_BINARY_ENTRIES(App),
267+
(?RAFT_APP_CONFIG(App, ?RAFT_LOG_HEARTBEAT_BINARY_ENTRIES, false) =:= true)
268+
).
269+
263270
%% Whether or not the RAFT server should use any special catchup strategy to bring peers back in sync.
264271
-define(RAFT_CATCHUP_ENABLED, raft_catchup_enabled).
265272
-define(RAFT_CATCHUP_ENABLED(App), (?RAFT_APP_CONFIG(App, {?RAFT_CATCHUP_ENABLED, catchup_enabled}, true) =/= false)).

0 commit comments

Comments
 (0)