File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -541,7 +541,9 @@ impl<PdC: PdClient> Transaction<PdC> {
541
541
let status = self . status . read ( ) . await ;
542
542
if !matches ! (
543
543
* status,
544
- TransactionStatus :: StartedRollback | TransactionStatus :: Active
544
+ TransactionStatus :: StartedRollback
545
+ | TransactionStatus :: Active
546
+ | TransactionStatus :: StartedCommit
545
547
) {
546
548
return Err ( Error :: OperationAfterCommitError ) ;
547
549
}
Original file line number Diff line number Diff line change
1
+ syntax = "proto3" ;
2
+ package coprocessor_v2 ;
3
+
4
+ import "errorpb.proto" ;
5
+ import "kvrpcpb.proto" ;
6
+ import "gogoproto/gogo.proto" ;
7
+ import "rustproto.proto" ;
8
+
9
+ option (gogoproto.marshaler_all ) = true ;
10
+ option (gogoproto.sizer_all ) = true ;
11
+ option (gogoproto.unmarshaler_all ) = true ;
12
+ option (rustproto.lite_runtime_all ) = true ;
13
+
14
+ option java_package = "org.tikv.kvproto" ;
15
+
16
+ message RawCoprocessorRequest {
17
+ kvrpcpb.Context context = 1 ;
18
+
19
+ string copr_name = 2 ;
20
+ string copr_version_constraint = 3 ;
21
+
22
+ bytes data = 4 ;
23
+ }
24
+
25
+ message RawCoprocessorResponse {
26
+ bytes data = 1 ;
27
+
28
+ errorpb.Error region_error = 2 ;
29
+
30
+ // Error message for cases like if no coprocessor with a matching name is found
31
+ // or on a version mismatch between plugin_api and the coprocessor.
32
+ string other_error = 4 ;
33
+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ syntax = "proto3";
2
2
package tikvpb ;
3
3
4
4
import "coprocessor.proto" ;
5
+ import "coprocessor_v2.proto" ;
5
6
import "kvrpcpb.proto" ;
6
7
import "mpp.proto" ;
7
8
import "raft_serverpb.proto" ;
@@ -69,6 +70,9 @@ service Tikv {
69
70
rpc CoprocessorStream (coprocessor .Request ) returns (stream coprocessor .Response ) {}
70
71
rpc BatchCoprocessor (coprocessor .BatchRequest ) returns (stream coprocessor .BatchResponse ) {}
71
72
73
+ // Command for executing custom user requests in TiKV coprocessor_v2.
74
+ rpc CoprocessorV2 (coprocessor_v2 .RawCoprocessorRequest ) returns (coprocessor_v2 .RawCoprocessorResponse ) {}
75
+
72
76
// Raft commands (sent between TiKV nodes).
73
77
rpc Raft (stream raft_serverpb .RaftMessage ) returns (raft_serverpb .Done ) {}
74
78
rpc BatchRaft (stream BatchRaftMessage ) returns (raft_serverpb .Done ) {}
@@ -144,6 +148,8 @@ message BatchCommandsRequest {
144
148
145
149
kvrpcpb.CheckSecondaryLocksRequest CheckSecondaryLocks = 33 ;
146
150
151
+ coprocessor_v2.RawCoprocessorRequest CoprocessorV2 = 34 ;
152
+
147
153
// For some test cases.
148
154
BatchCommandsEmptyRequest Empty = 255 ;
149
155
}
@@ -197,6 +203,8 @@ message BatchCommandsResponse {
197
203
198
204
kvrpcpb.CheckSecondaryLocksResponse CheckSecondaryLocks = 33 ;
199
205
206
+ coprocessor_v2.RawCoprocessorResponse CoprocessorV2 = 34 ;
207
+
200
208
// For some test cases.
201
209
BatchCommandsEmptyResponse Empty = 255 ;
202
210
}
You can’t perform that action at this time.
0 commit comments