Skip to main content

tikv_client/generated/
errorpb.rs

1// This file is @generated by prost-build.
2/// NotLeader is the error variant that tells a request be handle by raft leader
3/// is sent to raft follower or learner.
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct NotLeader {
7    /// The requested region ID
8    #[prost(uint64, tag = "1")]
9    pub region_id: u64,
10    /// Region leader of the requested region
11    #[prost(message, optional, tag = "2")]
12    pub leader: ::core::option::Option<super::metapb::Peer>,
13}
14/// IsWitness is the error variant that tells a request be handle by witness
15/// which should be forbidden and retry.
16#[allow(clippy::derive_partial_eq_without_eq)]
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct IsWitness {
19    /// The requested region ID
20    #[prost(uint64, tag = "1")]
21    pub region_id: u64,
22}
23/// BucketVersionNotMatch is the error variant that tells the request buckets version is not match.
24/// client should update the buckets version and retry.
25#[allow(clippy::derive_partial_eq_without_eq)]
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct BucketVersionNotMatch {
28    #[prost(uint64, tag = "1")]
29    pub version: u64,
30    #[prost(bytes = "vec", repeated, tag = "2")]
31    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
32}
33#[allow(clippy::derive_partial_eq_without_eq)]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct DiskFull {
36    /// The requested store ID
37    #[prost(uint64, repeated, tag = "1")]
38    pub store_id: ::prost::alloc::vec::Vec<u64>,
39    /// The detailed info
40    #[prost(string, tag = "2")]
41    pub reason: ::prost::alloc::string::String,
42}
43/// StoreNotMatch is the error variant that tells the request is sent to wrong store.
44/// (i.e. inconsistency of the store ID that request shows and the real store ID of this server.)
45#[allow(clippy::derive_partial_eq_without_eq)]
46#[derive(Clone, PartialEq, ::prost::Message)]
47pub struct StoreNotMatch {
48    /// Store id in request
49    #[prost(uint64, tag = "1")]
50    pub request_store_id: u64,
51    /// Actual store id
52    #[prost(uint64, tag = "2")]
53    pub actual_store_id: u64,
54}
55/// RegionNotFound is the error variant that tells there isn't any region in this TiKV
56/// matches the requested region ID.
57#[allow(clippy::derive_partial_eq_without_eq)]
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct RegionNotFound {
60    /// The requested region ID
61    #[prost(uint64, tag = "1")]
62    pub region_id: u64,
63}
64/// RegionNotInitialized is the error variant that tells there isn't any initialized peer
65/// matchesthe request region ID.
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct RegionNotInitialized {
69    /// The request region ID
70    #[prost(uint64, tag = "1")]
71    pub region_id: u64,
72}
73/// KeyNotInRegion is the error variant that tells the key the request requires isn't present in
74/// this region.
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct KeyNotInRegion {
78    /// The requested key
79    #[prost(bytes = "vec", tag = "1")]
80    pub key: ::prost::alloc::vec::Vec<u8>,
81    /// The requested region ID
82    #[prost(uint64, tag = "2")]
83    pub region_id: u64,
84    /// Start key of the requested region
85    #[prost(bytes = "vec", tag = "3")]
86    pub start_key: ::prost::alloc::vec::Vec<u8>,
87    /// Snd key of the requested region
88    #[prost(bytes = "vec", tag = "4")]
89    pub end_key: ::prost::alloc::vec::Vec<u8>,
90}
91/// EpochNotMatch is the error variant that tells a region has been updated.
92/// (e.g. by splitting / merging, or raft Confchange.)
93/// Hence, a command is based on a stale version of a region.
94#[allow(clippy::derive_partial_eq_without_eq)]
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct EpochNotMatch {
97    /// Available regions that may be siblings of the requested one.
98    #[prost(message, repeated, tag = "1")]
99    pub current_regions: ::prost::alloc::vec::Vec<super::metapb::Region>,
100}
101/// ServerIsBusy is the error variant that tells the server is too busy to response.
102#[allow(clippy::derive_partial_eq_without_eq)]
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct ServerIsBusy {
105    #[prost(string, tag = "1")]
106    pub reason: ::prost::alloc::string::String,
107    /// The suggested backoff time
108    #[prost(uint64, tag = "2")]
109    pub backoff_ms: u64,
110    #[prost(uint32, tag = "3")]
111    pub estimated_wait_ms: u32,
112    /// Current applied_index at the leader, may be used in replica read.
113    #[prost(uint64, tag = "4")]
114    pub applied_index: u64,
115}
116/// StaleCommand is the error variant that tells the command is stale, that is,
117/// the current request term is lower than current raft term.
118/// This can be retried at most time.
119#[allow(clippy::derive_partial_eq_without_eq)]
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct StaleCommand {}
122/// RaftEntryTooLarge is the error variant that tells the request is too large to be serialized to a
123/// reasonable small raft entry.
124/// (i.e. greater than the configured value `raft_entry_max_size` in `raftstore`)
125#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct RaftEntryTooLarge {
128    /// The requested region ID
129    #[prost(uint64, tag = "1")]
130    pub region_id: u64,
131    /// Size of the raft entry
132    #[prost(uint64, tag = "2")]
133    pub entry_size: u64,
134}
135/// MaxTimestampNotSynced is the error variant that tells the peer has just become a leader and
136/// updating the max timestamp in the concurrency manager from PD TSO is ongoing. In this case,
137/// the prewrite of an async commit transaction cannot succeed. The client can backoff and
138/// resend the request.
139#[allow(clippy::derive_partial_eq_without_eq)]
140#[derive(Clone, PartialEq, ::prost::Message)]
141pub struct MaxTimestampNotSynced {}
142/// ReadIndexNotReady is the error variant that tells the read index request is not ready, that is,
143/// the current region is in a status that not ready to serve the read index request. For example,
144/// region is in splitting or merging status.
145/// This can be retried at most time.
146#[allow(clippy::derive_partial_eq_without_eq)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct ReadIndexNotReady {
149    /// The reason why the region is not ready to serve read index request
150    #[prost(string, tag = "1")]
151    pub reason: ::prost::alloc::string::String,
152    /// The requested region ID
153    #[prost(uint64, tag = "2")]
154    pub region_id: u64,
155}
156/// ProposalInMergingMode is the error variant that tells the proposal is rejected because raft is
157/// in the merging mode. This may happen when BR/Lightning try to ingest SST.
158/// This can be retried at most time.
159#[allow(clippy::derive_partial_eq_without_eq)]
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct ProposalInMergingMode {
162    /// The requested region ID
163    #[prost(uint64, tag = "1")]
164    pub region_id: u64,
165}
166#[allow(clippy::derive_partial_eq_without_eq)]
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct DataIsNotReady {
169    /// The requested region ID
170    #[prost(uint64, tag = "1")]
171    pub region_id: u64,
172    #[prost(uint64, tag = "2")]
173    pub peer_id: u64,
174    #[prost(uint64, tag = "3")]
175    pub safe_ts: u64,
176}
177#[allow(clippy::derive_partial_eq_without_eq)]
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct RecoveryInProgress {
180    /// The requested region ID
181    #[prost(uint64, tag = "1")]
182    pub region_id: u64,
183}
184#[allow(clippy::derive_partial_eq_without_eq)]
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct FlashbackInProgress {
187    /// The requested region ID
188    #[prost(uint64, tag = "1")]
189    pub region_id: u64,
190    #[prost(uint64, tag = "2")]
191    pub flashback_start_ts: u64,
192}
193#[allow(clippy::derive_partial_eq_without_eq)]
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct FlashbackNotPrepared {
196    /// The requested region ID
197    #[prost(uint64, tag = "1")]
198    pub region_id: u64,
199}
200/// MismatchPeerId is the error variant that tells the request is sent to wrong peer.
201/// Client receives this error should reload the region info and retry.
202#[allow(clippy::derive_partial_eq_without_eq)]
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct MismatchPeerId {
205    #[prost(uint64, tag = "1")]
206    pub request_peer_id: u64,
207    #[prost(uint64, tag = "2")]
208    pub store_peer_id: u64,
209}
210/// Error wraps all region errors, indicates an error encountered by a request.
211#[allow(clippy::derive_partial_eq_without_eq)]
212#[derive(Clone, PartialEq, ::prost::Message)]
213pub struct Error {
214    /// The error message
215    #[prost(string, tag = "1")]
216    pub message: ::prost::alloc::string::String,
217    #[prost(message, optional, tag = "2")]
218    pub not_leader: ::core::option::Option<NotLeader>,
219    #[prost(message, optional, tag = "3")]
220    pub region_not_found: ::core::option::Option<RegionNotFound>,
221    #[prost(message, optional, tag = "4")]
222    pub key_not_in_region: ::core::option::Option<KeyNotInRegion>,
223    #[prost(message, optional, tag = "5")]
224    pub epoch_not_match: ::core::option::Option<EpochNotMatch>,
225    #[prost(message, optional, tag = "6")]
226    pub server_is_busy: ::core::option::Option<ServerIsBusy>,
227    #[prost(message, optional, tag = "7")]
228    pub stale_command: ::core::option::Option<StaleCommand>,
229    #[prost(message, optional, tag = "8")]
230    pub store_not_match: ::core::option::Option<StoreNotMatch>,
231    #[prost(message, optional, tag = "9")]
232    pub raft_entry_too_large: ::core::option::Option<RaftEntryTooLarge>,
233    #[prost(message, optional, tag = "10")]
234    pub max_timestamp_not_synced: ::core::option::Option<MaxTimestampNotSynced>,
235    #[prost(message, optional, tag = "11")]
236    pub read_index_not_ready: ::core::option::Option<ReadIndexNotReady>,
237    #[prost(message, optional, tag = "12")]
238    pub proposal_in_merging_mode: ::core::option::Option<ProposalInMergingMode>,
239    #[prost(message, optional, tag = "13")]
240    pub data_is_not_ready: ::core::option::Option<DataIsNotReady>,
241    #[prost(message, optional, tag = "14")]
242    pub region_not_initialized: ::core::option::Option<RegionNotInitialized>,
243    #[prost(message, optional, tag = "15")]
244    pub disk_full: ::core::option::Option<DiskFull>,
245    /// Online recovery is still in performing, reject writes to avoid potential issues
246    #[prost(message, optional, tag = "16")]
247    pub recovery_in_progress: ::core::option::Option<RecoveryInProgress>,
248    /// Flashback is still in performing, reject any read or write to avoid potential issues.
249    /// NOTICE: this error is non-retryable, the request should fail ASAP when it meets this error.
250    #[prost(message, optional, tag = "17")]
251    pub flashback_in_progress: ::core::option::Option<FlashbackInProgress>,
252    /// If the second phase flashback request is sent to a region that is not prepared for the flashback,
253    /// this error will be returned.
254    /// NOTICE: this error is non-retryable, the client should retry the first phase flashback request when it meets this error.
255    #[prost(message, optional, tag = "18")]
256    pub flashback_not_prepared: ::core::option::Option<FlashbackNotPrepared>,
257    /// IsWitness is the error variant that tells a request be handle by witness
258    /// which should be forbidden and retry.
259    #[prost(message, optional, tag = "19")]
260    pub is_witness: ::core::option::Option<IsWitness>,
261    #[prost(message, optional, tag = "20")]
262    pub mismatch_peer_id: ::core::option::Option<MismatchPeerId>,
263    /// BucketVersionNotMatch is the error variant that tells the request buckets version is not match.
264    #[prost(message, optional, tag = "21")]
265    pub bucket_version_not_match: ::core::option::Option<BucketVersionNotMatch>,
266}