Skip to content

Commit 6dce82e

Browse files
committed
Explain why last_applied is initialised to -1
[#164375485]
1 parent a81ce66 commit 6dce82e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rabbit_fifo_client.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
servers = [] :: [ra_server_id()],
6666
leader :: maybe(ra_server_id()),
6767
next_seq = 0 :: seq(),
68+
%% Last applied is initialise to -1 to note that no command has yet been
69+
%% applied, but allowing to resend messages if the first ones on the sequence
70+
%% are lost (messages are sent from last_applied + 1)
6871
last_applied = -1 :: maybe_seq(),
6972
next_enqueue_seq = 1 :: seq(),
7073
%% indicates that we've exceeded the soft limit

0 commit comments

Comments
 (0)