diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-09-23 15:17:49 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2020-10-12 12:02:54 +0300 |
commit | 810e6a261dde1e19e945042d6679e4b3a3d3cfc2 (patch) | |
tree | 55682c2a7df29c94352ae6a987c7cfc1a29c22ec /proto/transaction.proto | |
parent | 0d2ea9ff5c3651dd152a258ecae5d9238457cc6a (diff) |
transactions: Expose RPC to gracefully stop transactions
This commit adds the ability to stop transactions via the RefTransaction
service. In contrast to state cancellation, this is considered to be a
graceful stop of transactions: nodes which cast votes on stopped
transactions are not supposed to treat it as an error if the transaction
has been stopped, but should instead just terminate it and stop
proceeding. To tell apart "real" errors from a stopped transaction, this
commit thus adds a new "STOP" state which tells the client to stop
processing it.
Diffstat (limited to 'proto/transaction.proto')
-rw-r--r-- | proto/transaction.proto | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/proto/transaction.proto b/proto/transaction.proto index 1e7f1f5d7..fb11879c4 100644 --- a/proto/transaction.proto +++ b/proto/transaction.proto @@ -16,6 +16,13 @@ service RefTransaction { }; } + rpc StopTransaction (StopTransactionRequest) returns (StopTransactionResponse) { + option (op_type) = { + op: MUTATOR + scope_level: REPOSITORY + }; + } + } message VoteTransactionRequest { @@ -34,7 +41,16 @@ message VoteTransactionResponse { enum TransactionState { COMMIT = 0; ABORT = 1; + STOP = 2; } TransactionState state = 1; } + +message StopTransactionRequest { + Repository repository = 1[(target_repository)=true]; + // ID of the transaction we're processing + uint64 transaction_id = 2; +} + +message StopTransactionResponse {} |