-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy patherrorpb.proto
208 lines (181 loc) · 6.97 KB
/
errorpb.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
syntax = "proto3";
package errorpb;
import "metapb.proto";
import "gogoproto/gogo.proto";
import "rustproto.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (rustproto.lite_runtime_all) = true;
option java_package = "org.tikv.kvproto";
// NotLeader is the error variant that tells a request be handle by raft leader
// is sent to raft follower or learner.
message NotLeader {
// The requested region ID
uint64 region_id = 1;
// Region leader of the requested region
metapb.Peer leader = 2;
}
// IsWitness is the error variant that tells a request be handle by witness
// which should be forbidden and retry.
message IsWitness {
// The requested region ID
uint64 region_id = 1;
}
// BucketVersionNotMatch is the error variant that tells the request buckets version is not match.
// client should update the buckets version and retry.
message BucketVersionNotMatch{
uint64 version = 1;
repeated bytes keys = 2;
}
message DiskFull {
// The requested store ID
repeated uint64 store_id = 1;
// The detailed info
string reason = 2;
}
// StoreNotMatch is the error variant that tells the request is sent to wrong store.
// (i.e. inconsistency of the store ID that request shows and the real store ID of this server.)
message StoreNotMatch {
// Store id in request
uint64 request_store_id = 1;
// Actual store id
uint64 actual_store_id = 2;
}
// RegionNotFound is the error variant that tells there isn't any region in this TiKV
// matches the requested region ID.
message RegionNotFound {
// The requested region ID
uint64 region_id = 1;
}
// RegionNotInitialized is the error variant that tells there isn't any initialized peer
// matchesthe request region ID.
message RegionNotInitialized {
// The request region ID
uint64 region_id = 1;
}
// KeyNotInRegion is the error variant that tells the key the request requires isn't present in
// this region.
message KeyNotInRegion {
// The requested key
bytes key = 1;
// The requested region ID
uint64 region_id = 2;
// Start key of the requested region
bytes start_key = 3;
// Snd key of the requested region
bytes end_key = 4;
}
// EpochNotMatch is the error variant that tells a region has been updated.
// (e.g. by splitting / merging, or raft Confchange.)
// Hence, a command is based on a stale version of a region.
message EpochNotMatch {
// Available regions that may be siblings of the requested one.
repeated metapb.Region current_regions = 1;
}
// ServerIsBusy is the error variant that tells the server is too busy to response.
message ServerIsBusy {
string reason = 1;
// The suggested backoff time
uint64 backoff_ms = 2;
uint32 estimated_wait_ms = 3;
// Current applied_index at the leader, may be used in replica read.
uint64 applied_index = 4;
}
// StaleCommand is the error variant that tells the command is stale, that is,
// the current request term is lower than current raft term.
// This can be retried at most time.
message StaleCommand {
}
// RaftEntryTooLarge is the error variant that tells the request is too large to be serialized to a
// reasonable small raft entry.
// (i.e. greater than the configured value `raft_entry_max_size` in `raftstore`)
message RaftEntryTooLarge {
// The requested region ID
uint64 region_id = 1;
// Size of the raft entry
uint64 entry_size = 2;
}
// MaxTimestampNotSynced is the error variant that tells the peer has just become a leader and
// updating the max timestamp in the concurrency manager from PD TSO is ongoing. In this case,
// the prewrite of an async commit transaction cannot succeed. The client can backoff and
// resend the request.
message MaxTimestampNotSynced {
}
// ReadIndexNotReady is the error variant that tells the read index request is not ready, that is,
// the current region is in a status that not ready to serve the read index request. For example,
// region is in splitting or merging status.
// This can be retried at most time.
message ReadIndexNotReady {
// The reason why the region is not ready to serve read index request
string reason = 1;
// The requested region ID
uint64 region_id = 2;
}
// ProposalInMergingMode is the error variant that tells the proposal is rejected because raft is
// in the merging mode. This may happen when BR/Lightning try to ingest SST.
// This can be retried at most time.
message ProposalInMergingMode {
// The requested region ID
uint64 region_id = 1;
}
message DataIsNotReady {
// The requested region ID
uint64 region_id = 1;
uint64 peer_id = 2;
uint64 safe_ts = 3;
}
message RecoveryInProgress {
// The requested region ID
uint64 region_id = 1;
}
message FlashbackInProgress {
// The requested region ID
uint64 region_id = 1;
uint64 flashback_start_ts = 2;
}
message FlashbackNotPrepared {
// The requested region ID
uint64 region_id = 1;
}
// MismatchPeerId is the error variant that tells the request is sent to wrong peer.
// Client receives this error should reload the region info and retry.
message MismatchPeerId {
uint64 request_peer_id = 1;
uint64 store_peer_id = 2;
}
// Error wraps all region errors, indicates an error encountered by a request.
message Error {
reserved "stale_epoch";
// The error message
string message = 1;
NotLeader not_leader = 2;
RegionNotFound region_not_found = 3;
KeyNotInRegion key_not_in_region = 4;
EpochNotMatch epoch_not_match = 5;
ServerIsBusy server_is_busy = 6;
StaleCommand stale_command = 7;
StoreNotMatch store_not_match = 8;
RaftEntryTooLarge raft_entry_too_large = 9;
MaxTimestampNotSynced max_timestamp_not_synced = 10;
ReadIndexNotReady read_index_not_ready = 11;
ProposalInMergingMode proposal_in_merging_mode = 12;
DataIsNotReady data_is_not_ready = 13;
RegionNotInitialized region_not_initialized = 14;
DiskFull disk_full = 15;
// Online recovery is still in performing, reject writes to avoid potential issues
RecoveryInProgress RecoveryInProgress = 16;
// Flashback is still in performing, reject any read or write to avoid potential issues.
// NOTICE: this error is non-retryable, the request should fail ASAP when it meets this error.
FlashbackInProgress FlashbackInProgress = 17;
// If the second phase flashback request is sent to a region that is not prepared for the flashback,
// this error will be returned.
// NOTICE: this error is non-retryable, the client should retry the first phase flashback request when it meets this error.
FlashbackNotPrepared FlashbackNotPrepared = 18;
// IsWitness is the error variant that tells a request be handle by witness
// which should be forbidden and retry.
IsWitness is_witness = 19;
MismatchPeerId mismatch_peer_id = 20;
// BucketVersionNotMatch is the error variant that tells the request buckets version is not match.
BucketVersionNotMatch bucket_version_not_match = 21;
}