Skip to content

Commit 36ea164

Browse files
patelarjavmeta-codesync[bot]
authored andcommitted
Incremenet correct queue depending on priority
Summary: We need to increment the correct queue when starting a commit Reviewed By: jaher Differential Revision: D85927112 fbshipit-source-id: c45768f15e2be474e4ef8f6ebb9ed883d4f83646
1 parent 94c9bcc commit 36ea164

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/wa_raft_queue.erl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,14 @@ commit_started(#queues{counters = Counters} = Queues, Priority) ->
236236
true ->
237237
apply_queue_full;
238238
false ->
239-
PendingCommits = atomics:add_get(Counters, ?RAFT_HIGH_PRIORITY_COMMIT_QUEUE_SIZE_COUNTER, 1),
240-
?RAFT_GATHER('raft.acceptor.commit.request.pending', PendingCommits),
239+
PendingCommits =
240+
case Priority of
241+
high ->
242+
atomics:add_get(Counters, ?RAFT_HIGH_PRIORITY_COMMIT_QUEUE_SIZE_COUNTER, 1);
243+
low ->
244+
atomics:add_get(Counters, ?RAFT_LOW_PRIORITY_COMMIT_QUEUE_SIZE_COUNTER, 1)
245+
end,
246+
?RAFT_GATHER({'raft.acceptor.commit.request.pending', Priority}, PendingCommits),
241247
ok
242248
end
243249
end.

0 commit comments

Comments
 (0)