Skip to main content

tikv_client/generated/
kvrpcpb.rs

1// This file is @generated by prost-build.
2/// A transactional get command. Lookup a value for `key` in the transaction with
3/// starting timestamp = `version`.
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct GetRequest {
7    #[prost(message, optional, tag = "1")]
8    pub context: ::core::option::Option<Context>,
9    #[prost(bytes = "vec", tag = "2")]
10    pub key: ::prost::alloc::vec::Vec<u8>,
11    #[prost(uint64, tag = "3")]
12    pub version: u64,
13}
14#[allow(clippy::derive_partial_eq_without_eq)]
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct GetResponse {
17    /// A region error indicates that the request was sent to the wrong TiKV node
18    /// (or other, similar errors).
19    #[prost(message, optional, tag = "1")]
20    pub region_error: ::core::option::Option<super::errorpb::Error>,
21    /// A value could not be retrieved due to the state of the database for the requested key.
22    #[prost(message, optional, tag = "2")]
23    pub error: ::core::option::Option<KeyError>,
24    /// A successful result.
25    #[prost(bytes = "vec", tag = "3")]
26    pub value: ::prost::alloc::vec::Vec<u8>,
27    /// True if the key does not exist in the database.
28    #[prost(bool, tag = "4")]
29    pub not_found: bool,
30    /// Time and scan details when processing the request.
31    #[prost(message, optional, tag = "6")]
32    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
33}
34/// Scan fetches values for a range of keys; it is part of the transaction with
35/// starting timestamp = `version`.
36#[allow(clippy::derive_partial_eq_without_eq)]
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct ScanRequest {
39    #[prost(message, optional, tag = "1")]
40    pub context: ::core::option::Option<Context>,
41    #[prost(bytes = "vec", tag = "2")]
42    pub start_key: ::prost::alloc::vec::Vec<u8>,
43    /// The maximum number of results to return.
44    #[prost(uint32, tag = "3")]
45    pub limit: u32,
46    #[prost(uint64, tag = "4")]
47    pub version: u64,
48    /// Return only the keys found by scanning, not their values.
49    #[prost(bool, tag = "5")]
50    pub key_only: bool,
51    #[prost(bool, tag = "6")]
52    pub reverse: bool,
53    /// For compatibility, when scanning forward, the range to scan is \[start_key, end_key), where start_key \< end_key;
54    /// and when scanning backward, it scans \[end_key, start_key) in descending order, where end_key \< start_key.
55    #[prost(bytes = "vec", tag = "7")]
56    pub end_key: ::prost::alloc::vec::Vec<u8>,
57    /// If sample_step > 0, skips 'sample_step - 1' number of keys after each returned key.
58    /// locks are not checked.
59    #[prost(uint32, tag = "8")]
60    pub sample_step: u32,
61}
62#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct ScanResponse {
65    #[prost(message, optional, tag = "1")]
66    pub region_error: ::core::option::Option<super::errorpb::Error>,
67    /// Each KvPair may contain a key error.
68    #[prost(message, repeated, tag = "2")]
69    pub pairs: ::prost::alloc::vec::Vec<KvPair>,
70    /// This KeyError exists when some key is locked but we cannot check locks of all keys.
71    /// In this case, `pairs` should be empty and the client should redo scanning all the keys
72    /// after resolving the lock.
73    #[prost(message, optional, tag = "3")]
74    pub error: ::core::option::Option<KeyError>,
75}
76/// A prewrite is the first phase of writing to TiKV. It contains all data to be written in a transaction.
77/// TiKV will write the data in a preliminary state. Data cannot be read until it has been committed.
78/// The client should only commit a transaction once all prewrites succeed.
79#[allow(clippy::derive_partial_eq_without_eq)]
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct PrewriteRequest {
82    #[prost(message, optional, tag = "1")]
83    pub context: ::core::option::Option<Context>,
84    /// The data to be written to the database.
85    #[prost(message, repeated, tag = "2")]
86    pub mutations: ::prost::alloc::vec::Vec<Mutation>,
87    /// The client picks one key to be primary (unrelated to the primary key concept in SQL). This
88    /// key's lock is the source of truth for the state of a transaction. All other locks due to a
89    /// transaction will point to the primary lock.
90    #[prost(bytes = "vec", tag = "3")]
91    pub primary_lock: ::prost::alloc::vec::Vec<u8>,
92    /// Identifies the transaction being written.
93    #[prost(uint64, tag = "4")]
94    pub start_version: u64,
95    #[prost(uint64, tag = "5")]
96    pub lock_ttl: u64,
97    /// TiKV can skip some checks, used for speeding up data migration.
98    #[prost(bool, tag = "6")]
99    pub skip_constraint_check: bool,
100    /// For pessimistic transaction, some mutations don't need to be locked, for example, non-unique index key.
101    /// Keys with deferred constraint checks are not locked.
102    #[prost(enumeration = "prewrite_request::PessimisticAction", repeated, tag = "7")]
103    pub pessimistic_actions: ::prost::alloc::vec::Vec<i32>,
104    /// How many keys this transaction involves in this region.
105    #[prost(uint64, tag = "8")]
106    pub txn_size: u64,
107    /// For pessimistic transactions only; used to check if a conflict lock is already committed.
108    #[prost(uint64, tag = "9")]
109    pub for_update_ts: u64,
110    /// If min_commit_ts > 0, this is a large transaction request, the final commit_ts
111    /// will be inferred from `min_commit_ts`.
112    #[prost(uint64, tag = "10")]
113    pub min_commit_ts: u64,
114    /// When async commit is enabled, `secondaries` should be set as the key list of all secondary
115    /// locks if the request prewrites the primary lock.
116    #[prost(bool, tag = "11")]
117    pub use_async_commit: bool,
118    #[prost(bytes = "vec", repeated, tag = "12")]
119    pub secondaries: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
120    /// When the transaction involves only one region, it's possible to commit the transaction
121    /// directly with 1PC protocol.
122    #[prost(bool, tag = "13")]
123    pub try_one_pc: bool,
124    /// The max commit ts is reserved for limiting the commit ts of 1PC or async commit, which can be used to avoid
125    /// inconsistency with schema change.
126    #[prost(uint64, tag = "14")]
127    pub max_commit_ts: u64,
128    /// The level of assertion to use on this prewrte request.
129    #[prost(enumeration = "AssertionLevel", tag = "15")]
130    pub assertion_level: i32,
131    /// for_update_ts constriants that should be checked when prewriting a pessimistic transaction.
132    /// See <https://github.com/tikv/tikv/issues/14311>
133    #[prost(message, repeated, tag = "16")]
134    pub for_update_ts_constraints: ::prost::alloc::vec::Vec<
135        prewrite_request::ForUpdateTsConstraint,
136    >,
137    /// Reserved for file based transaction.
138    #[prost(uint64, repeated, tag = "100")]
139    pub txn_file_chunks: ::prost::alloc::vec::Vec<u64>,
140}
141/// Nested message and enum types in `PrewriteRequest`.
142pub mod prewrite_request {
143    /// for_update_ts constriants that should be checked when prewriting a pessimistic transaction.
144    #[allow(clippy::derive_partial_eq_without_eq)]
145    #[derive(Clone, PartialEq, ::prost::Message)]
146    pub struct ForUpdateTsConstraint {
147        /// The index of key in the prewrite request that should be checked.
148        #[prost(uint32, tag = "1")]
149        pub index: u32,
150        /// The expected for_update_ts of the pessimistic lock of the key.
151        #[prost(uint64, tag = "2")]
152        pub expected_for_update_ts: u64,
153    }
154    /// What kind of checks need to be performed for keys in a pessimistic transaction.
155    #[derive(
156        Clone,
157        Copy,
158        Debug,
159        PartialEq,
160        Eq,
161        Hash,
162        PartialOrd,
163        Ord,
164        ::prost::Enumeration
165    )]
166    #[repr(i32)]
167    pub enum PessimisticAction {
168        /// The key needn't be locked and no extra write conflict checks are needed.
169        SkipPessimisticCheck = 0,
170        /// The key should have been locked at the time of prewrite.
171        DoPessimisticCheck = 1,
172        /// The key doesn't need a pessimistic lock. But we need to do data constraint checks.
173        DoConstraintCheck = 2,
174    }
175    impl PessimisticAction {
176        /// String value of the enum field names used in the ProtoBuf definition.
177        ///
178        /// The values are not transformed in any way and thus are considered stable
179        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
180        pub fn as_str_name(&self) -> &'static str {
181            match self {
182                PessimisticAction::SkipPessimisticCheck => "SKIP_PESSIMISTIC_CHECK",
183                PessimisticAction::DoPessimisticCheck => "DO_PESSIMISTIC_CHECK",
184                PessimisticAction::DoConstraintCheck => "DO_CONSTRAINT_CHECK",
185            }
186        }
187        /// Creates an enum from field names used in the ProtoBuf definition.
188        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
189            match value {
190                "SKIP_PESSIMISTIC_CHECK" => Some(Self::SkipPessimisticCheck),
191                "DO_PESSIMISTIC_CHECK" => Some(Self::DoPessimisticCheck),
192                "DO_CONSTRAINT_CHECK" => Some(Self::DoConstraintCheck),
193                _ => None,
194            }
195        }
196    }
197}
198#[allow(clippy::derive_partial_eq_without_eq)]
199#[derive(Clone, PartialEq, ::prost::Message)]
200pub struct PrewriteResponse {
201    #[prost(message, optional, tag = "1")]
202    pub region_error: ::core::option::Option<super::errorpb::Error>,
203    #[prost(message, repeated, tag = "2")]
204    pub errors: ::prost::alloc::vec::Vec<KeyError>,
205    /// 0 if the min_commit_ts is not ready or any other reason that async
206    /// commit cannot proceed. The client can then fallback to normal way to
207    /// continue committing the transaction if prewrite are all finished.
208    #[prost(uint64, tag = "3")]
209    pub min_commit_ts: u64,
210    /// When the transaction is successfully committed with 1PC protocol, this field will be set to
211    /// the commit ts of the transaction. Otherwise, if TiKV failed to commit it with 1PC or the
212    /// transaction is not 1PC, the value will be 0.
213    #[prost(uint64, tag = "4")]
214    pub one_pc_commit_ts: u64,
215    /// Execution details about the request processing.
216    #[prost(message, optional, tag = "5")]
217    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
218}
219/// Lock a set of keys to prepare to write to them.
220#[allow(clippy::derive_partial_eq_without_eq)]
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct PessimisticLockRequest {
223    #[prost(message, optional, tag = "1")]
224    pub context: ::core::option::Option<Context>,
225    /// In this case every `Op` of the mutations must be `PessimisticLock`.
226    #[prost(message, repeated, tag = "2")]
227    pub mutations: ::prost::alloc::vec::Vec<Mutation>,
228    #[prost(bytes = "vec", tag = "3")]
229    pub primary_lock: ::prost::alloc::vec::Vec<u8>,
230    #[prost(uint64, tag = "4")]
231    pub start_version: u64,
232    #[prost(uint64, tag = "5")]
233    pub lock_ttl: u64,
234    /// Each locking command in a pessimistic transaction has its own timestamp. If locking fails, then
235    /// the corresponding SQL statement can be retried with a later timestamp, TiDB does not need to
236    /// retry the whole transaction. The name comes from the `SELECT ... FOR UPDATE` SQL statement which
237    /// is a locking read. Each `SELECT ... FOR UPDATE` in a transaction will be assigned its own
238    /// timestamp.
239    #[prost(uint64, tag = "6")]
240    pub for_update_ts: u64,
241    /// If the request is the first lock request, we don't need to detect deadlock.
242    #[prost(bool, tag = "7")]
243    pub is_first_lock: bool,
244    /// Time to wait for lock released in milliseconds when encountering locks.
245    /// 0 means using default timeout in TiKV. Negative means no wait.
246    #[prost(int64, tag = "8")]
247    pub wait_timeout: i64,
248    /// If it is true, TiKV will acquire the pessimistic lock regardless of write conflict
249    /// and return the latest value. It's only supported for single mutation.
250    #[deprecated]
251    #[prost(bool, tag = "9")]
252    pub force: bool,
253    /// If it is true, TiKV will return values of the keys if no error, so TiDB can cache the values for
254    /// later read in the same transaction.
255    /// When 'force' is set to true, this field is ignored.
256    #[prost(bool, tag = "10")]
257    pub return_values: bool,
258    /// If min_commit_ts > 0, this is large transaction proto, the final commit_ts
259    /// would be infered from min_commit_ts.
260    #[prost(uint64, tag = "11")]
261    pub min_commit_ts: u64,
262    /// If set to true, it means TiKV need to check if the key exists, and return the result in
263    /// the `not_founds` feild in the response. This works no matter if `return_values` is set. If
264    /// `return_values` is set, it simply makes no difference; otherwise, the `value` field of the
265    /// repsonse will be empty while the `not_founds` field still indicates the keys' existence.
266    #[prost(bool, tag = "12")]
267    pub check_existence: bool,
268    /// TiKV lock the record only when it exists
269    #[prost(bool, tag = "13")]
270    pub lock_only_if_exists: bool,
271    /// Specifies the behavior when the request is woken up after wating for lock of another transaction.
272    #[prost(enumeration = "PessimisticLockWakeUpMode", tag = "14")]
273    pub wake_up_mode: i32,
274}
275#[allow(clippy::derive_partial_eq_without_eq)]
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct PessimisticLockKeyResult {
278    #[prost(enumeration = "PessimisticLockKeyResultType", tag = "1")]
279    pub r#type: i32,
280    #[prost(bytes = "vec", tag = "2")]
281    pub value: ::prost::alloc::vec::Vec<u8>,
282    #[prost(bool, tag = "3")]
283    pub existence: bool,
284    /// We allow a key be locked when there is write conflict (latest commit_ts > for_update_ts).
285    /// In this case, the key is semantically locked by a newer for_update_ts.
286    /// For each requested key, the field is non-zero if the key is locked with write conflict, and it
287    /// equals to the commit_ts of the latest version of the specified key. The for_update_ts field
288    /// of the lock that's actually written to TiKV will also be this value. At the same time,
289    /// `value` and `existence` will be returned regardless to how `return_values` and
290    /// `check_existence` are set.
291    #[prost(uint64, tag = "4")]
292    pub locked_with_conflict_ts: u64,
293    /// Hint the client that resolving lock is not needed for this lock. For `PessimisticLock`
294    /// requests only.
295    #[prost(bool, tag = "11")]
296    pub skip_resolving_lock: bool,
297}
298#[allow(clippy::derive_partial_eq_without_eq)]
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct PessimisticLockResponse {
301    #[prost(message, optional, tag = "1")]
302    pub region_error: ::core::option::Option<super::errorpb::Error>,
303    #[prost(message, repeated, tag = "2")]
304    pub errors: ::prost::alloc::vec::Vec<KeyError>,
305    /// It carries the latest value and its commit ts if force in PessimisticLockRequest is true.
306    #[deprecated]
307    #[prost(uint64, tag = "3")]
308    pub commit_ts: u64,
309    #[deprecated]
310    #[prost(bytes = "vec", tag = "4")]
311    pub value: ::prost::alloc::vec::Vec<u8>,
312    /// The values is set if 'return_values' is true in the request and no error.
313    /// If 'force' is true, this field is not used.
314    /// Only used when `wake_up_mode` is `WakeUpModeNormal`.
315    #[prost(bytes = "vec", repeated, tag = "5")]
316    pub values: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
317    /// Indicates whether the values at the same index is correspond to an existing key.
318    /// In legacy TiKV, this field is not used even 'force' is false. In that case, an empty value indicates
319    /// two possible situations: (1) the key does not exist. (2) the key exists but the value is empty.
320    /// Only used when `wake_up_mode` is `WakeUpModeNormal`.
321    #[prost(bool, repeated, tag = "6")]
322    pub not_founds: ::prost::alloc::vec::Vec<bool>,
323    /// Execution details about the request processing.
324    #[prost(message, optional, tag = "7")]
325    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
326    /// Results of the request. Only used when `wake_up_mode` is `WakeUpModeForceLock`.
327    #[prost(message, repeated, tag = "8")]
328    pub results: ::prost::alloc::vec::Vec<PessimisticLockKeyResult>,
329}
330/// Unlock keys locked using `PessimisticLockRequest`.
331#[allow(clippy::derive_partial_eq_without_eq)]
332#[derive(Clone, PartialEq, ::prost::Message)]
333pub struct PessimisticRollbackRequest {
334    #[prost(message, optional, tag = "1")]
335    pub context: ::core::option::Option<Context>,
336    #[prost(uint64, tag = "2")]
337    pub start_version: u64,
338    #[prost(uint64, tag = "3")]
339    pub for_update_ts: u64,
340    #[prost(bytes = "vec", repeated, tag = "4")]
341    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
342}
343#[allow(clippy::derive_partial_eq_without_eq)]
344#[derive(Clone, PartialEq, ::prost::Message)]
345pub struct PessimisticRollbackResponse {
346    #[prost(message, optional, tag = "1")]
347    pub region_error: ::core::option::Option<super::errorpb::Error>,
348    #[prost(message, repeated, tag = "2")]
349    pub errors: ::prost::alloc::vec::Vec<KeyError>,
350    /// Execution details about the request processing.
351    #[prost(message, optional, tag = "3")]
352    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
353}
354/// Used to update the lock_ttl of a psessimistic and/or large transaction to prevent it from been killed.
355#[allow(clippy::derive_partial_eq_without_eq)]
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct TxnHeartBeatRequest {
358    #[prost(message, optional, tag = "1")]
359    pub context: ::core::option::Option<Context>,
360    /// The key of the lock to update.
361    #[prost(bytes = "vec", tag = "2")]
362    pub primary_lock: ::prost::alloc::vec::Vec<u8>,
363    /// Start timestamp of the large transaction.
364    #[prost(uint64, tag = "3")]
365    pub start_version: u64,
366    /// The new TTL the sender would like.
367    #[prost(uint64, tag = "4")]
368    pub advise_lock_ttl: u64,
369    /// Reserved for file based transaction.
370    #[prost(bool, tag = "100")]
371    pub is_txn_file: bool,
372}
373#[allow(clippy::derive_partial_eq_without_eq)]
374#[derive(Clone, PartialEq, ::prost::Message)]
375pub struct TxnHeartBeatResponse {
376    #[prost(message, optional, tag = "1")]
377    pub region_error: ::core::option::Option<super::errorpb::Error>,
378    #[prost(message, optional, tag = "2")]
379    pub error: ::core::option::Option<KeyError>,
380    /// The TTL actually set on the requested lock.
381    #[prost(uint64, tag = "3")]
382    pub lock_ttl: u64,
383    /// Execution details about the request processing.
384    #[prost(message, optional, tag = "4")]
385    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
386}
387/// CheckTxnStatusRequest checks the status of a transaction.
388/// If the transaction is rollbacked/committed, return that result.
389/// If the TTL of the transaction is exhausted, abort that transaction and inform the caller.
390/// Otherwise, returns the TTL information for the transaction.
391/// CheckTxnStatusRequest may also push forward the minCommitTS of a large transaction.
392#[allow(clippy::derive_partial_eq_without_eq)]
393#[derive(Clone, PartialEq, ::prost::Message)]
394pub struct CheckTxnStatusRequest {
395    #[prost(message, optional, tag = "1")]
396    pub context: ::core::option::Option<Context>,
397    /// Primary key and lock ts together to locate the primary lock of a transaction.
398    #[prost(bytes = "vec", tag = "2")]
399    pub primary_key: ::prost::alloc::vec::Vec<u8>,
400    /// Starting timestamp of the transaction being checked.
401    #[prost(uint64, tag = "3")]
402    pub lock_ts: u64,
403    /// The start timestamp of the transaction which this request is part of.
404    #[prost(uint64, tag = "4")]
405    pub caller_start_ts: u64,
406    /// The client must specify the current time to TiKV using this timestamp. It is used to check TTL
407    /// timeouts. It may be inaccurate.
408    #[prost(uint64, tag = "5")]
409    pub current_ts: u64,
410    /// If true, then TiKV will leave a rollback tombstone in the write CF for `primary_key`, even if
411    /// that key is not locked.
412    #[prost(bool, tag = "6")]
413    pub rollback_if_not_exist: bool,
414    /// This field is set to true only if the transaction is known to fall back from async commit.
415    /// Then, CheckTxnStatus treats the transaction as non-async-commit even if the use_async_commit
416    /// field in the primary lock is true.
417    #[prost(bool, tag = "7")]
418    pub force_sync_commit: bool,
419    /// If the check request is used to resolve or decide the transaction status for a input pessimistic
420    /// lock, the transaction status could not be decided if the primary lock is pessimistic too and
421    /// it's still uncertain.
422    #[prost(bool, tag = "8")]
423    pub resolving_pessimistic_lock: bool,
424    /// Whether it's needed to check if the lock on the key (if any) is the primary lock.
425    /// This is for handling some corner cases when a pessimistic transaction changes its primary
426    /// (see <https://github.com/pingcap/tidb/issues/42937> for details). This field is necessary
427    /// because the old versions of clients cannot handle some results returned from TiKV correctly.
428    /// For new versions, this field should always be set to true.
429    #[prost(bool, tag = "9")]
430    pub verify_is_primary: bool,
431    /// Reserved for file based transaction.
432    #[prost(bool, tag = "100")]
433    pub is_txn_file: bool,
434}
435#[allow(clippy::derive_partial_eq_without_eq)]
436#[derive(Clone, PartialEq, ::prost::Message)]
437pub struct CheckTxnStatusResponse {
438    #[prost(message, optional, tag = "1")]
439    pub region_error: ::core::option::Option<super::errorpb::Error>,
440    #[prost(message, optional, tag = "2")]
441    pub error: ::core::option::Option<KeyError>,
442    /// Three kinds of transaction status:
443    /// locked: lock_ttl > 0
444    /// committed: commit_version > 0
445    /// rollbacked: lock_ttl = 0 && commit_version = 0
446    #[prost(uint64, tag = "3")]
447    pub lock_ttl: u64,
448    #[prost(uint64, tag = "4")]
449    pub commit_version: u64,
450    /// The action performed by TiKV (and why if the action is to rollback).
451    #[prost(enumeration = "Action", tag = "5")]
452    pub action: i32,
453    #[prost(message, optional, tag = "6")]
454    pub lock_info: ::core::option::Option<LockInfo>,
455    /// Execution details about the request processing.
456    #[prost(message, optional, tag = "7")]
457    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
458}
459/// Part of the async commit protocol, checks for locks on all supplied keys. If a lock is missing,
460/// does not have a successful status, or belongs to another transaction, TiKV will leave a rollback
461/// tombstone for that key.
462#[allow(clippy::derive_partial_eq_without_eq)]
463#[derive(Clone, PartialEq, ::prost::Message)]
464pub struct CheckSecondaryLocksRequest {
465    #[prost(message, optional, tag = "1")]
466    pub context: ::core::option::Option<Context>,
467    #[prost(bytes = "vec", repeated, tag = "2")]
468    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
469    /// Identifies the transaction we are investigating.
470    #[prost(uint64, tag = "3")]
471    pub start_version: u64,
472}
473#[allow(clippy::derive_partial_eq_without_eq)]
474#[derive(Clone, PartialEq, ::prost::Message)]
475pub struct CheckSecondaryLocksResponse {
476    #[prost(message, optional, tag = "1")]
477    pub region_error: ::core::option::Option<super::errorpb::Error>,
478    #[prost(message, optional, tag = "2")]
479    pub error: ::core::option::Option<KeyError>,
480    /// For each key in `keys` in `CheckSecondaryLocks`, there will be a lock in
481    /// this list if there is a lock present and belonging to the correct transaction,
482    /// nil otherwise.
483    #[prost(message, repeated, tag = "3")]
484    pub locks: ::prost::alloc::vec::Vec<LockInfo>,
485    /// If any of the locks have been committed, this is the commit ts used. If no
486    /// locks have been committed, it will be zero.
487    #[prost(uint64, tag = "4")]
488    pub commit_ts: u64,
489    /// Execution details about the request processing.
490    #[prost(message, optional, tag = "5")]
491    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
492}
493/// The second phase of writing to TiKV. If there are no errors or conflicts, then this request
494/// commits a transaction so that its data can be read by other transactions.
495#[allow(clippy::derive_partial_eq_without_eq)]
496#[derive(Clone, PartialEq, ::prost::Message)]
497pub struct CommitRequest {
498    #[prost(message, optional, tag = "1")]
499    pub context: ::core::option::Option<Context>,
500    /// Identifies the transaction.
501    #[prost(uint64, tag = "2")]
502    pub start_version: u64,
503    /// All keys in the transaction (to be committed).
504    #[prost(bytes = "vec", repeated, tag = "3")]
505    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
506    /// Timestamp for the end of the transaction. Must be greater than `start_version`.
507    #[prost(uint64, tag = "4")]
508    pub commit_version: u64,
509    /// Reserved for file based transaction.
510    #[prost(bool, tag = "100")]
511    pub is_txn_file: bool,
512}
513#[allow(clippy::derive_partial_eq_without_eq)]
514#[derive(Clone, PartialEq, ::prost::Message)]
515pub struct CommitResponse {
516    #[prost(message, optional, tag = "1")]
517    pub region_error: ::core::option::Option<super::errorpb::Error>,
518    #[prost(message, optional, tag = "2")]
519    pub error: ::core::option::Option<KeyError>,
520    /// If the commit ts is derived from min_commit_ts, this field should be set.
521    #[prost(uint64, tag = "3")]
522    pub commit_version: u64,
523    /// Execution details about the request processing.
524    #[prost(message, optional, tag = "4")]
525    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
526}
527/// Not yet implemented.
528#[allow(clippy::derive_partial_eq_without_eq)]
529#[derive(Clone, PartialEq, ::prost::Message)]
530pub struct ImportRequest {
531    #[prost(message, repeated, tag = "1")]
532    pub mutations: ::prost::alloc::vec::Vec<Mutation>,
533    #[prost(uint64, tag = "2")]
534    pub commit_version: u64,
535}
536#[allow(clippy::derive_partial_eq_without_eq)]
537#[derive(Clone, PartialEq, ::prost::Message)]
538pub struct ImportResponse {
539    #[prost(message, optional, tag = "1")]
540    pub region_error: ::core::option::Option<super::errorpb::Error>,
541    #[prost(string, tag = "2")]
542    pub error: ::prost::alloc::string::String,
543}
544/// Cleanup a key by possibly unlocking it.
545/// From 4.0 onwards, this message is no longer used.
546#[allow(clippy::derive_partial_eq_without_eq)]
547#[derive(Clone, PartialEq, ::prost::Message)]
548pub struct CleanupRequest {
549    #[prost(message, optional, tag = "1")]
550    pub context: ::core::option::Option<Context>,
551    #[prost(bytes = "vec", tag = "2")]
552    pub key: ::prost::alloc::vec::Vec<u8>,
553    #[prost(uint64, tag = "3")]
554    pub start_version: u64,
555    /// The current timestamp, used in combination with a lock's TTL to determine
556    /// if the lock has expired. If `current_ts == 0`, then the key will be unlocked
557    /// irrespective of its TTL.
558    #[prost(uint64, tag = "4")]
559    pub current_ts: u64,
560}
561#[allow(clippy::derive_partial_eq_without_eq)]
562#[derive(Clone, PartialEq, ::prost::Message)]
563pub struct CleanupResponse {
564    #[prost(message, optional, tag = "1")]
565    pub region_error: ::core::option::Option<super::errorpb::Error>,
566    #[prost(message, optional, tag = "2")]
567    pub error: ::core::option::Option<KeyError>,
568    /// Set if the key is already committed.
569    #[prost(uint64, tag = "3")]
570    pub commit_version: u64,
571}
572/// Similar to a `Get` request.
573#[allow(clippy::derive_partial_eq_without_eq)]
574#[derive(Clone, PartialEq, ::prost::Message)]
575pub struct BatchGetRequest {
576    #[prost(message, optional, tag = "1")]
577    pub context: ::core::option::Option<Context>,
578    #[prost(bytes = "vec", repeated, tag = "2")]
579    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
580    #[prost(uint64, tag = "3")]
581    pub version: u64,
582}
583#[allow(clippy::derive_partial_eq_without_eq)]
584#[derive(Clone, PartialEq, ::prost::Message)]
585pub struct BatchGetResponse {
586    #[prost(message, optional, tag = "1")]
587    pub region_error: ::core::option::Option<super::errorpb::Error>,
588    #[prost(message, repeated, tag = "2")]
589    pub pairs: ::prost::alloc::vec::Vec<KvPair>,
590    /// Time and scan details when processing the request.
591    #[prost(message, optional, tag = "4")]
592    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
593    /// This KeyError exists when some key is locked but we cannot check locks of all keys.
594    /// In this case, `pairs` should be empty and the client should redo batch get all the keys
595    /// after resolving the lock.
596    #[prost(message, optional, tag = "5")]
597    pub error: ::core::option::Option<KeyError>,
598}
599/// Rollback a prewritten transaction. This will remove the preliminary data from the database,
600/// unlock locks, and leave a rollback tombstone.
601#[allow(clippy::derive_partial_eq_without_eq)]
602#[derive(Clone, PartialEq, ::prost::Message)]
603pub struct BatchRollbackRequest {
604    #[prost(message, optional, tag = "1")]
605    pub context: ::core::option::Option<Context>,
606    /// Identify the transaction to be rolled back.
607    #[prost(uint64, tag = "2")]
608    pub start_version: u64,
609    /// The keys to rollback.
610    #[prost(bytes = "vec", repeated, tag = "3")]
611    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
612    /// Reserved for file based transaction.
613    #[prost(bool, tag = "100")]
614    pub is_txn_file: bool,
615}
616#[allow(clippy::derive_partial_eq_without_eq)]
617#[derive(Clone, PartialEq, ::prost::Message)]
618pub struct BatchRollbackResponse {
619    #[prost(message, optional, tag = "1")]
620    pub region_error: ::core::option::Option<super::errorpb::Error>,
621    #[prost(message, optional, tag = "2")]
622    pub error: ::core::option::Option<KeyError>,
623    /// Execution details about the request processing.
624    #[prost(message, optional, tag = "3")]
625    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
626}
627/// Scan the database for locks. Used at the start of the GC process to find all
628/// old locks.
629#[allow(clippy::derive_partial_eq_without_eq)]
630#[derive(Clone, PartialEq, ::prost::Message)]
631pub struct ScanLockRequest {
632    #[prost(message, optional, tag = "1")]
633    pub context: ::core::option::Option<Context>,
634    /// Returns all locks with a start timestamp before `max_version`.
635    #[prost(uint64, tag = "2")]
636    pub max_version: u64,
637    /// Start scanning from this key.
638    #[prost(bytes = "vec", tag = "3")]
639    pub start_key: ::prost::alloc::vec::Vec<u8>,
640    /// The maximum number of locks to return.
641    #[prost(uint32, tag = "4")]
642    pub limit: u32,
643    /// The exclusive upperbound for scanning.
644    #[prost(bytes = "vec", tag = "5")]
645    pub end_key: ::prost::alloc::vec::Vec<u8>,
646}
647#[allow(clippy::derive_partial_eq_without_eq)]
648#[derive(Clone, PartialEq, ::prost::Message)]
649pub struct ScanLockResponse {
650    #[prost(message, optional, tag = "1")]
651    pub region_error: ::core::option::Option<super::errorpb::Error>,
652    #[prost(message, optional, tag = "2")]
653    pub error: ::core::option::Option<KeyError>,
654    /// Info on all locks found by the scan.
655    #[prost(message, repeated, tag = "3")]
656    pub locks: ::prost::alloc::vec::Vec<LockInfo>,
657    /// Execution details about the request processing.
658    #[prost(message, optional, tag = "4")]
659    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
660}
661/// For all keys locked by the transaction identified by `start_version`, either
662/// commit or rollback the transaction and unlock the key.
663#[allow(clippy::derive_partial_eq_without_eq)]
664#[derive(Clone, PartialEq, ::prost::Message)]
665pub struct ResolveLockRequest {
666    #[prost(message, optional, tag = "1")]
667    pub context: ::core::option::Option<Context>,
668    #[prost(uint64, tag = "2")]
669    pub start_version: u64,
670    /// `commit_version == 0` means the transaction was rolled back.
671    /// `commit_version > 0` means the transaction was committed at the given timestamp.
672    #[prost(uint64, tag = "3")]
673    pub commit_version: u64,
674    #[prost(message, repeated, tag = "4")]
675    pub txn_infos: ::prost::alloc::vec::Vec<TxnInfo>,
676    /// Only resolve specified keys.
677    #[prost(bytes = "vec", repeated, tag = "5")]
678    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
679    /// Reserved for file based transaction.
680    #[prost(bool, tag = "100")]
681    pub is_txn_file: bool,
682}
683#[allow(clippy::derive_partial_eq_without_eq)]
684#[derive(Clone, PartialEq, ::prost::Message)]
685pub struct ResolveLockResponse {
686    #[prost(message, optional, tag = "1")]
687    pub region_error: ::core::option::Option<super::errorpb::Error>,
688    #[prost(message, optional, tag = "2")]
689    pub error: ::core::option::Option<KeyError>,
690    /// Execution details about the request processing.
691    #[prost(message, optional, tag = "3")]
692    pub exec_details_v2: ::core::option::Option<ExecDetailsV2>,
693}
694/// Request TiKV to garbage collect all non-current data older than `safe_point`.
695#[allow(clippy::derive_partial_eq_without_eq)]
696#[derive(Clone, PartialEq, ::prost::Message)]
697pub struct GcRequest {
698    #[prost(message, optional, tag = "1")]
699    pub context: ::core::option::Option<Context>,
700    #[prost(uint64, tag = "2")]
701    pub safe_point: u64,
702}
703#[allow(clippy::derive_partial_eq_without_eq)]
704#[derive(Clone, PartialEq, ::prost::Message)]
705pub struct GcResponse {
706    #[prost(message, optional, tag = "1")]
707    pub region_error: ::core::option::Option<super::errorpb::Error>,
708    #[prost(message, optional, tag = "2")]
709    pub error: ::core::option::Option<KeyError>,
710}
711/// Delete a range of data from TiKV.
712#[allow(clippy::derive_partial_eq_without_eq)]
713#[derive(Clone, PartialEq, ::prost::Message)]
714pub struct DeleteRangeRequest {
715    #[prost(message, optional, tag = "1")]
716    pub context: ::core::option::Option<Context>,
717    #[prost(bytes = "vec", tag = "2")]
718    pub start_key: ::prost::alloc::vec::Vec<u8>,
719    #[prost(bytes = "vec", tag = "3")]
720    pub end_key: ::prost::alloc::vec::Vec<u8>,
721    /// If true, the data will not be immediately deleted, but the operation will
722    /// still be replicated via Raft. This is used to notify TiKV that the data
723    /// will be deleted using `unsafe_destroy_range` soon.
724    #[prost(bool, tag = "4")]
725    pub notify_only: bool,
726}
727#[allow(clippy::derive_partial_eq_without_eq)]
728#[derive(Clone, PartialEq, ::prost::Message)]
729pub struct DeleteRangeResponse {
730    #[prost(message, optional, tag = "1")]
731    pub region_error: ::core::option::Option<super::errorpb::Error>,
732    #[prost(string, tag = "2")]
733    pub error: ::prost::alloc::string::String,
734}
735/// Preparing the flashback for a region/key range will "lock" the region
736/// so that there is no any read, write or schedule operation could be proposed before
737/// the actual flashback operation.
738#[allow(clippy::derive_partial_eq_without_eq)]
739#[derive(Clone, PartialEq, ::prost::Message)]
740pub struct PrepareFlashbackToVersionRequest {
741    #[prost(message, optional, tag = "1")]
742    pub context: ::core::option::Option<Context>,
743    #[prost(bytes = "vec", tag = "2")]
744    pub start_key: ::prost::alloc::vec::Vec<u8>,
745    #[prost(bytes = "vec", tag = "3")]
746    pub end_key: ::prost::alloc::vec::Vec<u8>,
747    /// The `start_ts` which we will use to write a lock to prevent
748    /// the `resolved_ts` from advancing during the whole process.
749    #[prost(uint64, tag = "4")]
750    pub start_ts: u64,
751    /// The TS version which the data will flashback to later.
752    #[prost(uint64, tag = "5")]
753    pub version: u64,
754}
755#[allow(clippy::derive_partial_eq_without_eq)]
756#[derive(Clone, PartialEq, ::prost::Message)]
757pub struct PrepareFlashbackToVersionResponse {
758    #[prost(message, optional, tag = "1")]
759    pub region_error: ::core::option::Option<super::errorpb::Error>,
760    #[prost(string, tag = "2")]
761    pub error: ::prost::alloc::string::String,
762}
763/// Flashback the region to a specific point with the given `version`, please
764/// make sure the region is "locked" by `PrepareFlashbackToVersionRequest` first,
765/// otherwise this request will fail.
766#[allow(clippy::derive_partial_eq_without_eq)]
767#[derive(Clone, PartialEq, ::prost::Message)]
768pub struct FlashbackToVersionRequest {
769    #[prost(message, optional, tag = "1")]
770    pub context: ::core::option::Option<Context>,
771    /// The TS version which the data should flashback to.
772    #[prost(uint64, tag = "2")]
773    pub version: u64,
774    #[prost(bytes = "vec", tag = "3")]
775    pub start_key: ::prost::alloc::vec::Vec<u8>,
776    #[prost(bytes = "vec", tag = "4")]
777    pub end_key: ::prost::alloc::vec::Vec<u8>,
778    /// The `start_ts` and `commit_ts` which the newly written MVCC version will use.
779    /// Please make sure the `start_ts` is the same one in `PrepareFlashbackToVersionRequest`.
780    #[prost(uint64, tag = "5")]
781    pub start_ts: u64,
782    #[prost(uint64, tag = "6")]
783    pub commit_ts: u64,
784}
785#[allow(clippy::derive_partial_eq_without_eq)]
786#[derive(Clone, PartialEq, ::prost::Message)]
787pub struct FlashbackToVersionResponse {
788    #[prost(message, optional, tag = "1")]
789    pub region_error: ::core::option::Option<super::errorpb::Error>,
790    #[prost(string, tag = "2")]
791    pub error: ::prost::alloc::string::String,
792}
793#[allow(clippy::derive_partial_eq_without_eq)]
794#[derive(Clone, PartialEq, ::prost::Message)]
795pub struct RawGetRequest {
796    #[prost(message, optional, tag = "1")]
797    pub context: ::core::option::Option<Context>,
798    #[prost(bytes = "vec", tag = "2")]
799    pub key: ::prost::alloc::vec::Vec<u8>,
800    #[prost(string, tag = "3")]
801    pub cf: ::prost::alloc::string::String,
802}
803#[allow(clippy::derive_partial_eq_without_eq)]
804#[derive(Clone, PartialEq, ::prost::Message)]
805pub struct RawGetResponse {
806    #[prost(message, optional, tag = "1")]
807    pub region_error: ::core::option::Option<super::errorpb::Error>,
808    #[prost(string, tag = "2")]
809    pub error: ::prost::alloc::string::String,
810    #[prost(bytes = "vec", tag = "3")]
811    pub value: ::prost::alloc::vec::Vec<u8>,
812    #[prost(bool, tag = "4")]
813    pub not_found: bool,
814}
815#[allow(clippy::derive_partial_eq_without_eq)]
816#[derive(Clone, PartialEq, ::prost::Message)]
817pub struct RawBatchGetRequest {
818    #[prost(message, optional, tag = "1")]
819    pub context: ::core::option::Option<Context>,
820    #[prost(bytes = "vec", repeated, tag = "2")]
821    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
822    #[prost(string, tag = "3")]
823    pub cf: ::prost::alloc::string::String,
824}
825#[allow(clippy::derive_partial_eq_without_eq)]
826#[derive(Clone, PartialEq, ::prost::Message)]
827pub struct RawBatchGetResponse {
828    #[prost(message, optional, tag = "1")]
829    pub region_error: ::core::option::Option<super::errorpb::Error>,
830    #[prost(message, repeated, tag = "2")]
831    pub pairs: ::prost::alloc::vec::Vec<KvPair>,
832}
833#[allow(clippy::derive_partial_eq_without_eq)]
834#[derive(Clone, PartialEq, ::prost::Message)]
835pub struct RawPutRequest {
836    #[prost(message, optional, tag = "1")]
837    pub context: ::core::option::Option<Context>,
838    #[prost(bytes = "vec", tag = "2")]
839    pub key: ::prost::alloc::vec::Vec<u8>,
840    #[prost(bytes = "vec", tag = "3")]
841    pub value: ::prost::alloc::vec::Vec<u8>,
842    #[prost(string, tag = "4")]
843    pub cf: ::prost::alloc::string::String,
844    #[prost(uint64, tag = "5")]
845    pub ttl: u64,
846    #[prost(bool, tag = "6")]
847    pub for_cas: bool,
848}
849#[allow(clippy::derive_partial_eq_without_eq)]
850#[derive(Clone, PartialEq, ::prost::Message)]
851pub struct RawPutResponse {
852    #[prost(message, optional, tag = "1")]
853    pub region_error: ::core::option::Option<super::errorpb::Error>,
854    #[prost(string, tag = "2")]
855    pub error: ::prost::alloc::string::String,
856}
857#[allow(clippy::derive_partial_eq_without_eq)]
858#[derive(Clone, PartialEq, ::prost::Message)]
859pub struct RawBatchPutRequest {
860    #[prost(message, optional, tag = "1")]
861    pub context: ::core::option::Option<Context>,
862    #[prost(message, repeated, tag = "2")]
863    pub pairs: ::prost::alloc::vec::Vec<KvPair>,
864    #[prost(string, tag = "3")]
865    pub cf: ::prost::alloc::string::String,
866    #[deprecated]
867    #[prost(uint64, tag = "4")]
868    pub ttl: u64,
869    #[prost(bool, tag = "5")]
870    pub for_cas: bool,
871    /// The time-to-live for each keys in seconds, and if the length of `ttls`
872    /// is exactly one, the ttl will be applied to all keys. Otherwise, the length
873    /// mismatch between `ttls` and `pairs` will return an error.
874    #[prost(uint64, repeated, tag = "6")]
875    pub ttls: ::prost::alloc::vec::Vec<u64>,
876}
877#[allow(clippy::derive_partial_eq_without_eq)]
878#[derive(Clone, PartialEq, ::prost::Message)]
879pub struct RawBatchPutResponse {
880    #[prost(message, optional, tag = "1")]
881    pub region_error: ::core::option::Option<super::errorpb::Error>,
882    #[prost(string, tag = "2")]
883    pub error: ::prost::alloc::string::String,
884}
885#[allow(clippy::derive_partial_eq_without_eq)]
886#[derive(Clone, PartialEq, ::prost::Message)]
887pub struct RawDeleteRequest {
888    #[prost(message, optional, tag = "1")]
889    pub context: ::core::option::Option<Context>,
890    #[prost(bytes = "vec", tag = "2")]
891    pub key: ::prost::alloc::vec::Vec<u8>,
892    #[prost(string, tag = "3")]
893    pub cf: ::prost::alloc::string::String,
894    #[prost(bool, tag = "4")]
895    pub for_cas: bool,
896}
897#[allow(clippy::derive_partial_eq_without_eq)]
898#[derive(Clone, PartialEq, ::prost::Message)]
899pub struct RawDeleteResponse {
900    #[prost(message, optional, tag = "1")]
901    pub region_error: ::core::option::Option<super::errorpb::Error>,
902    #[prost(string, tag = "2")]
903    pub error: ::prost::alloc::string::String,
904}
905#[allow(clippy::derive_partial_eq_without_eq)]
906#[derive(Clone, PartialEq, ::prost::Message)]
907pub struct RawBatchDeleteRequest {
908    #[prost(message, optional, tag = "1")]
909    pub context: ::core::option::Option<Context>,
910    #[prost(bytes = "vec", repeated, tag = "2")]
911    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
912    #[prost(string, tag = "3")]
913    pub cf: ::prost::alloc::string::String,
914    #[prost(bool, tag = "4")]
915    pub for_cas: bool,
916}
917#[allow(clippy::derive_partial_eq_without_eq)]
918#[derive(Clone, PartialEq, ::prost::Message)]
919pub struct RawBatchDeleteResponse {
920    #[prost(message, optional, tag = "1")]
921    pub region_error: ::core::option::Option<super::errorpb::Error>,
922    #[prost(string, tag = "2")]
923    pub error: ::prost::alloc::string::String,
924}
925#[allow(clippy::derive_partial_eq_without_eq)]
926#[derive(Clone, PartialEq, ::prost::Message)]
927pub struct RawScanRequest {
928    #[prost(message, optional, tag = "1")]
929    pub context: ::core::option::Option<Context>,
930    #[prost(bytes = "vec", tag = "2")]
931    pub start_key: ::prost::alloc::vec::Vec<u8>,
932    #[prost(uint32, tag = "3")]
933    pub limit: u32,
934    #[prost(bool, tag = "4")]
935    pub key_only: bool,
936    #[prost(string, tag = "5")]
937    pub cf: ::prost::alloc::string::String,
938    #[prost(bool, tag = "6")]
939    pub reverse: bool,
940    /// For compatibility, when scanning forward, the range to scan is \[start_key, end_key), where start_key \< end_key;
941    /// and when scanning backward, it scans \[end_key, start_key) in descending order, where end_key \< start_key.
942    #[prost(bytes = "vec", tag = "7")]
943    pub end_key: ::prost::alloc::vec::Vec<u8>,
944}
945#[allow(clippy::derive_partial_eq_without_eq)]
946#[derive(Clone, PartialEq, ::prost::Message)]
947pub struct RawScanResponse {
948    #[prost(message, optional, tag = "1")]
949    pub region_error: ::core::option::Option<super::errorpb::Error>,
950    #[prost(message, repeated, tag = "2")]
951    pub kvs: ::prost::alloc::vec::Vec<KvPair>,
952}
953#[allow(clippy::derive_partial_eq_without_eq)]
954#[derive(Clone, PartialEq, ::prost::Message)]
955pub struct RawDeleteRangeRequest {
956    #[prost(message, optional, tag = "1")]
957    pub context: ::core::option::Option<Context>,
958    #[prost(bytes = "vec", tag = "2")]
959    pub start_key: ::prost::alloc::vec::Vec<u8>,
960    #[prost(bytes = "vec", tag = "3")]
961    pub end_key: ::prost::alloc::vec::Vec<u8>,
962    #[prost(string, tag = "4")]
963    pub cf: ::prost::alloc::string::String,
964}
965#[allow(clippy::derive_partial_eq_without_eq)]
966#[derive(Clone, PartialEq, ::prost::Message)]
967pub struct RawDeleteRangeResponse {
968    #[prost(message, optional, tag = "1")]
969    pub region_error: ::core::option::Option<super::errorpb::Error>,
970    #[prost(string, tag = "2")]
971    pub error: ::prost::alloc::string::String,
972}
973#[allow(clippy::derive_partial_eq_without_eq)]
974#[derive(Clone, PartialEq, ::prost::Message)]
975pub struct RawBatchScanRequest {
976    #[prost(message, optional, tag = "1")]
977    pub context: ::core::option::Option<Context>,
978    /// scanning range
979    #[prost(message, repeated, tag = "2")]
980    pub ranges: ::prost::alloc::vec::Vec<KeyRange>,
981    /// max number of returning kv pairs for each scanning range
982    #[prost(uint32, tag = "3")]
983    pub each_limit: u32,
984    #[prost(bool, tag = "4")]
985    pub key_only: bool,
986    #[prost(string, tag = "5")]
987    pub cf: ::prost::alloc::string::String,
988    #[prost(bool, tag = "6")]
989    pub reverse: bool,
990}
991#[allow(clippy::derive_partial_eq_without_eq)]
992#[derive(Clone, PartialEq, ::prost::Message)]
993pub struct RawBatchScanResponse {
994    #[prost(message, optional, tag = "1")]
995    pub region_error: ::core::option::Option<super::errorpb::Error>,
996    #[prost(message, repeated, tag = "2")]
997    pub kvs: ::prost::alloc::vec::Vec<KvPair>,
998}
999#[allow(clippy::derive_partial_eq_without_eq)]
1000#[derive(Clone, PartialEq, ::prost::Message)]
1001pub struct UnsafeDestroyRangeRequest {
1002    #[prost(message, optional, tag = "1")]
1003    pub context: ::core::option::Option<Context>,
1004    #[prost(bytes = "vec", tag = "2")]
1005    pub start_key: ::prost::alloc::vec::Vec<u8>,
1006    #[prost(bytes = "vec", tag = "3")]
1007    pub end_key: ::prost::alloc::vec::Vec<u8>,
1008}
1009#[allow(clippy::derive_partial_eq_without_eq)]
1010#[derive(Clone, PartialEq, ::prost::Message)]
1011pub struct UnsafeDestroyRangeResponse {
1012    #[prost(message, optional, tag = "1")]
1013    pub region_error: ::core::option::Option<super::errorpb::Error>,
1014    #[prost(string, tag = "2")]
1015    pub error: ::prost::alloc::string::String,
1016}
1017#[allow(clippy::derive_partial_eq_without_eq)]
1018#[derive(Clone, PartialEq, ::prost::Message)]
1019pub struct RegisterLockObserverRequest {
1020    #[prost(message, optional, tag = "1")]
1021    pub context: ::core::option::Option<Context>,
1022    #[prost(uint64, tag = "2")]
1023    pub max_ts: u64,
1024}
1025#[allow(clippy::derive_partial_eq_without_eq)]
1026#[derive(Clone, PartialEq, ::prost::Message)]
1027pub struct RegisterLockObserverResponse {
1028    #[prost(string, tag = "1")]
1029    pub error: ::prost::alloc::string::String,
1030}
1031#[allow(clippy::derive_partial_eq_without_eq)]
1032#[derive(Clone, PartialEq, ::prost::Message)]
1033pub struct CheckLockObserverRequest {
1034    #[prost(message, optional, tag = "1")]
1035    pub context: ::core::option::Option<Context>,
1036    #[prost(uint64, tag = "2")]
1037    pub max_ts: u64,
1038}
1039#[allow(clippy::derive_partial_eq_without_eq)]
1040#[derive(Clone, PartialEq, ::prost::Message)]
1041pub struct CheckLockObserverResponse {
1042    #[prost(string, tag = "1")]
1043    pub error: ::prost::alloc::string::String,
1044    #[prost(bool, tag = "2")]
1045    pub is_clean: bool,
1046    #[prost(message, repeated, tag = "3")]
1047    pub locks: ::prost::alloc::vec::Vec<LockInfo>,
1048}
1049#[allow(clippy::derive_partial_eq_without_eq)]
1050#[derive(Clone, PartialEq, ::prost::Message)]
1051pub struct RemoveLockObserverRequest {
1052    #[prost(message, optional, tag = "1")]
1053    pub context: ::core::option::Option<Context>,
1054    #[prost(uint64, tag = "2")]
1055    pub max_ts: u64,
1056}
1057#[allow(clippy::derive_partial_eq_without_eq)]
1058#[derive(Clone, PartialEq, ::prost::Message)]
1059pub struct RemoveLockObserverResponse {
1060    #[prost(string, tag = "1")]
1061    pub error: ::prost::alloc::string::String,
1062}
1063#[allow(clippy::derive_partial_eq_without_eq)]
1064#[derive(Clone, PartialEq, ::prost::Message)]
1065pub struct PhysicalScanLockRequest {
1066    #[prost(message, optional, tag = "1")]
1067    pub context: ::core::option::Option<Context>,
1068    #[prost(uint64, tag = "2")]
1069    pub max_ts: u64,
1070    #[prost(bytes = "vec", tag = "3")]
1071    pub start_key: ::prost::alloc::vec::Vec<u8>,
1072    #[prost(uint32, tag = "4")]
1073    pub limit: u32,
1074}
1075#[allow(clippy::derive_partial_eq_without_eq)]
1076#[derive(Clone, PartialEq, ::prost::Message)]
1077pub struct PhysicalScanLockResponse {
1078    #[prost(string, tag = "1")]
1079    pub error: ::prost::alloc::string::String,
1080    #[prost(message, repeated, tag = "2")]
1081    pub locks: ::prost::alloc::vec::Vec<LockInfo>,
1082}
1083/// Sent from PD to a TiKV node.
1084#[allow(clippy::derive_partial_eq_without_eq)]
1085#[derive(Clone, PartialEq, ::prost::Message)]
1086pub struct SplitRegionRequest {
1087    #[prost(message, optional, tag = "1")]
1088    pub context: ::core::option::Option<Context>,
1089    #[deprecated]
1090    #[prost(bytes = "vec", tag = "2")]
1091    pub split_key: ::prost::alloc::vec::Vec<u8>,
1092    /// when use it to do batch split, `split_key` should be empty.
1093    #[prost(bytes = "vec", repeated, tag = "3")]
1094    pub split_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1095    /// Once enabled, the split_key will not be encoded.
1096    #[prost(bool, tag = "4")]
1097    pub is_raw_kv: bool,
1098}
1099#[allow(clippy::derive_partial_eq_without_eq)]
1100#[derive(Clone, PartialEq, ::prost::Message)]
1101pub struct SplitRegionResponse {
1102    #[prost(message, optional, tag = "1")]
1103    pub region_error: ::core::option::Option<super::errorpb::Error>,
1104    /// set when there are only 2 result regions.
1105    #[deprecated]
1106    #[prost(message, optional, tag = "2")]
1107    pub left: ::core::option::Option<super::metapb::Region>,
1108    /// set when there are only 2 result regions.
1109    #[deprecated]
1110    #[prost(message, optional, tag = "3")]
1111    pub right: ::core::option::Option<super::metapb::Region>,
1112    /// include all result regions.
1113    #[prost(message, repeated, tag = "4")]
1114    pub regions: ::prost::alloc::vec::Vec<super::metapb::Region>,
1115}
1116/// Sent from TiFlash to a TiKV node.
1117#[allow(clippy::derive_partial_eq_without_eq)]
1118#[derive(Clone, PartialEq, ::prost::Message)]
1119pub struct ReadIndexRequest {
1120    #[prost(message, optional, tag = "1")]
1121    pub context: ::core::option::Option<Context>,
1122    /// TiKV checks the given range if there is any unapplied lock
1123    /// blocking the read request.
1124    #[prost(uint64, tag = "2")]
1125    pub start_ts: u64,
1126    #[prost(message, repeated, tag = "3")]
1127    pub ranges: ::prost::alloc::vec::Vec<KeyRange>,
1128}
1129#[allow(clippy::derive_partial_eq_without_eq)]
1130#[derive(Clone, PartialEq, ::prost::Message)]
1131pub struct ReadIndexResponse {
1132    #[prost(message, optional, tag = "1")]
1133    pub region_error: ::core::option::Option<super::errorpb::Error>,
1134    #[prost(uint64, tag = "2")]
1135    pub read_index: u64,
1136    /// If `locked` is set, this read request is blocked by a lock.
1137    /// The lock should be returned to the client.
1138    #[prost(message, optional, tag = "3")]
1139    pub locked: ::core::option::Option<LockInfo>,
1140}
1141#[allow(clippy::derive_partial_eq_without_eq)]
1142#[derive(Clone, PartialEq, ::prost::Message)]
1143pub struct MvccGetByKeyRequest {
1144    #[prost(message, optional, tag = "1")]
1145    pub context: ::core::option::Option<Context>,
1146    #[prost(bytes = "vec", tag = "2")]
1147    pub key: ::prost::alloc::vec::Vec<u8>,
1148}
1149#[allow(clippy::derive_partial_eq_without_eq)]
1150#[derive(Clone, PartialEq, ::prost::Message)]
1151pub struct MvccGetByKeyResponse {
1152    #[prost(message, optional, tag = "1")]
1153    pub region_error: ::core::option::Option<super::errorpb::Error>,
1154    #[prost(string, tag = "2")]
1155    pub error: ::prost::alloc::string::String,
1156    #[prost(message, optional, tag = "3")]
1157    pub info: ::core::option::Option<MvccInfo>,
1158}
1159#[allow(clippy::derive_partial_eq_without_eq)]
1160#[derive(Clone, PartialEq, ::prost::Message)]
1161pub struct MvccGetByStartTsRequest {
1162    #[prost(message, optional, tag = "1")]
1163    pub context: ::core::option::Option<Context>,
1164    #[prost(uint64, tag = "2")]
1165    pub start_ts: u64,
1166}
1167#[allow(clippy::derive_partial_eq_without_eq)]
1168#[derive(Clone, PartialEq, ::prost::Message)]
1169pub struct MvccGetByStartTsResponse {
1170    #[prost(message, optional, tag = "1")]
1171    pub region_error: ::core::option::Option<super::errorpb::Error>,
1172    #[prost(string, tag = "2")]
1173    pub error: ::prost::alloc::string::String,
1174    #[prost(bytes = "vec", tag = "3")]
1175    pub key: ::prost::alloc::vec::Vec<u8>,
1176    #[prost(message, optional, tag = "4")]
1177    pub info: ::core::option::Option<MvccInfo>,
1178}
1179/// Miscellaneous metadata attached to most requests.
1180#[allow(clippy::derive_partial_eq_without_eq)]
1181#[derive(Clone, PartialEq, ::prost::Message)]
1182pub struct Context {
1183    #[prost(uint64, tag = "1")]
1184    pub region_id: u64,
1185    #[prost(message, optional, tag = "2")]
1186    pub region_epoch: ::core::option::Option<super::metapb::RegionEpoch>,
1187    #[prost(message, optional, tag = "3")]
1188    pub peer: ::core::option::Option<super::metapb::Peer>,
1189    #[prost(uint64, tag = "5")]
1190    pub term: u64,
1191    #[prost(enumeration = "CommandPri", tag = "6")]
1192    pub priority: i32,
1193    #[prost(enumeration = "IsolationLevel", tag = "7")]
1194    pub isolation_level: i32,
1195    #[prost(bool, tag = "8")]
1196    pub not_fill_cache: bool,
1197    #[prost(bool, tag = "9")]
1198    pub sync_log: bool,
1199    /// True means execution time statistics should be recorded and returned.
1200    #[prost(bool, tag = "10")]
1201    pub record_time_stat: bool,
1202    /// True means RocksDB scan statistics should be recorded and returned.
1203    #[prost(bool, tag = "11")]
1204    pub record_scan_stat: bool,
1205    #[prost(bool, tag = "12")]
1206    pub replica_read: bool,
1207    /// Read requests can ignore locks belonging to these transactions because either
1208    /// these transactions are rolled back or theirs commit_ts > read request's start_ts.
1209    #[prost(uint64, repeated, tag = "13")]
1210    pub resolved_locks: ::prost::alloc::vec::Vec<u64>,
1211    #[prost(uint64, tag = "14")]
1212    pub max_execution_duration_ms: u64,
1213    /// After a region applies to `applied_index`, we can get a
1214    /// snapshot for the region even if the peer is a follower.
1215    #[prost(uint64, tag = "15")]
1216    pub applied_index: u64,
1217    /// A hint for TiKV to schedule tasks more fairly. Query with same task ID
1218    /// may share same priority and resource quota.
1219    #[prost(uint64, tag = "16")]
1220    pub task_id: u64,
1221    /// Not required to read the most up-to-date data, replicas with `safe_ts` >= `start_ts`
1222    /// can handle read request directly
1223    #[prost(bool, tag = "17")]
1224    pub stale_read: bool,
1225    /// Any additional serialized information about the request.
1226    #[prost(bytes = "vec", tag = "18")]
1227    pub resource_group_tag: ::prost::alloc::vec::Vec<u8>,
1228    /// Used to tell TiKV whether operations are allowed or not on different disk usages.
1229    #[prost(enumeration = "DiskFullOpt", tag = "19")]
1230    pub disk_full_opt: i32,
1231    /// Indicates the request is a retry request and the same request may have been sent before.
1232    #[prost(bool, tag = "20")]
1233    pub is_retry_request: bool,
1234    /// API version implies the encode of the key and value.
1235    #[prost(enumeration = "ApiVersion", tag = "21")]
1236    pub api_version: i32,
1237    /// Read request should read through locks belonging to these transactions because these
1238    /// transactions are committed and theirs commit_ts \<= read request's start_ts.
1239    #[prost(uint64, repeated, tag = "22")]
1240    pub committed_locks: ::prost::alloc::vec::Vec<u64>,
1241    /// The informantion to trace a request sent to TiKV.
1242    #[prost(message, optional, tag = "23")]
1243    pub trace_context: ::core::option::Option<super::tracepb::TraceContext>,
1244    /// The source of the request, will be used as the tag of the metrics reporting.
1245    /// This field can be set for any requests that require to report metrics with any extra labels.
1246    #[prost(string, tag = "24")]
1247    pub request_source: ::prost::alloc::string::String,
1248    /// The source of the current transaction.
1249    #[prost(uint64, tag = "25")]
1250    pub txn_source: u64,
1251    /// If `busy_threshold_ms` is given, TiKV can reject the request and return a `ServerIsBusy`
1252    /// error before processing if the estimated waiting duration exceeds the threshold.
1253    #[prost(uint32, tag = "27")]
1254    pub busy_threshold_ms: u32,
1255    /// Some information used for resource control.
1256    #[prost(message, optional, tag = "28")]
1257    pub resource_control_context: ::core::option::Option<ResourceControlContext>,
1258    /// The keyspace that the request is sent to.
1259    /// NOTE: This field is only meaningful while the api_version is V2.
1260    #[prost(uint32, tag = "32")]
1261    pub keyspace_id: u32,
1262    /// The buckets version that the request is sent to.
1263    /// NOTE: This field is only meaningful while enable buckets.
1264    #[prost(uint64, tag = "33")]
1265    pub buckets_version: u64,
1266    /// It tells us where the request comes from in TiDB. If it isn't from TiDB, leave it blank.
1267    /// This is for tests only and thus can be safely changed/removed without affecting compatibility.
1268    #[prost(message, optional, tag = "34")]
1269    pub source_stmt: ::core::option::Option<SourceStmt>,
1270}
1271#[allow(clippy::derive_partial_eq_without_eq)]
1272#[derive(Clone, PartialEq, ::prost::Message)]
1273pub struct ResourceControlContext {
1274    /// It's used to identify which resource group the request belongs to.
1275    #[prost(string, tag = "1")]
1276    pub resource_group_name: ::prost::alloc::string::String,
1277    /// The resource consumption of the resource group that have completed at all TiKVs between the previous request to this TiKV and current request.
1278    /// It's used as penalty to make the local resource scheduling on one TiKV takes the gloabl resource consumption into consideration.
1279    #[prost(message, optional, tag = "2")]
1280    pub penalty: ::core::option::Option<super::resource_manager::Consumption>,
1281    /// This priority would override the original priority of the resource group for the request.
1282    /// Used to deprioritize the runaway queries.
1283    #[prost(uint64, tag = "3")]
1284    pub override_priority: u64,
1285}
1286#[allow(clippy::derive_partial_eq_without_eq)]
1287#[derive(Clone, PartialEq, ::prost::Message)]
1288pub struct SourceStmt {
1289    #[prost(uint64, tag = "1")]
1290    pub start_ts: u64,
1291    #[prost(uint64, tag = "2")]
1292    pub connection_id: u64,
1293    #[prost(uint64, tag = "3")]
1294    pub stmt_id: u64,
1295    /// session alias set by user
1296    #[prost(string, tag = "4")]
1297    pub session_alias: ::prost::alloc::string::String,
1298}
1299#[allow(clippy::derive_partial_eq_without_eq)]
1300#[derive(Clone, PartialEq, ::prost::Message)]
1301pub struct LockInfo {
1302    #[prost(bytes = "vec", tag = "1")]
1303    pub primary_lock: ::prost::alloc::vec::Vec<u8>,
1304    #[prost(uint64, tag = "2")]
1305    pub lock_version: u64,
1306    #[prost(bytes = "vec", tag = "3")]
1307    pub key: ::prost::alloc::vec::Vec<u8>,
1308    #[prost(uint64, tag = "4")]
1309    pub lock_ttl: u64,
1310    /// How many keys this transaction involves in this region.
1311    #[prost(uint64, tag = "5")]
1312    pub txn_size: u64,
1313    #[prost(enumeration = "Op", tag = "6")]
1314    pub lock_type: i32,
1315    #[prost(uint64, tag = "7")]
1316    pub lock_for_update_ts: u64,
1317    /// Fields for transactions that are using Async Commit.
1318    #[prost(bool, tag = "8")]
1319    pub use_async_commit: bool,
1320    #[prost(uint64, tag = "9")]
1321    pub min_commit_ts: u64,
1322    #[prost(bytes = "vec", repeated, tag = "10")]
1323    pub secondaries: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1324    /// The time elapsed since last update of lock wait info when waiting.
1325    /// It's used in timeout errors. 0 means unknown or not applicable.
1326    /// It can be used to help the client decide whether to try resolving the lock.
1327    #[prost(uint64, tag = "11")]
1328    pub duration_to_last_update_ms: u64,
1329    /// Reserved for file based transaction.
1330    #[prost(bool, tag = "100")]
1331    pub is_txn_file: bool,
1332}
1333#[allow(clippy::derive_partial_eq_without_eq)]
1334#[derive(Clone, PartialEq, ::prost::Message)]
1335pub struct KeyError {
1336    /// Client should backoff or cleanup the lock then retry.
1337    #[prost(message, optional, tag = "1")]
1338    pub locked: ::core::option::Option<LockInfo>,
1339    /// Client may restart the txn. e.g write conflict.
1340    #[prost(string, tag = "2")]
1341    pub retryable: ::prost::alloc::string::String,
1342    /// Client should abort the txn.
1343    #[prost(string, tag = "3")]
1344    pub abort: ::prost::alloc::string::String,
1345    /// Write conflict is moved from retryable to here.
1346    #[prost(message, optional, tag = "4")]
1347    pub conflict: ::core::option::Option<WriteConflict>,
1348    /// Key already exists
1349    #[prost(message, optional, tag = "5")]
1350    pub already_exist: ::core::option::Option<AlreadyExist>,
1351    /// Deadlock is used in pessimistic transaction for single statement rollback.
1352    #[prost(message, optional, tag = "6")]
1353    pub deadlock: ::core::option::Option<Deadlock>,
1354    /// Commit ts is earlier than min commit ts of a transaction.
1355    #[prost(message, optional, tag = "7")]
1356    pub commit_ts_expired: ::core::option::Option<CommitTsExpired>,
1357    /// Txn not found when checking txn status.
1358    #[prost(message, optional, tag = "8")]
1359    pub txn_not_found: ::core::option::Option<TxnNotFound>,
1360    /// Calculated commit TS exceeds the limit given by the user.
1361    #[prost(message, optional, tag = "9")]
1362    pub commit_ts_too_large: ::core::option::Option<CommitTsTooLarge>,
1363    /// Assertion of a `Mutation` is evaluated as a failure.
1364    #[prost(message, optional, tag = "10")]
1365    pub assertion_failed: ::core::option::Option<AssertionFailed>,
1366    /// CheckTxnStatus is sent to a lock that's not the primary.
1367    #[prost(message, optional, tag = "11")]
1368    pub primary_mismatch: ::core::option::Option<PrimaryMismatch>,
1369}
1370#[allow(clippy::derive_partial_eq_without_eq)]
1371#[derive(Clone, PartialEq, ::prost::Message)]
1372pub struct WriteConflict {
1373    #[prost(uint64, tag = "1")]
1374    pub start_ts: u64,
1375    #[prost(uint64, tag = "2")]
1376    pub conflict_ts: u64,
1377    #[prost(bytes = "vec", tag = "3")]
1378    pub key: ::prost::alloc::vec::Vec<u8>,
1379    #[prost(bytes = "vec", tag = "4")]
1380    pub primary: ::prost::alloc::vec::Vec<u8>,
1381    #[prost(uint64, tag = "5")]
1382    pub conflict_commit_ts: u64,
1383    #[prost(enumeration = "write_conflict::Reason", tag = "6")]
1384    pub reason: i32,
1385}
1386/// Nested message and enum types in `WriteConflict`.
1387pub mod write_conflict {
1388    #[derive(
1389        Clone,
1390        Copy,
1391        Debug,
1392        PartialEq,
1393        Eq,
1394        Hash,
1395        PartialOrd,
1396        Ord,
1397        ::prost::Enumeration
1398    )]
1399    #[repr(i32)]
1400    pub enum Reason {
1401        Unknown = 0,
1402        /// in optimistic transactions.
1403        Optimistic = 1,
1404        /// a lock acquisition request waits for a lock and awakes, or meets a newer version of data, let TiDB retry.
1405        PessimisticRetry = 2,
1406        /// the transaction itself has been rolled back when it tries to prewrite.
1407        SelfRolledBack = 3,
1408        /// RcCheckTs failure by meeting a newer version, let TiDB retry.
1409        RcCheckTs = 4,
1410        /// write conflict found in lazy uniqueness check in pessimistic transactions.
1411        LazyUniquenessCheck = 5,
1412    }
1413    impl Reason {
1414        /// String value of the enum field names used in the ProtoBuf definition.
1415        ///
1416        /// The values are not transformed in any way and thus are considered stable
1417        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1418        pub fn as_str_name(&self) -> &'static str {
1419            match self {
1420                Reason::Unknown => "Unknown",
1421                Reason::Optimistic => "Optimistic",
1422                Reason::PessimisticRetry => "PessimisticRetry",
1423                Reason::SelfRolledBack => "SelfRolledBack",
1424                Reason::RcCheckTs => "RcCheckTs",
1425                Reason::LazyUniquenessCheck => "LazyUniquenessCheck",
1426            }
1427        }
1428        /// Creates an enum from field names used in the ProtoBuf definition.
1429        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1430            match value {
1431                "Unknown" => Some(Self::Unknown),
1432                "Optimistic" => Some(Self::Optimistic),
1433                "PessimisticRetry" => Some(Self::PessimisticRetry),
1434                "SelfRolledBack" => Some(Self::SelfRolledBack),
1435                "RcCheckTs" => Some(Self::RcCheckTs),
1436                "LazyUniquenessCheck" => Some(Self::LazyUniquenessCheck),
1437                _ => None,
1438            }
1439        }
1440    }
1441}
1442#[allow(clippy::derive_partial_eq_without_eq)]
1443#[derive(Clone, PartialEq, ::prost::Message)]
1444pub struct AlreadyExist {
1445    #[prost(bytes = "vec", tag = "1")]
1446    pub key: ::prost::alloc::vec::Vec<u8>,
1447}
1448#[allow(clippy::derive_partial_eq_without_eq)]
1449#[derive(Clone, PartialEq, ::prost::Message)]
1450pub struct Deadlock {
1451    #[prost(uint64, tag = "1")]
1452    pub lock_ts: u64,
1453    #[prost(bytes = "vec", tag = "2")]
1454    pub lock_key: ::prost::alloc::vec::Vec<u8>,
1455    #[prost(uint64, tag = "3")]
1456    pub deadlock_key_hash: u64,
1457    #[prost(message, repeated, tag = "4")]
1458    pub wait_chain: ::prost::alloc::vec::Vec<super::deadlock::WaitForEntry>,
1459}
1460#[allow(clippy::derive_partial_eq_without_eq)]
1461#[derive(Clone, PartialEq, ::prost::Message)]
1462pub struct CommitTsExpired {
1463    #[prost(uint64, tag = "1")]
1464    pub start_ts: u64,
1465    #[prost(uint64, tag = "2")]
1466    pub attempted_commit_ts: u64,
1467    #[prost(bytes = "vec", tag = "3")]
1468    pub key: ::prost::alloc::vec::Vec<u8>,
1469    #[prost(uint64, tag = "4")]
1470    pub min_commit_ts: u64,
1471}
1472#[allow(clippy::derive_partial_eq_without_eq)]
1473#[derive(Clone, PartialEq, ::prost::Message)]
1474pub struct TxnNotFound {
1475    #[prost(uint64, tag = "1")]
1476    pub start_ts: u64,
1477    #[prost(bytes = "vec", tag = "2")]
1478    pub primary_key: ::prost::alloc::vec::Vec<u8>,
1479}
1480#[allow(clippy::derive_partial_eq_without_eq)]
1481#[derive(Clone, PartialEq, ::prost::Message)]
1482pub struct CommitTsTooLarge {
1483    /// The calculated commit TS.
1484    #[prost(uint64, tag = "1")]
1485    pub commit_ts: u64,
1486}
1487#[allow(clippy::derive_partial_eq_without_eq)]
1488#[derive(Clone, PartialEq, ::prost::Message)]
1489pub struct AssertionFailed {
1490    #[prost(uint64, tag = "1")]
1491    pub start_ts: u64,
1492    #[prost(bytes = "vec", tag = "2")]
1493    pub key: ::prost::alloc::vec::Vec<u8>,
1494    #[prost(enumeration = "Assertion", tag = "3")]
1495    pub assertion: i32,
1496    #[prost(uint64, tag = "4")]
1497    pub existing_start_ts: u64,
1498    #[prost(uint64, tag = "5")]
1499    pub existing_commit_ts: u64,
1500}
1501#[allow(clippy::derive_partial_eq_without_eq)]
1502#[derive(Clone, PartialEq, ::prost::Message)]
1503pub struct PrimaryMismatch {
1504    #[prost(message, optional, tag = "1")]
1505    pub lock_info: ::core::option::Option<LockInfo>,
1506}
1507#[allow(clippy::derive_partial_eq_without_eq)]
1508#[derive(Clone, PartialEq, ::prost::Message)]
1509pub struct TimeDetail {
1510    /// Off-cpu wall time elapsed in TiKV side. Usually this includes queue waiting time and
1511    /// other kind of waitings in series. (Wait time in the raftstore is not included.)
1512    #[prost(uint64, tag = "1")]
1513    pub wait_wall_time_ms: u64,
1514    /// Off-cpu and on-cpu wall time elapsed to actually process the request payload. It does not
1515    /// include `wait_wall_time`.
1516    /// This field is very close to the CPU time in most cases. Some wait time spend in RocksDB
1517    /// cannot be excluded for now, like Mutex wait time, which is included in this field, so that
1518    /// this field is called wall time instead of CPU time.
1519    #[prost(uint64, tag = "2")]
1520    pub process_wall_time_ms: u64,
1521    /// KV read wall Time means the time used in key/value scan and get.
1522    #[prost(uint64, tag = "3")]
1523    pub kv_read_wall_time_ms: u64,
1524    /// Total wall clock time spent on this RPC in TiKV .
1525    #[prost(uint64, tag = "4")]
1526    pub total_rpc_wall_time_ns: u64,
1527}
1528#[allow(clippy::derive_partial_eq_without_eq)]
1529#[derive(Clone, PartialEq, ::prost::Message)]
1530pub struct TimeDetailV2 {
1531    /// Off-cpu wall time elapsed in TiKV side. Usually this includes queue waiting time and
1532    /// other kind of waitings in series. (Wait time in the raftstore is not included.)
1533    #[prost(uint64, tag = "1")]
1534    pub wait_wall_time_ns: u64,
1535    /// Off-cpu and on-cpu wall time elapsed to actually process the request payload. It does not
1536    /// include `wait_wall_time` and `suspend_wall_time`.
1537    /// This field is very close to the CPU time in most cases. Some wait time spend in RocksDB
1538    /// cannot be excluded for now, like Mutex wait time, which is included in this field, so that
1539    /// this field is called wall time instead of CPU time.
1540    #[prost(uint64, tag = "2")]
1541    pub process_wall_time_ns: u64,
1542    /// Cpu wall time elapsed that task is waiting in queue.
1543    #[prost(uint64, tag = "3")]
1544    pub process_suspend_wall_time_ns: u64,
1545    /// KV read wall Time means the time used in key/value scan and get.
1546    #[prost(uint64, tag = "4")]
1547    pub kv_read_wall_time_ns: u64,
1548    /// Total wall clock time spent on this RPC in TiKV .
1549    #[prost(uint64, tag = "5")]
1550    pub total_rpc_wall_time_ns: u64,
1551}
1552#[allow(clippy::derive_partial_eq_without_eq)]
1553#[derive(Clone, PartialEq, ::prost::Message)]
1554pub struct ScanInfo {
1555    #[prost(int64, tag = "1")]
1556    pub total: i64,
1557    #[prost(int64, tag = "2")]
1558    pub processed: i64,
1559    #[prost(int64, tag = "3")]
1560    pub read_bytes: i64,
1561}
1562/// Only reserved for compatibility.
1563#[allow(clippy::derive_partial_eq_without_eq)]
1564#[derive(Clone, PartialEq, ::prost::Message)]
1565pub struct ScanDetail {
1566    #[prost(message, optional, tag = "1")]
1567    pub write: ::core::option::Option<ScanInfo>,
1568    #[prost(message, optional, tag = "2")]
1569    pub lock: ::core::option::Option<ScanInfo>,
1570    #[prost(message, optional, tag = "3")]
1571    pub data: ::core::option::Option<ScanInfo>,
1572}
1573#[allow(clippy::derive_partial_eq_without_eq)]
1574#[derive(Clone, PartialEq, ::prost::Message)]
1575pub struct ScanDetailV2 {
1576    /// Number of user keys scanned from the storage.
1577    /// It does not include deleted version or RocksDB tombstone keys.
1578    /// For Coprocessor requests, it includes keys that has been filtered out by
1579    /// Selection.
1580    #[prost(uint64, tag = "1")]
1581    pub processed_versions: u64,
1582    /// Number of bytes of user key-value pairs scanned from the storage, i.e.
1583    /// total size of data returned from MVCC layer.
1584    #[prost(uint64, tag = "8")]
1585    pub processed_versions_size: u64,
1586    /// Approximate number of MVCC keys meet during scanning. It includes
1587    /// deleted versions, but does not include RocksDB tombstone keys.
1588    ///
1589    /// When this field is notably larger than `processed_versions`, it means
1590    /// there are a lot of deleted MVCC keys.
1591    #[prost(uint64, tag = "2")]
1592    pub total_versions: u64,
1593    /// Total number of deletes and single deletes skipped over during
1594    /// iteration, i.e. how many RocksDB tombstones are skipped.
1595    #[prost(uint64, tag = "3")]
1596    pub rocksdb_delete_skipped_count: u64,
1597    /// Total number of internal keys skipped over during iteration.
1598    /// See <https://github.com/facebook/rocksdb/blob/9f1c84ca471d8b1ad7be9f3eebfc2c7e07dfd7a7/include/rocksdb/perf_context.h#L84> for details.
1599    #[prost(uint64, tag = "4")]
1600    pub rocksdb_key_skipped_count: u64,
1601    /// Total number of RocksDB block cache hits.
1602    #[prost(uint64, tag = "5")]
1603    pub rocksdb_block_cache_hit_count: u64,
1604    /// Total number of block reads (with IO).
1605    #[prost(uint64, tag = "6")]
1606    pub rocksdb_block_read_count: u64,
1607    /// Total number of bytes from block reads.
1608    #[prost(uint64, tag = "7")]
1609    pub rocksdb_block_read_byte: u64,
1610    /// Total time used for block reads.
1611    #[prost(uint64, tag = "9")]
1612    pub rocksdb_block_read_nanos: u64,
1613    /// Time used for getting a raftstore snapshot (including proposing read index, leader confirmation and getting the RocksDB snapshot).
1614    #[prost(uint64, tag = "10")]
1615    pub get_snapshot_nanos: u64,
1616    /// Time used for proposing read index from read pool to store pool, equals 0 when performing lease read.
1617    #[prost(uint64, tag = "11")]
1618    pub read_index_propose_wait_nanos: u64,
1619    /// Time used for leader confirmation, equals 0 when performing lease read.
1620    #[prost(uint64, tag = "12")]
1621    pub read_index_confirm_wait_nanos: u64,
1622    /// Time used for read pool scheduling.
1623    #[prost(uint64, tag = "13")]
1624    pub read_pool_schedule_wait_nanos: u64,
1625}
1626#[allow(clippy::derive_partial_eq_without_eq)]
1627#[derive(Clone, PartialEq, ::prost::Message)]
1628pub struct ExecDetails {
1629    /// Available when ctx.record_time_stat = true or meet slow query.
1630    #[prost(message, optional, tag = "1")]
1631    pub time_detail: ::core::option::Option<TimeDetail>,
1632    /// Available when ctx.record_scan_stat = true or meet slow query.
1633    #[prost(message, optional, tag = "2")]
1634    pub scan_detail: ::core::option::Option<ScanDetail>,
1635}
1636#[allow(clippy::derive_partial_eq_without_eq)]
1637#[derive(Clone, PartialEq, ::prost::Message)]
1638pub struct ExecDetailsV2 {
1639    /// Available when ctx.record_time_stat = true or meet slow query.
1640    /// deprecated. Should use `time_detail_v2` instead.
1641    #[prost(message, optional, tag = "1")]
1642    pub time_detail: ::core::option::Option<TimeDetail>,
1643    /// Available when ctx.record_scan_stat = true or meet slow query.
1644    #[prost(message, optional, tag = "2")]
1645    pub scan_detail_v2: ::core::option::Option<ScanDetailV2>,
1646    /// Raftstore writing durations of the request. Only available for some write requests.
1647    #[prost(message, optional, tag = "3")]
1648    pub write_detail: ::core::option::Option<WriteDetail>,
1649    /// Available when ctx.record_time_stat = true or meet slow query.
1650    #[prost(message, optional, tag = "4")]
1651    pub time_detail_v2: ::core::option::Option<TimeDetailV2>,
1652}
1653#[allow(clippy::derive_partial_eq_without_eq)]
1654#[derive(Clone, PartialEq, ::prost::Message)]
1655pub struct WriteDetail {
1656    /// Wait duration in the store loop.
1657    #[prost(uint64, tag = "1")]
1658    pub store_batch_wait_nanos: u64,
1659    /// Wait duration before sending proposal to peers.
1660    #[prost(uint64, tag = "2")]
1661    pub propose_send_wait_nanos: u64,
1662    /// Total time spent on persisting the log.
1663    #[prost(uint64, tag = "3")]
1664    pub persist_log_nanos: u64,
1665    /// Wait time until the Raft log write leader begins to write.
1666    #[prost(uint64, tag = "4")]
1667    pub raft_db_write_leader_wait_nanos: u64,
1668    /// Time spent on synchronizing the Raft log to the disk.
1669    #[prost(uint64, tag = "5")]
1670    pub raft_db_sync_log_nanos: u64,
1671    /// Time spent on writing the Raft log to the Raft memtable.
1672    #[prost(uint64, tag = "6")]
1673    pub raft_db_write_memtable_nanos: u64,
1674    /// Time waiting for peers to confirm the proposal (counting from the instant when the leader sends the proposal message).
1675    #[prost(uint64, tag = "7")]
1676    pub commit_log_nanos: u64,
1677    /// Wait duration in the apply loop.
1678    #[prost(uint64, tag = "8")]
1679    pub apply_batch_wait_nanos: u64,
1680    /// Total time spend to applying the log.
1681    #[prost(uint64, tag = "9")]
1682    pub apply_log_nanos: u64,
1683    /// Wait time until the KV RocksDB lock is acquired.
1684    #[prost(uint64, tag = "10")]
1685    pub apply_mutex_lock_nanos: u64,
1686    /// Wait time until becoming the KV RocksDB write leader.
1687    #[prost(uint64, tag = "11")]
1688    pub apply_write_leader_wait_nanos: u64,
1689    /// Time spent on writing the KV DB WAL to the disk.
1690    #[prost(uint64, tag = "12")]
1691    pub apply_write_wal_nanos: u64,
1692    /// Time spent on writing to the memtable of the KV RocksDB.
1693    #[prost(uint64, tag = "13")]
1694    pub apply_write_memtable_nanos: u64,
1695    /// Time spent on waiting in the latch.
1696    #[prost(uint64, tag = "14")]
1697    pub latch_wait_nanos: u64,
1698    /// Processing time in the transaction layer.
1699    #[prost(uint64, tag = "15")]
1700    pub process_nanos: u64,
1701    /// Wait time because of the scheduler flow control or quota limiter throttling.
1702    #[prost(uint64, tag = "16")]
1703    pub throttle_nanos: u64,
1704    /// Wait time in the waiter manager for pessimistic locking.
1705    #[prost(uint64, tag = "17")]
1706    pub pessimistic_lock_wait_nanos: u64,
1707}
1708#[allow(clippy::derive_partial_eq_without_eq)]
1709#[derive(Clone, PartialEq, ::prost::Message)]
1710pub struct KvPair {
1711    #[prost(message, optional, tag = "1")]
1712    pub error: ::core::option::Option<KeyError>,
1713    #[prost(bytes = "vec", tag = "2")]
1714    pub key: ::prost::alloc::vec::Vec<u8>,
1715    #[prost(bytes = "vec", tag = "3")]
1716    pub value: ::prost::alloc::vec::Vec<u8>,
1717}
1718#[allow(clippy::derive_partial_eq_without_eq)]
1719#[derive(Clone, PartialEq, ::prost::Message)]
1720pub struct Mutation {
1721    #[prost(enumeration = "Op", tag = "1")]
1722    pub op: i32,
1723    #[prost(bytes = "vec", tag = "2")]
1724    pub key: ::prost::alloc::vec::Vec<u8>,
1725    #[prost(bytes = "vec", tag = "3")]
1726    pub value: ::prost::alloc::vec::Vec<u8>,
1727    #[prost(enumeration = "Assertion", tag = "4")]
1728    pub assertion: i32,
1729}
1730#[allow(clippy::derive_partial_eq_without_eq)]
1731#[derive(Clone, PartialEq, ::prost::Message)]
1732pub struct MvccWrite {
1733    #[prost(enumeration = "Op", tag = "1")]
1734    pub r#type: i32,
1735    #[prost(uint64, tag = "2")]
1736    pub start_ts: u64,
1737    #[prost(uint64, tag = "3")]
1738    pub commit_ts: u64,
1739    #[prost(bytes = "vec", tag = "4")]
1740    pub short_value: ::prost::alloc::vec::Vec<u8>,
1741    #[prost(bool, tag = "5")]
1742    pub has_overlapped_rollback: bool,
1743    #[prost(bool, tag = "6")]
1744    pub has_gc_fence: bool,
1745    #[prost(uint64, tag = "7")]
1746    pub gc_fence: u64,
1747    #[prost(uint64, tag = "8")]
1748    pub last_change_ts: u64,
1749    #[prost(uint64, tag = "9")]
1750    pub versions_to_last_change: u64,
1751}
1752#[allow(clippy::derive_partial_eq_without_eq)]
1753#[derive(Clone, PartialEq, ::prost::Message)]
1754pub struct MvccValue {
1755    #[prost(uint64, tag = "1")]
1756    pub start_ts: u64,
1757    #[prost(bytes = "vec", tag = "2")]
1758    pub value: ::prost::alloc::vec::Vec<u8>,
1759}
1760#[allow(clippy::derive_partial_eq_without_eq)]
1761#[derive(Clone, PartialEq, ::prost::Message)]
1762pub struct MvccLock {
1763    #[prost(enumeration = "Op", tag = "1")]
1764    pub r#type: i32,
1765    #[prost(uint64, tag = "2")]
1766    pub start_ts: u64,
1767    #[prost(bytes = "vec", tag = "3")]
1768    pub primary: ::prost::alloc::vec::Vec<u8>,
1769    #[prost(bytes = "vec", tag = "4")]
1770    pub short_value: ::prost::alloc::vec::Vec<u8>,
1771    #[prost(uint64, tag = "5")]
1772    pub ttl: u64,
1773    #[prost(uint64, tag = "6")]
1774    pub for_update_ts: u64,
1775    #[prost(uint64, tag = "7")]
1776    pub txn_size: u64,
1777    #[prost(bool, tag = "8")]
1778    pub use_async_commit: bool,
1779    #[prost(bytes = "vec", repeated, tag = "9")]
1780    pub secondaries: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1781    #[prost(uint64, repeated, tag = "10")]
1782    pub rollback_ts: ::prost::alloc::vec::Vec<u64>,
1783    #[prost(uint64, tag = "11")]
1784    pub last_change_ts: u64,
1785    #[prost(uint64, tag = "12")]
1786    pub versions_to_last_change: u64,
1787}
1788#[allow(clippy::derive_partial_eq_without_eq)]
1789#[derive(Clone, PartialEq, ::prost::Message)]
1790pub struct MvccInfo {
1791    #[prost(message, optional, tag = "1")]
1792    pub lock: ::core::option::Option<MvccLock>,
1793    #[prost(message, repeated, tag = "2")]
1794    pub writes: ::prost::alloc::vec::Vec<MvccWrite>,
1795    #[prost(message, repeated, tag = "3")]
1796    pub values: ::prost::alloc::vec::Vec<MvccValue>,
1797}
1798#[allow(clippy::derive_partial_eq_without_eq)]
1799#[derive(Clone, PartialEq, ::prost::Message)]
1800pub struct TxnInfo {
1801    #[prost(uint64, tag = "1")]
1802    pub txn: u64,
1803    #[prost(uint64, tag = "2")]
1804    pub status: u64,
1805    /// Reserved for file based transaction.
1806    #[prost(bool, tag = "100")]
1807    pub is_txn_file: bool,
1808}
1809#[allow(clippy::derive_partial_eq_without_eq)]
1810#[derive(Clone, PartialEq, ::prost::Message)]
1811pub struct KeyRange {
1812    #[prost(bytes = "vec", tag = "1")]
1813    pub start_key: ::prost::alloc::vec::Vec<u8>,
1814    #[prost(bytes = "vec", tag = "2")]
1815    pub end_key: ::prost::alloc::vec::Vec<u8>,
1816}
1817#[allow(clippy::derive_partial_eq_without_eq)]
1818#[derive(Clone, PartialEq, ::prost::Message)]
1819pub struct LeaderInfo {
1820    #[prost(uint64, tag = "1")]
1821    pub region_id: u64,
1822    #[prost(uint64, tag = "2")]
1823    pub peer_id: u64,
1824    #[prost(uint64, tag = "3")]
1825    pub term: u64,
1826    #[prost(message, optional, tag = "4")]
1827    pub region_epoch: ::core::option::Option<super::metapb::RegionEpoch>,
1828    #[prost(message, optional, tag = "5")]
1829    pub read_state: ::core::option::Option<ReadState>,
1830}
1831#[allow(clippy::derive_partial_eq_without_eq)]
1832#[derive(Clone, PartialEq, ::prost::Message)]
1833pub struct ReadState {
1834    #[prost(uint64, tag = "1")]
1835    pub applied_index: u64,
1836    #[prost(uint64, tag = "2")]
1837    pub safe_ts: u64,
1838}
1839#[allow(clippy::derive_partial_eq_without_eq)]
1840#[derive(Clone, PartialEq, ::prost::Message)]
1841pub struct CheckLeaderRequest {
1842    #[prost(message, repeated, tag = "1")]
1843    pub regions: ::prost::alloc::vec::Vec<LeaderInfo>,
1844    #[prost(uint64, tag = "2")]
1845    pub ts: u64,
1846}
1847#[allow(clippy::derive_partial_eq_without_eq)]
1848#[derive(Clone, PartialEq, ::prost::Message)]
1849pub struct CheckLeaderResponse {
1850    #[prost(uint64, repeated, tag = "1")]
1851    pub regions: ::prost::alloc::vec::Vec<u64>,
1852    #[prost(uint64, tag = "2")]
1853    pub ts: u64,
1854}
1855#[allow(clippy::derive_partial_eq_without_eq)]
1856#[derive(Clone, PartialEq, ::prost::Message)]
1857pub struct StoreSafeTsRequest {
1858    /// Get the minimal `safe_ts` from regions that overlap with the key range \[`start_key`, `end_key`)
1859    /// An empty key range means all regions in the store
1860    #[prost(message, optional, tag = "1")]
1861    pub key_range: ::core::option::Option<KeyRange>,
1862}
1863#[allow(clippy::derive_partial_eq_without_eq)]
1864#[derive(Clone, PartialEq, ::prost::Message)]
1865pub struct StoreSafeTsResponse {
1866    #[prost(uint64, tag = "1")]
1867    pub safe_ts: u64,
1868}
1869#[allow(clippy::derive_partial_eq_without_eq)]
1870#[derive(Clone, PartialEq, ::prost::Message)]
1871pub struct RawGetKeyTtlRequest {
1872    #[prost(message, optional, tag = "1")]
1873    pub context: ::core::option::Option<Context>,
1874    #[prost(bytes = "vec", tag = "2")]
1875    pub key: ::prost::alloc::vec::Vec<u8>,
1876    #[prost(string, tag = "3")]
1877    pub cf: ::prost::alloc::string::String,
1878}
1879#[allow(clippy::derive_partial_eq_without_eq)]
1880#[derive(Clone, PartialEq, ::prost::Message)]
1881pub struct RawGetKeyTtlResponse {
1882    #[prost(message, optional, tag = "1")]
1883    pub region_error: ::core::option::Option<super::errorpb::Error>,
1884    #[prost(string, tag = "2")]
1885    pub error: ::prost::alloc::string::String,
1886    #[prost(uint64, tag = "3")]
1887    pub ttl: u64,
1888    #[prost(bool, tag = "4")]
1889    pub not_found: bool,
1890}
1891#[allow(clippy::derive_partial_eq_without_eq)]
1892#[derive(Clone, PartialEq, ::prost::Message)]
1893pub struct RawCasRequest {
1894    #[prost(message, optional, tag = "1")]
1895    pub context: ::core::option::Option<Context>,
1896    #[prost(bytes = "vec", tag = "2")]
1897    pub key: ::prost::alloc::vec::Vec<u8>,
1898    #[prost(bytes = "vec", tag = "3")]
1899    pub value: ::prost::alloc::vec::Vec<u8>,
1900    #[prost(bool, tag = "4")]
1901    pub previous_not_exist: bool,
1902    #[prost(bytes = "vec", tag = "5")]
1903    pub previous_value: ::prost::alloc::vec::Vec<u8>,
1904    #[prost(string, tag = "6")]
1905    pub cf: ::prost::alloc::string::String,
1906    #[prost(uint64, tag = "7")]
1907    pub ttl: u64,
1908}
1909#[allow(clippy::derive_partial_eq_without_eq)]
1910#[derive(Clone, PartialEq, ::prost::Message)]
1911pub struct RawCasResponse {
1912    #[prost(message, optional, tag = "1")]
1913    pub region_error: ::core::option::Option<super::errorpb::Error>,
1914    #[prost(string, tag = "2")]
1915    pub error: ::prost::alloc::string::String,
1916    #[prost(bool, tag = "3")]
1917    pub succeed: bool,
1918    /// The previous value regardless of whether the comparison is succeed.
1919    #[prost(bool, tag = "4")]
1920    pub previous_not_exist: bool,
1921    #[prost(bytes = "vec", tag = "5")]
1922    pub previous_value: ::prost::alloc::vec::Vec<u8>,
1923}
1924#[allow(clippy::derive_partial_eq_without_eq)]
1925#[derive(Clone, PartialEq, ::prost::Message)]
1926pub struct GetLockWaitInfoRequest {
1927    /// TODO: There may need some filter options to be used on conditional querying, e.g., finding
1928    /// the lock waiting status for some specified transaction.
1929    #[prost(message, optional, tag = "1")]
1930    pub context: ::core::option::Option<Context>,
1931}
1932#[allow(clippy::derive_partial_eq_without_eq)]
1933#[derive(Clone, PartialEq, ::prost::Message)]
1934pub struct GetLockWaitInfoResponse {
1935    #[prost(message, optional, tag = "1")]
1936    pub region_error: ::core::option::Option<super::errorpb::Error>,
1937    #[prost(string, tag = "2")]
1938    pub error: ::prost::alloc::string::String,
1939    #[prost(message, repeated, tag = "3")]
1940    pub entries: ::prost::alloc::vec::Vec<super::deadlock::WaitForEntry>,
1941}
1942#[allow(clippy::derive_partial_eq_without_eq)]
1943#[derive(Clone, PartialEq, ::prost::Message)]
1944pub struct GetLockWaitHistoryRequest {
1945    /// TODO: There may need some filter options to be used on conditional querying, e.g., finding
1946    /// the lock waiting status for some specified transaction.
1947    #[prost(message, optional, tag = "1")]
1948    pub context: ::core::option::Option<Context>,
1949}
1950#[allow(clippy::derive_partial_eq_without_eq)]
1951#[derive(Clone, PartialEq, ::prost::Message)]
1952pub struct GetLockWaitHistoryResponse {
1953    #[prost(message, optional, tag = "1")]
1954    pub region_error: ::core::option::Option<super::errorpb::Error>,
1955    #[prost(string, tag = "2")]
1956    pub error: ::prost::alloc::string::String,
1957    #[prost(message, repeated, tag = "3")]
1958    pub entries: ::prost::alloc::vec::Vec<super::deadlock::WaitForEntry>,
1959}
1960#[allow(clippy::derive_partial_eq_without_eq)]
1961#[derive(Clone, PartialEq, ::prost::Message)]
1962pub struct RawCoprocessorRequest {
1963    #[prost(message, optional, tag = "1")]
1964    pub context: ::core::option::Option<Context>,
1965    #[prost(string, tag = "2")]
1966    pub copr_name: ::prost::alloc::string::String,
1967    /// Coprorcessor version constraint following SEMVER definition.
1968    #[prost(string, tag = "3")]
1969    pub copr_version_req: ::prost::alloc::string::String,
1970    #[prost(message, repeated, tag = "4")]
1971    pub ranges: ::prost::alloc::vec::Vec<KeyRange>,
1972    #[prost(bytes = "vec", tag = "5")]
1973    pub data: ::prost::alloc::vec::Vec<u8>,
1974}
1975#[allow(clippy::derive_partial_eq_without_eq)]
1976#[derive(Clone, PartialEq, ::prost::Message)]
1977pub struct RawCoprocessorResponse {
1978    #[prost(message, optional, tag = "1")]
1979    pub region_error: ::core::option::Option<super::errorpb::Error>,
1980    /// Error message for cases like if no coprocessor with a matching name is found
1981    /// or on a version mismatch between plugin_api and the coprocessor.
1982    #[prost(string, tag = "2")]
1983    pub error: ::prost::alloc::string::String,
1984    #[prost(bytes = "vec", tag = "3")]
1985    pub data: ::prost::alloc::vec::Vec<u8>,
1986}
1987#[allow(clippy::derive_partial_eq_without_eq)]
1988#[derive(Clone, PartialEq, ::prost::Message)]
1989pub struct RawChecksumRequest {
1990    #[prost(message, optional, tag = "1")]
1991    pub context: ::core::option::Option<Context>,
1992    #[prost(enumeration = "ChecksumAlgorithm", tag = "2")]
1993    pub algorithm: i32,
1994    #[prost(message, repeated, tag = "3")]
1995    pub ranges: ::prost::alloc::vec::Vec<KeyRange>,
1996}
1997#[allow(clippy::derive_partial_eq_without_eq)]
1998#[derive(Clone, PartialEq, ::prost::Message)]
1999pub struct RawChecksumResponse {
2000    #[prost(message, optional, tag = "1")]
2001    pub region_error: ::core::option::Option<super::errorpb::Error>,
2002    #[prost(string, tag = "2")]
2003    pub error: ::prost::alloc::string::String,
2004    #[prost(uint64, tag = "3")]
2005    pub checksum: u64,
2006    #[prost(uint64, tag = "4")]
2007    pub total_kvs: u64,
2008    #[prost(uint64, tag = "5")]
2009    pub total_bytes: u64,
2010}
2011#[allow(clippy::derive_partial_eq_without_eq)]
2012#[derive(Clone, PartialEq, ::prost::Message)]
2013pub struct CompactError {
2014    #[prost(oneof = "compact_error::Error", tags = "1, 2, 3, 4")]
2015    pub error: ::core::option::Option<compact_error::Error>,
2016}
2017/// Nested message and enum types in `CompactError`.
2018pub mod compact_error {
2019    #[allow(clippy::derive_partial_eq_without_eq)]
2020    #[derive(Clone, PartialEq, ::prost::Oneof)]
2021    pub enum Error {
2022        #[prost(message, tag = "1")]
2023        ErrInvalidStartKey(super::CompactErrorInvalidStartKey),
2024        #[prost(message, tag = "2")]
2025        ErrPhysicalTableNotExist(super::CompactErrorPhysicalTableNotExist),
2026        #[prost(message, tag = "3")]
2027        ErrCompactInProgress(super::CompactErrorCompactInProgress),
2028        #[prost(message, tag = "4")]
2029        ErrTooManyPendingTasks(super::CompactErrorTooManyPendingTasks),
2030    }
2031}
2032#[allow(clippy::derive_partial_eq_without_eq)]
2033#[derive(Clone, PartialEq, ::prost::Message)]
2034pub struct CompactErrorInvalidStartKey {}
2035#[allow(clippy::derive_partial_eq_without_eq)]
2036#[derive(Clone, PartialEq, ::prost::Message)]
2037pub struct CompactErrorPhysicalTableNotExist {}
2038#[allow(clippy::derive_partial_eq_without_eq)]
2039#[derive(Clone, PartialEq, ::prost::Message)]
2040pub struct CompactErrorCompactInProgress {}
2041#[allow(clippy::derive_partial_eq_without_eq)]
2042#[derive(Clone, PartialEq, ::prost::Message)]
2043pub struct CompactErrorTooManyPendingTasks {}
2044#[allow(clippy::derive_partial_eq_without_eq)]
2045#[derive(Clone, PartialEq, ::prost::Message)]
2046pub struct CompactRequest {
2047    /// If specified, the compaction will start from this start key.
2048    /// If unspecified, the compaction will start from beginning.
2049    /// NOTE 1: The start key should be never manually constructed. You should always use a key
2050    /// returned in CompactResponse.
2051    /// NOTE 2: the compaction range will be always restricted by physical_table_id.
2052    #[prost(bytes = "vec", tag = "1")]
2053    pub start_key: ::prost::alloc::vec::Vec<u8>,
2054    /// The physical table that will be compacted.
2055    ///
2056    /// TODO: this is information that TiKV doesn't need to know.
2057    /// See <https://github.com/pingcap/kvproto/issues/912>
2058    #[prost(int64, tag = "2")]
2059    pub physical_table_id: i64,
2060    /// The logical table id of the compaction. When receiving parallel requests with the same
2061    /// logical table id, err_compact_in_progress will be returned.
2062    ///
2063    /// TODO: this is information that TiKV doesn't need to know.
2064    /// See <https://github.com/pingcap/kvproto/issues/912>
2065    #[prost(int64, tag = "3")]
2066    pub logical_table_id: i64,
2067    /// API version of the request
2068    #[prost(enumeration = "ApiVersion", tag = "7")]
2069    pub api_version: i32,
2070    /// Keyspace of the table located in.
2071    #[prost(uint32, tag = "8")]
2072    pub keyspace_id: u32,
2073}
2074#[allow(clippy::derive_partial_eq_without_eq)]
2075#[derive(Clone, PartialEq, ::prost::Message)]
2076pub struct CompactResponse {
2077    #[prost(message, optional, tag = "1")]
2078    pub error: ::core::option::Option<CompactError>,
2079    /// The compaction is done incrementally. If there are more data to compact, this field
2080    /// will be set. The client can request to compact more data according to the `compacted_end_key`.
2081    #[prost(bool, tag = "2")]
2082    pub has_remaining: bool,
2083    #[prost(bytes = "vec", tag = "3")]
2084    pub compacted_start_key: ::prost::alloc::vec::Vec<u8>,
2085    #[prost(bytes = "vec", tag = "4")]
2086    pub compacted_end_key: ::prost::alloc::vec::Vec<u8>,
2087}
2088#[allow(clippy::derive_partial_eq_without_eq)]
2089#[derive(Clone, PartialEq, ::prost::Message)]
2090pub struct TiFlashSystemTableRequest {
2091    #[prost(string, tag = "1")]
2092    pub sql: ::prost::alloc::string::String,
2093}
2094#[allow(clippy::derive_partial_eq_without_eq)]
2095#[derive(Clone, PartialEq, ::prost::Message)]
2096pub struct TiFlashSystemTableResponse {
2097    #[prost(bytes = "vec", tag = "1")]
2098    pub data: ::prost::alloc::vec::Vec<u8>,
2099}
2100/// Used to specify the behavior when a pessimistic lock request is woken up after waiting for another
2101/// lock.
2102#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2103#[repr(i32)]
2104pub enum PessimisticLockWakeUpMode {
2105    /// When woken up, returns WriteConflict error to the client and the client should retry if necessary.
2106    /// In this mode, results of `return_values` or `check_existence` will be set to `values` and `not_founds`
2107    /// fields of the PessimisticLockResponse, which is compatible with old versions.
2108    WakeUpModeNormal = 0,
2109    /// When woken up, continue trying to lock the key. This implicitly enables the `allow_lock_with_conflict`
2110    /// behavior, which means, allow acquiring the lock even if there is WriteConflict on the key.
2111    /// In this mode, `return_values` or `check_existence` fields of PessimisticLockResponse won't be used, and
2112    /// all results are carried in the `results` field.
2113    WakeUpModeForceLock = 1,
2114}
2115impl PessimisticLockWakeUpMode {
2116    /// String value of the enum field names used in the ProtoBuf definition.
2117    ///
2118    /// The values are not transformed in any way and thus are considered stable
2119    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2120    pub fn as_str_name(&self) -> &'static str {
2121        match self {
2122            PessimisticLockWakeUpMode::WakeUpModeNormal => "WakeUpModeNormal",
2123            PessimisticLockWakeUpMode::WakeUpModeForceLock => "WakeUpModeForceLock",
2124        }
2125    }
2126    /// Creates an enum from field names used in the ProtoBuf definition.
2127    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2128        match value {
2129            "WakeUpModeNormal" => Some(Self::WakeUpModeNormal),
2130            "WakeUpModeForceLock" => Some(Self::WakeUpModeForceLock),
2131            _ => None,
2132        }
2133    }
2134}
2135#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2136#[repr(i32)]
2137pub enum PessimisticLockKeyResultType {
2138    LockResultNormal = 0,
2139    LockResultLockedWithConflict = 1,
2140    LockResultFailed = 2,
2141}
2142impl PessimisticLockKeyResultType {
2143    /// String value of the enum field names used in the ProtoBuf definition.
2144    ///
2145    /// The values are not transformed in any way and thus are considered stable
2146    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2147    pub fn as_str_name(&self) -> &'static str {
2148        match self {
2149            PessimisticLockKeyResultType::LockResultNormal => "LockResultNormal",
2150            PessimisticLockKeyResultType::LockResultLockedWithConflict => {
2151                "LockResultLockedWithConflict"
2152            }
2153            PessimisticLockKeyResultType::LockResultFailed => "LockResultFailed",
2154        }
2155    }
2156    /// Creates an enum from field names used in the ProtoBuf definition.
2157    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2158        match value {
2159            "LockResultNormal" => Some(Self::LockResultNormal),
2160            "LockResultLockedWithConflict" => Some(Self::LockResultLockedWithConflict),
2161            "LockResultFailed" => Some(Self::LockResultFailed),
2162            _ => None,
2163        }
2164    }
2165}
2166/// The API version the server and the client is using.
2167/// See more details in <https://github.com/tikv/rfcs/blob/master/text/0069-api-v2.md.>
2168#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2169#[repr(i32)]
2170pub enum ApiVersion {
2171    /// `V1` is mainly for TiDB & TxnKV, and is not safe to use RawKV along with the others.
2172    /// V1 server only accepts V1 requests. V1 raw requests with TTL will be rejected.
2173    V1 = 0,
2174    /// ## `V1TTL` is only available to RawKV, and 8 bytes representing the unix timestamp in
2175    /// seconds for expiring time will be append to the value of all RawKV entries. For example:
2176    ///
2177    /// ## \| User value     | Expire Ts                               |
2178    ///
2179    /// ## \| 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff |
2180    ///
2181    /// V1TTL server only accepts V1 raw requests.
2182    /// V1 client should not use `V1TTL` in request. V1 client should always send `V1`.
2183    V1ttl = 1,
2184    /// `V2` use new encoding for RawKV & TxnKV to support more features.
2185    ///
2186    /// Key Encoding:
2187    /// TiDB: start with `m` or `t`, the same as `V1`.
2188    /// TxnKV: prefix with `x`, encoded as `MCE( x{keyspace id} + {user key} ) + timestamp`.
2189    /// RawKV: prefix with `r`, encoded as `MCE( r{keyspace id} + {user key} ) + timestamp`.
2190    /// Where the `{keyspace id}` is fixed-length of 3 bytes in network byte order.
2191    /// Besides, RawKV entires must be in `default` CF.
2192    ///
2193    /// ## Value Encoding:
2194    /// TiDB & TxnKV: the same as `V1`.
2195    /// RawKV: `{user value} + {optional fields} + {meta flag}`. The last byte in the
2196    /// raw value must be meta flags. For example:
2197    ///
2198    /// ## \| User value     | Meta flags        |
2199    ///
2200    /// ## \| 0x12 0x34 0x56 | 0x00 (0b00000000) |
2201    ///
2202    /// ## Bit 0 of meta flags is for TTL. If set, the value contains 8 bytes expiring time as
2203    /// unix timestamp in seconds at the very left to the meta flags.
2204    ///
2205    /// ## \| User value     | Expiring time                           | Meta flags        |
2206    ///
2207    /// ## \| 0x12 0x34 0x56 | 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff | 0x01 (0b00000001) |
2208    ///
2209    /// ## Bit 1 is for deletion. If set, the entry is logical deleted.
2210    ///
2211    /// |Meta flags|
2212    /// |----------|
2213    /// |0x02 (0b00000010)|
2214    ///
2215    /// ---
2216    ///
2217    /// V2 server accpets V2 requests and V1 transactional requests that statrts with TiDB key
2218    /// prefix (`m` and `t`).
2219    V2 = 2,
2220}
2221impl ApiVersion {
2222    /// String value of the enum field names used in the ProtoBuf definition.
2223    ///
2224    /// The values are not transformed in any way and thus are considered stable
2225    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2226    pub fn as_str_name(&self) -> &'static str {
2227        match self {
2228            ApiVersion::V1 => "V1",
2229            ApiVersion::V1ttl => "V1TTL",
2230            ApiVersion::V2 => "V2",
2231        }
2232    }
2233    /// Creates an enum from field names used in the ProtoBuf definition.
2234    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2235        match value {
2236            "V1" => Some(Self::V1),
2237            "V1TTL" => Some(Self::V1ttl),
2238            "V2" => Some(Self::V2),
2239            _ => None,
2240        }
2241    }
2242}
2243#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2244#[repr(i32)]
2245pub enum CommandPri {
2246    /// Normal is the default value.
2247    Normal = 0,
2248    Low = 1,
2249    High = 2,
2250}
2251impl CommandPri {
2252    /// String value of the enum field names used in the ProtoBuf definition.
2253    ///
2254    /// The values are not transformed in any way and thus are considered stable
2255    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2256    pub fn as_str_name(&self) -> &'static str {
2257        match self {
2258            CommandPri::Normal => "Normal",
2259            CommandPri::Low => "Low",
2260            CommandPri::High => "High",
2261        }
2262    }
2263    /// Creates an enum from field names used in the ProtoBuf definition.
2264    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2265        match value {
2266            "Normal" => Some(Self::Normal),
2267            "Low" => Some(Self::Low),
2268            "High" => Some(Self::High),
2269            _ => None,
2270        }
2271    }
2272}
2273#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2274#[repr(i32)]
2275pub enum IsolationLevel {
2276    /// SI = snapshot isolation
2277    Si = 0,
2278    /// RC = read committed
2279    Rc = 1,
2280    /// RC read and it's needed to check if there exists more recent versions.
2281    RcCheckTs = 2,
2282}
2283impl IsolationLevel {
2284    /// String value of the enum field names used in the ProtoBuf definition.
2285    ///
2286    /// The values are not transformed in any way and thus are considered stable
2287    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2288    pub fn as_str_name(&self) -> &'static str {
2289        match self {
2290            IsolationLevel::Si => "SI",
2291            IsolationLevel::Rc => "RC",
2292            IsolationLevel::RcCheckTs => "RCCheckTS",
2293        }
2294    }
2295    /// Creates an enum from field names used in the ProtoBuf definition.
2296    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2297        match value {
2298            "SI" => Some(Self::Si),
2299            "RC" => Some(Self::Rc),
2300            "RCCheckTS" => Some(Self::RcCheckTs),
2301            _ => None,
2302        }
2303    }
2304}
2305/// Operation allowed info during each TiKV storage threshold.
2306#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2307#[repr(i32)]
2308pub enum DiskFullOpt {
2309    /// The default value, means operations are not allowed either under almost full or already full.
2310    NotAllowedOnFull = 0,
2311    /// Means operations will be allowed when disk is almost full.
2312    AllowedOnAlmostFull = 1,
2313    /// Means operations will be allowed when disk is already full.
2314    AllowedOnAlreadyFull = 2,
2315}
2316impl DiskFullOpt {
2317    /// String value of the enum field names used in the ProtoBuf definition.
2318    ///
2319    /// The values are not transformed in any way and thus are considered stable
2320    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2321    pub fn as_str_name(&self) -> &'static str {
2322        match self {
2323            DiskFullOpt::NotAllowedOnFull => "NotAllowedOnFull",
2324            DiskFullOpt::AllowedOnAlmostFull => "AllowedOnAlmostFull",
2325            DiskFullOpt::AllowedOnAlreadyFull => "AllowedOnAlreadyFull",
2326        }
2327    }
2328    /// Creates an enum from field names used in the ProtoBuf definition.
2329    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2330        match value {
2331            "NotAllowedOnFull" => Some(Self::NotAllowedOnFull),
2332            "AllowedOnAlmostFull" => Some(Self::AllowedOnAlmostFull),
2333            "AllowedOnAlreadyFull" => Some(Self::AllowedOnAlreadyFull),
2334            _ => None,
2335        }
2336    }
2337}
2338#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2339#[repr(i32)]
2340pub enum Op {
2341    Put = 0,
2342    Del = 1,
2343    Lock = 2,
2344    Rollback = 3,
2345    /// insert operation has a constraint that key should not exist before.
2346    Insert = 4,
2347    PessimisticLock = 5,
2348    CheckNotExists = 6,
2349}
2350impl Op {
2351    /// String value of the enum field names used in the ProtoBuf definition.
2352    ///
2353    /// The values are not transformed in any way and thus are considered stable
2354    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2355    pub fn as_str_name(&self) -> &'static str {
2356        match self {
2357            Op::Put => "Put",
2358            Op::Del => "Del",
2359            Op::Lock => "Lock",
2360            Op::Rollback => "Rollback",
2361            Op::Insert => "Insert",
2362            Op::PessimisticLock => "PessimisticLock",
2363            Op::CheckNotExists => "CheckNotExists",
2364        }
2365    }
2366    /// Creates an enum from field names used in the ProtoBuf definition.
2367    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2368        match value {
2369            "Put" => Some(Self::Put),
2370            "Del" => Some(Self::Del),
2371            "Lock" => Some(Self::Lock),
2372            "Rollback" => Some(Self::Rollback),
2373            "Insert" => Some(Self::Insert),
2374            "PessimisticLock" => Some(Self::PessimisticLock),
2375            "CheckNotExists" => Some(Self::CheckNotExists),
2376            _ => None,
2377        }
2378    }
2379}
2380#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2381#[repr(i32)]
2382pub enum Assertion {
2383    None = 0,
2384    Exist = 1,
2385    NotExist = 2,
2386}
2387impl Assertion {
2388    /// String value of the enum field names used in the ProtoBuf definition.
2389    ///
2390    /// The values are not transformed in any way and thus are considered stable
2391    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2392    pub fn as_str_name(&self) -> &'static str {
2393        match self {
2394            Assertion::None => "None",
2395            Assertion::Exist => "Exist",
2396            Assertion::NotExist => "NotExist",
2397        }
2398    }
2399    /// Creates an enum from field names used in the ProtoBuf definition.
2400    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2401        match value {
2402            "None" => Some(Self::None),
2403            "Exist" => Some(Self::Exist),
2404            "NotExist" => Some(Self::NotExist),
2405            _ => None,
2406        }
2407    }
2408}
2409#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2410#[repr(i32)]
2411pub enum AssertionLevel {
2412    /// No assertion.
2413    Off = 0,
2414    /// Assertion is enabled, but not enforced when it might affect performance.
2415    Fast = 1,
2416    /// Assertion is enabled and enforced.
2417    Strict = 2,
2418}
2419impl AssertionLevel {
2420    /// String value of the enum field names used in the ProtoBuf definition.
2421    ///
2422    /// The values are not transformed in any way and thus are considered stable
2423    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2424    pub fn as_str_name(&self) -> &'static str {
2425        match self {
2426            AssertionLevel::Off => "Off",
2427            AssertionLevel::Fast => "Fast",
2428            AssertionLevel::Strict => "Strict",
2429        }
2430    }
2431    /// Creates an enum from field names used in the ProtoBuf definition.
2432    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2433        match value {
2434            "Off" => Some(Self::Off),
2435            "Fast" => Some(Self::Fast),
2436            "Strict" => Some(Self::Strict),
2437            _ => None,
2438        }
2439    }
2440}
2441#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2442#[repr(i32)]
2443pub enum Action {
2444    NoAction = 0,
2445    TtlExpireRollback = 1,
2446    LockNotExistRollback = 2,
2447    MinCommitTsPushed = 3,
2448    TtlExpirePessimisticRollback = 4,
2449    LockNotExistDoNothing = 5,
2450}
2451impl Action {
2452    /// String value of the enum field names used in the ProtoBuf definition.
2453    ///
2454    /// The values are not transformed in any way and thus are considered stable
2455    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2456    pub fn as_str_name(&self) -> &'static str {
2457        match self {
2458            Action::NoAction => "NoAction",
2459            Action::TtlExpireRollback => "TTLExpireRollback",
2460            Action::LockNotExistRollback => "LockNotExistRollback",
2461            Action::MinCommitTsPushed => "MinCommitTSPushed",
2462            Action::TtlExpirePessimisticRollback => "TTLExpirePessimisticRollback",
2463            Action::LockNotExistDoNothing => "LockNotExistDoNothing",
2464        }
2465    }
2466    /// Creates an enum from field names used in the ProtoBuf definition.
2467    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2468        match value {
2469            "NoAction" => Some(Self::NoAction),
2470            "TTLExpireRollback" => Some(Self::TtlExpireRollback),
2471            "LockNotExistRollback" => Some(Self::LockNotExistRollback),
2472            "MinCommitTSPushed" => Some(Self::MinCommitTsPushed),
2473            "TTLExpirePessimisticRollback" => Some(Self::TtlExpirePessimisticRollback),
2474            "LockNotExistDoNothing" => Some(Self::LockNotExistDoNothing),
2475            _ => None,
2476        }
2477    }
2478}
2479#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2480#[repr(i32)]
2481pub enum ExtraOp {
2482    Noop = 0,
2483    /// ReadOldValue represents to output the previous value for delete/update operations.
2484    ReadOldValue = 1,
2485}
2486impl ExtraOp {
2487    /// String value of the enum field names used in the ProtoBuf definition.
2488    ///
2489    /// The values are not transformed in any way and thus are considered stable
2490    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2491    pub fn as_str_name(&self) -> &'static str {
2492        match self {
2493            ExtraOp::Noop => "Noop",
2494            ExtraOp::ReadOldValue => "ReadOldValue",
2495        }
2496    }
2497    /// Creates an enum from field names used in the ProtoBuf definition.
2498    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2499        match value {
2500            "Noop" => Some(Self::Noop),
2501            "ReadOldValue" => Some(Self::ReadOldValue),
2502            _ => None,
2503        }
2504    }
2505}
2506#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2507#[repr(i32)]
2508pub enum ChecksumAlgorithm {
2509    Crc64Xor = 0,
2510}
2511impl ChecksumAlgorithm {
2512    /// String value of the enum field names used in the ProtoBuf definition.
2513    ///
2514    /// The values are not transformed in any way and thus are considered stable
2515    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2516    pub fn as_str_name(&self) -> &'static str {
2517        match self {
2518            ChecksumAlgorithm::Crc64Xor => "Crc64_Xor",
2519        }
2520    }
2521    /// Creates an enum from field names used in the ProtoBuf definition.
2522    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2523        match value {
2524            "Crc64_Xor" => Some(Self::Crc64Xor),
2525            _ => None,
2526        }
2527    }
2528}