# Walk through what happens in fallback path of token dispatch, i.e. we don't
# have raft messages to piggy token returns on top of but we then fire one-off
# messages to deliver tokens.

init
----

# Set up two nodes, each with one store.
add node=n1 store=s1
----

add node=n2 store=s2
----

# Send a raft message for r1 from n1 to n2 and vice versa, each node holding a
# replica with id=1,2 respectively. We do this to create the non-idle connect
# between the two nodes (it's done on demand).
send range=r1 from=n1/s1/1 to=n2/s2/2 commit=1
----

send range=r1 from=n2/s2/2 to=n1/s1/1 commit=1
----

dispatch from=n2
node=n1 store=s1 range=r1 pri=normal-pri up-to-log-position=6/20
node=n1 store=s1 range=r1 pri=low-pri    up-to-log-position=6/21
----

# Note that they're still pending delivery.
pending-dispatch from=n2 to=n1
----
range=r1 pri=low-pri store=s1 up-to-log-position=log-position=6/21
range=r1 pri=normal-pri store=s1 up-to-log-position=log-position=6/20

fallback-dispatch from=n2
----

# Note that there are no more pending dispatches, and not because they were
# dropped.
pending-dispatch from=n2 to=n1
----

metrics
----
node=n1: dispatches-dropped=0
node=n2: dispatches-dropped=0

# vim:ft=sh
