Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-04-27 13:53:21 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-04-29 13:21:58 +0300
commitf706895a94fa2c73269db81643669c2cc2223314 (patch)
tree0a688a1e0d33dd33b0994ac8c00aaafe5890926a /proto/transaction.proto
parentac269372135e5a6830b5ab5682eb371e6623f588 (diff)
praefect: Extract transaction manager
In order to implement transactions, a new reference transaction service was created that provides multiple RPCs to register, start and cancel transactions. While it makes sense to expose the start RPC, it doesn't really for the other two as they will only ever be used by Praefect, which is also responsible for hosting the service. Furthermore, it's hard to actually register and cancel transactions in Praefect if these are exposed as services, only, as using them would require us to connect to ourselves. Revise the design of the transaction service by splitting it up into two parts: 1. The transaction service, which now only exposes the "start" RPC to Gitaly nodes. The transaction handling logic has been split out of the service, bringing us to the second part. 2. The transaction manager. Similar to how e.g. the node manager works, this is where the actual business logic will take place. The transaction service gets a manager injected and will call out to it to serve the "start" RPC. The other two calls which were previously exposed via RPC will now be called directly on this manager by Praefect. With this design, it becomes a lot easier to handle sessions on Praefect's side.
Diffstat (limited to 'proto/transaction.proto')
-rw-r--r--proto/transaction.proto32
1 files changed, 0 insertions, 32 deletions
diff --git a/proto/transaction.proto b/proto/transaction.proto
index 645833b2d..fc43e0e04 100644
--- a/proto/transaction.proto
+++ b/proto/transaction.proto
@@ -9,13 +9,6 @@ import "shared.proto";
service RefTransaction {
- rpc RegisterTransaction (RegisterTransactionRequest) returns (RegisterTransactionResponse) {
- option (op_type) = {
- op: MUTATOR
- scope_level: REPOSITORY
- };
- }
-
rpc StartTransaction (StartTransactionRequest) returns (StartTransactionResponse) {
option (op_type) = {
op: MUTATOR
@@ -23,23 +16,6 @@ service RefTransaction {
};
}
- rpc CancelTransaction (CancelTransactionRequest) returns (CancelTransactionResponse) {
- option (op_type) = {
- op: MUTATOR
- scope_level: REPOSITORY
- };
- }
-
-}
-
-message RegisterTransactionRequest {
- Repository repository = 1[(target_repository)=true];
- // Nodes taking part in the transaction
- repeated string nodes = 2;
-}
-
-message RegisterTransactionResponse {
- uint64 transaction_id = 1;
}
message StartTransactionRequest {
@@ -62,11 +38,3 @@ message StartTransactionResponse {
TransactionState state = 1;
}
-
-message CancelTransactionRequest {
- Repository repository = 1[(target_repository)=true];
- // ID of the transaction we're about to cancel
- uint64 transaction_id = 2;
-}
-
-message CancelTransactionResponse {}