Skip to content

Commit ab09100

Browse files
hsun324meta-codesync[bot]
authored andcommitted
Remove commit command variant without priority
Summary: Remove the legacy variant of the commit command that does not include the priority of the commit. Reviewed By: jaher Differential Revision: D86687945 fbshipit-source-id: f5384ec3cf3af30009a919db3dda7c5e8b2be606
1 parent 7ec2cdd commit ab09100

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

include/wa_raft_rpc.hrl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474

7575
-define(RAFT_COMMAND(Type, Payload), {command, Type, Payload}).
7676

77-
-define(LEGACY_COMMIT_COMMAND(From, Op), ?RAFT_COMMAND(commit, {From, Op})).
7877
-define(COMMIT_COMMAND(From, Op, Priority), ?RAFT_COMMAND(commit, {From, Op, Priority})).
7978
-define(READ_COMMAND(Op), ?RAFT_COMMAND(read, Op)).
8079

src/wa_raft_server.erl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,11 @@
260260
-type legacy_rpc() :: ?LEGACY_RAFT_RPC(atom(), wa_raft_log:log_term(), node(), undefined | tuple()).
261261
-type rpc_named() :: ?RAFT_NAMED_RPC(atom(), wa_raft_log:log_term(), atom(), node(), undefined | tuple()).
262262

263-
-type command() :: legacy_commit_command() | commit_command() | read_command() | status_command() | trigger_election_command() |
263+
-type command() :: commit_command() | read_command() | status_command() | trigger_election_command() |
264264
promote_command() | resign_command() | adjust_membership_command() | refresh_config_command() |
265265
snapshot_available_command() | handover_candidates_command() | handover_command() |
266266
enable_command() | disable_command() | bootstrap_command() | notify_complete_command().
267267

268-
-type legacy_commit_command() :: ?LEGACY_COMMIT_COMMAND(gen_server:from(), wa_raft_acceptor:op()).
269268
-type commit_command() :: ?COMMIT_COMMAND(gen_server:from(), wa_raft_acceptor:op(), wa_raft_acceptor:priority()).
270269
-type read_command() :: ?READ_COMMAND(wa_raft_acceptor:read_op()).
271270
-type status_command() :: ?STATUS_COMMAND.
@@ -1205,8 +1204,6 @@ leader(state_timeout, _, #raft_state{application = App} = State0) ->
12051204
%% of the local node, then immediately apply the commit. Otherwise, if a
12061205
%% handover is not in progress, then immediately append the pending list if
12071206
%% enough pending commit requests have accumulated.
1208-
leader(cast, ?LEGACY_COMMIT_COMMAND(From, Op), State) ->
1209-
?MODULE:leader(cast, ?COMMIT_COMMAND(From, Op, high), State);
12101207
leader(
12111208
cast,
12121209
?COMMIT_COMMAND(From, Op, Priority),
@@ -1947,8 +1944,6 @@ witness(Type, Event, #raft_state{} = State) ->
19471944
) -> gen_statem:event_handler_result(state(), #raft_state{}).
19481945

19491946
%% [Commit] Non-leader nodes should fail commits with {error, not_leader}.
1950-
command(State, cast, ?LEGACY_COMMIT_COMMAND(From, Op), Data) ->
1951-
command(State, cast, ?COMMIT_COMMAND(From, Op, high), Data);
19521947
command(
19531948
State,
19541949
cast,

0 commit comments

Comments
 (0)