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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
use PhantomData;
use crateRaftTypeConfig;
use crateVoteOf;
/// **REMOVED**: Use `openraft_legacy::network_v1::InstallSnapshotRequest` instead.
///
/// The v1 chunk-based `InstallSnapshotRequest` has been moved to the `openraft-legacy` crate.
///
/// # Migration
///
/// Add to `Cargo.toml`:
/// ```toml
/// [dependencies]
/// openraft-legacy = "0.10"
/// ```
///
/// A transport that serializes the request with Serde enables the `serde` feature of
/// `openraft-legacy`, which also enables `openraft/serde`:
/// ```toml
/// [dependencies]
/// openraft-legacy = { version = "0.10", features = ["serde"] }
/// ```
///
/// The moved type derives `Serialize` and `Deserialize` only with this feature: `openraft/serde`
/// derived them in 0.9 and no longer does. A transport that encodes the request without Serde
/// does not need the feature.
///
/// Update imports:
/// ```ignore
/// use openraft_legacy::network_v1::InstallSnapshotRequest;
/// ```
/// **REMOVED**: Use `openraft_legacy::network_v1::InstallSnapshotResponse` instead.
///
/// The v1 chunk-based `InstallSnapshotResponse` has been moved to the `openraft-legacy` crate.
///
/// # Migration
///
/// Add to `Cargo.toml`:
/// ```toml
/// [dependencies]
/// openraft-legacy = "0.10"
/// ```
///
/// A transport that serializes the response with Serde enables the `serde` feature of
/// `openraft-legacy`, which also enables `openraft/serde`:
/// ```toml
/// [dependencies]
/// openraft-legacy = { version = "0.10", features = ["serde"] }
/// ```
///
/// The moved type derives `Serialize` and `Deserialize` only with this feature: `openraft/serde`
/// derived them in 0.9 and no longer does. A transport that encodes the response without Serde
/// does not need the feature.
///
/// Update imports:
/// ```ignore
/// use openraft_legacy::network_v1::InstallSnapshotResponse;
/// ```
/// The response to [`Raft::install_full_snapshot()`], which the leader receives as the result of
/// [`NetSnapshot::full_snapshot()`].
///
/// The target returns a response, not an error, also when it rejects the leader, so the
/// response's [`vote`](Self::vote) tells the outcome. Compared with the leader's vote in the
/// request, it is:
///
/// - equal if the target accepted the leader: the target installed the snapshot, or already had
/// every log it covers. The response does not tell which.
/// - greater if the target rejected the leader: the target did not install the snapshot.
///
/// [`Raft::install_full_snapshot()`] describes when the target returns each response, and
/// [`NetSnapshot::full_snapshot()`] what the leader records for it.
///
/// A transport forwards the response that [`Raft::install_full_snapshot()`] returned to the leader
/// unchanged. Do not build one from a vote read elsewhere, such as [`RaftMetrics::vote`], which
/// can lag behind the response: an older vote can turn a rejection into a success.
///
/// [`Raft::install_full_snapshot()`]: crate::Raft::install_full_snapshot
/// [`NetSnapshot::full_snapshot()`]: crate::network::NetSnapshot::full_snapshot
/// [`RaftMetrics::vote`]: crate::RaftMetrics::vote