-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathdisaggregated.proto
169 lines (142 loc) · 4.57 KB
/
disaggregated.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
syntax = "proto3";
package disaggregated;
import "coprocessor.proto";
import "kvrpcpb.proto";
option java_package = "org.tikv.kvproto";
/// For S3 lock service ///
message S3LockResult {
oneof error {
Success success = 1;
NotOwner not_owner = 2;
Conflict conflict = 3;
}
}
message Success {}
// Error caused by S3GC owner changed
// client should retry
message NotOwner{
}
// Error caused by concurrency conflict,
// request cancel
message Conflict {
string reason = 1;
}
message TryAddLockRequest {
// The data file key to add lock
bytes data_file_key = 1;
// The lock store id
uint64 lock_store_id = 3;
// The upload sequence number of lock store
uint64 lock_seq = 4;
}
message TryAddLockResponse {
S3LockResult result = 1;
}
message TryMarkDeleteRequest {
// The data file key to be marked as deleted
bytes data_file_key = 1;
}
message TryMarkDeleteResponse {
S3LockResult result = 1;
}
/// For disagg compute node init its disagg configuration ///
message GetDisaggConfigRequest {
}
message DisaggS3Config {
string bucket = 1;
string root = 2;
string endpoint = 3;
}
message GetDisaggConfigResponse {
DisaggS3Config s3_config = 1;
}
/// For compute task dispatch and data exchange ///
message DisaggTaskMeta {
uint64 start_ts = 1; // start ts of a query
// gather_id + query_ts + server_id + local_query_id to represent a global unique query.
int64 gather_id = 9; // used to distinguish different gathers in the mpp query
uint64 query_ts = 2; // timestamp when start to execute query, used for TiFlash miniTSO schedule.
uint64 server_id = 3; // TiDB server id
uint64 local_query_id = 4; // unique local query_id if tidb don't restart.
int64 task_id = 5; // if task id is -1 , it indicates a tidb task.
string executor_id = 6; // the exectuor id
uint32 keyspace_id = 7; // keyspace id of the request
kvrpcpb.APIVersion api_version = 8; // API version of the request
uint64 connection_id = 10; // This is the session id between a client and tidb
string connection_alias = 11; // This is the session alias between a client and tidb
}
message DisaggReadError {
int32 code = 1;
string msg = 2;
}
message EstablishDisaggTaskError {
oneof errors {
ErrorRegion error_region = 1;
ErrorLocked error_locked = 2;
ErrorOther error_other = 99;
}
}
message ErrorRegion {
string msg = 1;
// The read node needs to update its region cache about these regions.
repeated uint64 region_ids = 2;
}
message ErrorLocked {
string msg = 1;
// The read node needs to resolve these locks.
repeated kvrpcpb.LockInfo locked = 2;
}
message ErrorOther {
int32 code = 1;
string msg = 2;
}
message EstablishDisaggTaskRequest {
DisaggTaskMeta meta = 1;
string address = 2; // target address of this task.
// The write node needs to ensure that subsequent
// FetchDisaggPagesRequest can be processed within timeout_s.
// unit: seconds
int64 timeout_s = 3;
// The key ranges, Region meta that read node need to execute TableScan
repeated coprocessor.RegionInfo regions = 4;
int64 schema_ver = 5;
// Used for PartitionTableScan
repeated coprocessor.TableRegions table_regions = 6;
// The encoded TableScan/PartitionTableScan + Selection.
bytes encoded_plan = 7;
}
message EstablishDisaggTaskResponse {
EstablishDisaggTaskError error = 1;
// Write node maintains a snapshot with a lease time.
// Read node should read the delta pages
// (ColumnFileInMemory and ColumnFileTiny)
// along with this store_id and snapshot_id.
uint64 store_id = 3; // metapb.Store.id
DisaggTaskMeta snapshot_id = 4;
// Serialized disaggregated tasks (per physical table)
repeated bytes tables = 5;
}
message CancelDisaggTaskRequest {
DisaggTaskMeta meta = 1;
}
message CancelDisaggTaskResponse {}
message FetchDisaggPagesRequest {
// The snapshot id to fetch pages
DisaggTaskMeta snapshot_id = 1;
int64 table_id = 2;
uint64 segment_id = 3;
// It must be a subset of the delta pages ids returned
// in EstablishDisaggTaskResponse.segments
repeated uint64 page_ids = 4;
}
message PagesPacket {
DisaggReadError error = 1;
// Serialized column file data
// * ColumnFilePersisted alone with its schema, page data, field offsets
repeated bytes pages = 2;
// * ColumnFileInMemory alone with its serialized block
repeated bytes chunks = 3;
// Return tipb.SelectResponse.execution_summaries in the
// last packet
repeated bytes summaries = 4;
}