# Observe how the integration layer deals with replicas being destroyed.
# followers. Typically replicas being destroyed first lose raft leadership
# and/or observe themselves being removed from the range descriptor. For those
# variants, see replica_raft_leadership and replica_removed_self.
#
# Start off with a triply replicated range r1/t1, with replicas on n1/s1,
# n2/s2, and n3/s3 (with replica IDs 1-3 respectively).
init tenant=t1 range=r1 replid=1
----

state descriptor=(1,2,3) applied=1/10
----

# Set up replid=1 (declared in init above) to be the raft leader. It should
# connect to all three replication streams.
integration op=became-leader
----
initialized flow control handle for r1/t1
connected to replication stream t1/s1 starting at log-position=1/10
disconnected from replication stream t1/s2
disconnected from replication stream t1/s3
connected to replication stream t1/s2 starting at log-position=1/10
connected to replication stream t1/s3 starting at log-position=1/10

# Destroy the replica without first losing raft leadership (we didn't use
# 'integration op=became-follower') or observing itself being removed from the
# range ('integration op=desc-changed'). We should just close the handle,
# disconnecting all underlying streams.
integration op=destroyed
----
closed flow control handle for r1/t1

# vim:ft=sh
