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: 92994a58d13cc5368e5cda5355df7960134763ef (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
syntax = "proto3";

package gitaly;

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

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

service PraefectInfoService {
  option (intercepted) = true;

  rpc RepositoryReplicas(RepositoryReplicasRequest) returns (RepositoryReplicasResponse);
  // 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);

  // DatalossCheck checks for outdated repository replicas.
  rpc DatalossCheck(DatalossCheckRequest) returns (DatalossCheckResponse);

  // SetAuthoritativeStorage sets the authoritative storage for a repository on a given virtual storage.
  // This causes the current version of the repository on the authoritative storage to be considered the
  // latest and overwrite any other version on the virtual storage.
  rpc SetAuthoritativeStorage(SetAuthoritativeStorageRequest) returns (SetAuthoritativeStorageResponse);
}

message SetAuthoritativeStorageRequest {
  string virtual_storage = 1;
  string relative_path = 2;
  string authoritative_storage = 3;
}

message SetAuthoritativeStorageResponse {}

message DatalossCheckRequest {
  string virtual_storage = 1;
  // include_partially_replicated decides whether to include repositories which are fully up to date
  // on the primary but are outdated on some secondaries. Such repositories are still writable and do
  // not suffer from data loss. The data on the primary is not fully replicated which increases the
  // chances of data loss following a failover.
  bool include_partially_replicated = 2;
}

message DatalossCheckResponse {
  message Repository {
    message Storage {
      // name of the storage
      string name = 1;
      // behind_by indicates how many generations this storage is behind.
      int64 behind_by = 2;
    }

    // relative path of the repository with outdated replicas
    string relative_path = 1;
    // storages on which the repository is outdated
    repeated Storage storages = 2;
    // read_only indicates whether the repository is in read-only mode.
    bool read_only = 3;
  }

  // current primary storage
  string primary = 1;

  // repositories with data loss
  repeated Repository repositories = 2;
}

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;
  // 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;
}