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

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

package gitaly;

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

import "lint.proto";
import "shared.proto";
import "google/protobuf/timestamp.proto";

service PraefectInfoService {
  rpc RepositoryReplicas(RepositoryReplicasRequest) returns (RepositoryReplicasResponse) {
    option (op_type) = {
      op: ACCESSOR
      scope_level: SERVER
    };
  }
  // ConsistencyCheck will perform a consistency check on the requested
  // virtual storage backend. A stream of repository statuses will be sent
  // back indicating which repos are consistent with the primary and which ones
  // need repair.
  rpc ConsistencyCheck(ConsistencyCheckRequest) returns (stream ConsistencyCheckResponse) {
    option (op_type) = {
      op: ACCESSOR
      scope_level: STORAGE
    };
  }

  // DatalossCheck checks for nodes which are not up to date with the previous writable primary.
  // This indicates possible data loss after a failover event.
  rpc DatalossCheck(DatalossCheckRequest) returns (DatalossCheckResponse) {
    option (op_type) = {
      op: ACCESSOR
      scope_level: SERVER
    };
  }

  // EnableWrites enables writes for a storage that was switched to a read-only mode
  // following a failover.
  rpc EnableWrites(EnableWritesRequest) returns (EnableWritesResponse) {
    option (op_type) = {
      op: MUTATOR
      scope_level: STORAGE
    };
  }
}

message EnableWritesRequest {
  // virtual_storage is the name of the virtual storage to enable writes for.
  string virtual_storage = 1 [(storage)=true];
}

message EnableWritesResponse {}

message DatalossCheckRequest {
  string virtual_storage = 1 [(storage)=true];
}

message DatalossCheckResponse {
  message Nodes {
    // relative path of the repository with outdated nodes
    string relative_path = 1;
    // nodes whose copy of the repository is not up to date
    repeated string nodes = 2;
  }

  string virtual_storage = 1;
  string previous_writable_primary = 2;
  string current_primary = 3;
  // whether the virtual storage is currently in read-only mode
  bool is_read_only = 4;
  repeated Nodes outdated_nodes = 5;
}

message RepositoryReplicasRequest{
  Repository repository = 1;
}

message RepositoryReplicasResponse{
  message RepositoryDetails {
    Repository repository = 1;
    string checksum = 2;
  };

  RepositoryDetails primary = 1;
  repeated RepositoryDetails replicas = 2;
}

message ConsistencyCheckRequest {
  string virtual_storage = 1 [(storage)=true];
  // The target storage is the storage you wish to check for inconsistencies
  // against a reference storage (typically the current primary).
  string target_storage = 2;
  // Optionally provide a reference storage to compare the target storage
  // against. If a reference storage is omitted, the current primary will be
  // used.
  string reference_storage = 3;
  // Be default, reconcilliation is enabled. Disabling reconcilliation will
  // make the request side-effect free.
  bool disable_reconcilliation = 4;
}

message ConsistencyCheckResponse {
  string repo_relative_path = 1;
  string target_checksum = 2;
  string reference_checksum = 3;
  // If resync was enabled, then each inconsistency will schedule a replication
  // job. A replication ID is returned to track the corresponding job.
  uint64 repl_job_id = 4;
  // If the reference storage was not specified, reply with the reference used
  string reference_storage = 5;
}