1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use fmt;
use Formatter;
use Deref;
/// Identifies the leader's progress entry for one replication target, and with it the replication
/// stream that serves that target.
///
/// The leader allocates a new `StreamId` whenever it creates the progress entry of a target: for
/// every target when it becomes leader, and for each target that a membership change adds. The ID
/// stays the same for as long as the entry exists, over many [`InflightId`] operations such as
/// probes, snapshots and `LogsSince` streams.
///
/// Every replication and heartbeat progress notification carries the ID.
/// [`Leader::is_replication_stream_valid`] accepts a notification only when the ID matches the
/// target's current entry. So when a target is removed and added again, a delayed notification
/// from its old stream is ignored before the engine looks at its `InflightId`.
///
/// [`InflightId`]: crate::progress::inflight_id::InflightId
/// [`Leader::is_replication_stream_valid`]: crate::proposer::Leader::is_replication_stream_valid
pub