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

transaction.proto « proto - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3d3e48de581a7ca15c133c48f31ce45b5af8e37c (plain)
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
syntax = "proto3";

package gitaly;

option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb";

import "lint.proto";
import "shared.proto";

service RefTransaction {

  rpc VoteTransaction (VoteTransactionRequest) returns (VoteTransactionResponse) {
    option (op_type) = {
      op:          MUTATOR
      scope_level: REPOSITORY
    };
  }

  rpc StopTransaction (StopTransactionRequest) returns (StopTransactionResponse) {
    option (op_type) = {
      op:          MUTATOR
      scope_level: REPOSITORY
    };
  }

}

message VoteTransactionRequest {
  enum Phase {
    // UNKNOWN_PHASE is the unknown voting phase. This value has been the
    // default because phases have been introduced. Eventually, using this
    // phase will become unsupported.
    UNKNOWN_PHASE = 0;
    // PREPARED_PHASE is the prepratory phase. The data that is about to change
    // is locked for concurrent modification, but changes have not yet been
    // written to disk.
    PREPARED_PHASE = 1;
    // COMMITTED_PHASE is the committing phase. Data has been committed to disk
    // and will be visible in all subsequent requests.
    COMMITTED_PHASE  = 2;
  };

  Repository repository = 1[(target_repository)=true];
  // ID of the transaction we're processing
  uint64 transaction_id = 2;
  // Name of the Gitaly node that's voting on a transaction.
  string node = 3;
  // SHA1 of the references that are to be updated
  bytes reference_updates_hash = 4;
  // Phase is the voting phase.
  Phase phase = 5;
}

message VoteTransactionResponse {
  // The outcome of the given transaction telling the client whether the
  // transaction should be committed or rolled back.
  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 {}