diff options
author | Paul Okstad <pokstad@gitlab.com> | 2020-05-12 08:24:48 +0300 |
---|---|---|
committer | Paul Okstad <pokstad@gitlab.com> | 2020-05-12 08:24:48 +0300 |
commit | efa4fa13e77fd3e8d605af0f66a9cf16afe7a852 (patch) | |
tree | 76b49cdf6caf9427b17f18aa892e302de30f3c72 | |
parent | 83d108e134c5d64396939376d403d65d8f079682 (diff) | |
parent | b175b992598a475ba3802ccd031255a8d080ba83 (diff) |
Merge branch 'po-praefect-reconcile-progress' into 'master'
Reconciliation should report progress and warn user
Closes #2621
See merge request gitlab-org/gitaly!2084
-rw-r--r-- | .gitlab-ci.yml | 5 | ||||
-rw-r--r-- | changelogs/unreleased/po-praefect-reconcile-progress.yml | 5 | ||||
-rw-r--r-- | cmd/praefect/main.go | 6 | ||||
-rw-r--r-- | cmd/praefect/subcmd_reconcile.go | 71 | ||||
-rw-r--r-- | internal/praefect/consistencycheck_test.go | 33 | ||||
-rw-r--r-- | internal/praefect/service/info/consistencycheck.go | 17 | ||||
-rw-r--r-- | proto/go/gitalypb/praefect.pb.go | 113 | ||||
-rw-r--r-- | proto/praefect.proto | 5 | ||||
-rw-r--r-- | ruby/proto/gitaly/praefect_pb.rb | 2 |
9 files changed, 176 insertions, 81 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b6aaedfc5..08d05b215 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -94,6 +94,11 @@ proto: stage: test script: - make proto no-changes + artifacts: + paths: + - ruby/proto/gitaly/* + - proto/go/gitalypb/* + when: on_failure build:go1.14: <<: *build_definition diff --git a/changelogs/unreleased/po-praefect-reconcile-progress.yml b/changelogs/unreleased/po-praefect-reconcile-progress.yml new file mode 100644 index 000000000..564f5db84 --- /dev/null +++ b/changelogs/unreleased/po-praefect-reconcile-progress.yml @@ -0,0 +1,5 @@ +--- +title: Reconciliation should report progress and warn user +merge_request: 2084 +author: +type: added diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 2526f0749..46a8f16e7 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -39,7 +39,8 @@ // The subcommand "reconcile" performs a consistency check of a backend storage // against the primary or another storage in the same virtual storage group. // -// praefect -config PATH_TO_CONFIG reconcile -virtual <vstorage> -target <t-storage> [-reference <r-storage>] +// praefect -config PATH_TO_CONFIG reconcile -virtual <vstorage> -target +// <t-storage> [-reference <r-storage>] [-f] // // "-virtual" specifies which virtual storage the target and reference // belong to. @@ -54,6 +55,9 @@ // current primary. If the primary is the same as the target, an error will // occur. // +// By default, a dry-run is performed where no replications are scheduled. When +// the flag "-f" is provided, the replications will actually schedule. +// // Dataloss // // The subcommand "dataloss" helps identify dataloss cases during a given diff --git a/cmd/praefect/subcmd_reconcile.go b/cmd/praefect/subcmd_reconcile.go index 42f64d6b4..d9431fe41 100644 --- a/cmd/praefect/subcmd_reconcile.go +++ b/cmd/praefect/subcmd_reconcile.go @@ -13,16 +13,18 @@ import ( ) type nodeReconciler struct { - conf config.Config - virtualStorage string - targetStorage string - referenceStorage string + conf config.Config + virtualStorage string + targetStorage string + referenceStorage string + disableReconciliation bool } type reconcileSubcommand struct { virtual string target string reference string + force bool } func (s *reconcileSubcommand) FlagSet() *flag.FlagSet { @@ -30,15 +32,17 @@ func (s *reconcileSubcommand) FlagSet() *flag.FlagSet { fs.StringVar(&s.virtual, "virtual", "", "virtual storage for target storage") fs.StringVar(&s.target, "target", "", "target storage to reconcile") fs.StringVar(&s.reference, "reference", "", "reference storage to reconcile (optional)") + fs.BoolVar(&s.force, "f", false, "actually schedule replications") return fs } func (s *reconcileSubcommand) Exec(flags *flag.FlagSet, conf config.Config) error { nr := nodeReconciler{ - conf: conf, - virtualStorage: s.virtual, - targetStorage: s.target, - referenceStorage: s.reference, + conf: conf, + virtualStorage: s.virtual, + targetStorage: s.target, + referenceStorage: s.reference, + disableReconciliation: !s.force, } if err := nr.reconcile(); err != nil { @@ -76,16 +80,24 @@ func (nr nodeReconciler) reconcile() error { pCli := gitalypb.NewPraefectInfoServiceClient(cc) + if nr.disableReconciliation { + log.Print("Performing a DRY RUN - no changes will be made until '-f' flag is provided") + } else { + log.Print("Performing a LIVE RUN - any repositories on target that are inconsistent with reference will be overwritten with the version present on reference") + } + request := &gitalypb.ConsistencyCheckRequest{ - VirtualStorage: nr.virtualStorage, - TargetStorage: nr.targetStorage, - ReferenceStorage: nr.referenceStorage, + VirtualStorage: nr.virtualStorage, + TargetStorage: nr.targetStorage, + ReferenceStorage: nr.referenceStorage, + DisableReconcilliation: nr.disableReconciliation, } stream, err := pCli.ConsistencyCheck(context.TODO(), request) if err != nil { return err } + log.Print("Checking consistency...") if err := nr.consumeStream(stream); err != nil { return err } @@ -134,7 +146,10 @@ func (nr nodeReconciler) validateArgs() error { } func (nr nodeReconciler) consumeStream(stream gitalypb.PraefectInfoService_ConsistencyCheckClient) error { - for { + var rStorage string + var i uint + + for ; ; i++ { resp, err := stream.Recv() if err == io.EOF { break @@ -143,13 +158,39 @@ func (nr nodeReconciler) consumeStream(stream gitalypb.PraefectInfoService_Consi return err } - if resp.GetReferenceChecksum() != resp.GetTargetChecksum() { + if resp.ReferenceStorage != rStorage { + rStorage = resp.ReferenceStorage + log.Print("Reference storage being used: " + rStorage) + } + + if resp.GetReferenceChecksum() == resp.GetTargetChecksum() { + log.Print("CONSISTENT: " + resp.GetRepoRelativePath()) + continue + } + + checksumPrint := func(checksum string) string { + if checksum == "" { + return "null" + } + return checksum + } + + log.Printf( + "INCONSISTENT: Repo %s has checksum %s on target but checksum %s on reference storage %s", + resp.GetRepoRelativePath(), + checksumPrint(resp.GetTargetChecksum()), + checksumPrint(resp.GetReferenceChecksum()), + resp.GetReferenceStorage(), + ) + if resp.GetReplJobId() != 0 { log.Printf( - "INCONSISTENT: %s - replication scheduled: #%d", - resp.GetRepoRelativePath(), + "SCHEDULED: Replication job %d will update repo %s", resp.GetReplJobId(), + resp.GetRepoRelativePath(), ) } } + + log.Printf("FINISHED: %d repos were checked for consistency", i) return nil } diff --git a/internal/praefect/consistencycheck_test.go b/internal/praefect/consistencycheck_test.go index dce2bb473..69c923603 100644 --- a/internal/praefect/consistencycheck_test.go +++ b/internal/praefect/consistencycheck_test.go @@ -77,11 +77,14 @@ func TestConsistencyCheck(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - reposAreConsistent := func() (consistent bool) { + disableReconcilliation := true + + requestConsistencyCheck := func() *gitalypb.ConsistencyCheckResponse { stream, err := praefectCli.ConsistencyCheck(ctx, &gitalypb.ConsistencyCheckRequest{ - VirtualStorage: virtualStorage.Name, - ReferenceStorage: primary.Storage, - TargetStorage: secondary.Storage, + VirtualStorage: virtualStorage.Name, + ReferenceStorage: primary.Storage, + TargetStorage: secondary.Storage, + DisableReconcilliation: disableReconcilliation, }) require.NoError(t, err) @@ -89,24 +92,28 @@ func TestConsistencyCheck(t *testing.T) { require.Len(t, responses, 1) resp := responses[0] - require.Equal(t, repo0.RelativePath, resp.RepoRelativePath) - consistent = resp.TargetChecksum == resp.ReferenceChecksum - if !consistent { - require.NotZero(t, resp.ReplJobId, - "A replication job should be scheduled when inconsistent") - } + require.Equal(t, repo0.RelativePath, resp.RepoRelativePath) + require.Equal(t, primary.Storage, resp.ReferenceStorage) - return consistent + return resp } - require.True(t, reposAreConsistent(), + resp := requestConsistencyCheck() + require.Equal(t, resp.ReferenceChecksum, resp.TargetChecksum, "both repos expected to be consistent after initial clone") + require.Zero(t, resp.ReplJobId) testhelper.MustRunCommand(t, nil, "git", "-C", targetRepoPath, "update-ref", "HEAD", "spooky-stuff") - require.False(t, reposAreConsistent(), + resp = requestConsistencyCheck() + require.NotEqual(t, resp.ReferenceChecksum, resp.TargetChecksum, "repos should no longer be consistent after target HEAD changed") + require.Zero(t, resp.ReplJobId) + + disableReconcilliation = false + resp = requestConsistencyCheck() + require.NotZero(t, resp.ReplJobId) } func consumeConsistencyCheckResponses(t *testing.T, stream gitalypb.PraefectInfoService_ConsistencyCheckClient) []*gitalypb.ConsistencyCheckResponse { diff --git a/internal/praefect/service/info/consistencycheck.go b/internal/praefect/service/info/consistencycheck.go index 7c071be92..22e5ab264 100644 --- a/internal/praefect/service/info/consistencycheck.go +++ b/internal/praefect/service/info/consistencycheck.go @@ -190,22 +190,27 @@ func scheduleReplication(ctx context.Context, csr checksumResult, q Queue, resp return nil } -func ensureConsistency(ctx context.Context, checksumResultQ <-chan checksumResult, q Queue, stream gitalypb.PraefectInfoService_ConsistencyCheckServer) error { - for csr := range checksumResultQ { +func ensureConsistency(ctx context.Context, disableReconcile bool, checksumResultQ <-chan checksumResult, q Queue, stream gitalypb.PraefectInfoService_ConsistencyCheckServer) error { + for { + var csr checksumResult select { + case res, ok := <-checksumResultQ: + if !ok { + return nil + } + csr = res case <-ctx.Done(): return ctx.Err() - default: - // continue } resp := &gitalypb.ConsistencyCheckResponse{ RepoRelativePath: csr.relativePath, ReferenceChecksum: csr.reference, TargetChecksum: csr.target, + ReferenceStorage: csr.referenceStorage, } - if csr.reference != csr.target { + if csr.reference != csr.target && !disableReconcile { if err := scheduleReplication(ctx, csr, q, resp); err != nil { return err } @@ -244,7 +249,7 @@ func (s *Server) ConsistencyCheck(req *gitalypb.ConsistencyCheckRequest, stream return checksumRepos(ctx, walkerQ, checksumResultQ, target, reference, req.GetVirtualStorage()) }) g.Go(func() error { - return ensureConsistency(ctx, checksumResultQ, s.queue, stream) + return ensureConsistency(ctx, req.GetDisableReconcilliation(), checksumResultQ, s.queue, stream) }) return g.Wait() diff --git a/proto/go/gitalypb/praefect.pb.go b/proto/go/gitalypb/praefect.pb.go index 72716df6c..5f92fae9d 100644 --- a/proto/go/gitalypb/praefect.pb.go +++ b/proto/go/gitalypb/praefect.pb.go @@ -264,10 +264,13 @@ type ConsistencyCheckRequest struct { // Optionally provide a reference storage to compare the target storage // against. If a reference storage is omitted, the current primary will be // used. - ReferenceStorage string `protobuf:"bytes,3,opt,name=reference_storage,json=referenceStorage,proto3" json:"reference_storage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ReferenceStorage string `protobuf:"bytes,3,opt,name=reference_storage,json=referenceStorage,proto3" json:"reference_storage,omitempty"` + // Be default, reconcilliation is enabled. Disabling reconcilliation will + // make the request side-effect free. + DisableReconcilliation bool `protobuf:"varint,4,opt,name=disable_reconcilliation,json=disableReconcilliation,proto3" json:"disable_reconcilliation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ConsistencyCheckRequest) Reset() { *m = ConsistencyCheckRequest{} } @@ -316,13 +319,22 @@ func (m *ConsistencyCheckRequest) GetReferenceStorage() string { return "" } +func (m *ConsistencyCheckRequest) GetDisableReconcilliation() bool { + if m != nil { + return m.DisableReconcilliation + } + return false +} + type ConsistencyCheckResponse struct { RepoRelativePath string `protobuf:"bytes,1,opt,name=repo_relative_path,json=repoRelativePath,proto3" json:"repo_relative_path,omitempty"` TargetChecksum string `protobuf:"bytes,2,opt,name=target_checksum,json=targetChecksum,proto3" json:"target_checksum,omitempty"` ReferenceChecksum string `protobuf:"bytes,3,opt,name=reference_checksum,json=referenceChecksum,proto3" json:"reference_checksum,omitempty"` // If resync was enabled, then each inconsistency will schedule a replication // job. A replication ID is returned to track the corresponding job. - ReplJobId uint64 `protobuf:"varint,4,opt,name=repl_job_id,json=replJobId,proto3" json:"repl_job_id,omitempty"` + ReplJobId uint64 `protobuf:"varint,4,opt,name=repl_job_id,json=replJobId,proto3" json:"repl_job_id,omitempty"` + // If the reference storage was not specified, reply with the reference used + ReferenceStorage string `protobuf:"bytes,5,opt,name=reference_storage,json=referenceStorage,proto3" json:"reference_storage,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -381,6 +393,13 @@ func (m *ConsistencyCheckResponse) GetReplJobId() uint64 { return 0 } +func (m *ConsistencyCheckResponse) GetReferenceStorage() string { + if m != nil { + return m.ReferenceStorage + } + return "" +} + func init() { proto.RegisterType((*DatalossCheckRequest)(nil), "gitaly.DatalossCheckRequest") proto.RegisterType((*DatalossCheckResponse)(nil), "gitaly.DatalossCheckResponse") @@ -395,47 +414,49 @@ func init() { func init() { proto.RegisterFile("praefect.proto", fileDescriptor_d32bf44842ead735) } var fileDescriptor_d32bf44842ead735 = []byte{ - // 626 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x95, 0x9d, 0x50, 0xd2, 0x29, 0x4d, 0xd3, 0x6d, 0x11, 0xc1, 0x02, 0x1a, 0x2c, 0x21, 0x22, - 0x68, 0x9d, 0x12, 0x38, 0x20, 0x6e, 0xb4, 0xe5, 0x50, 0x0e, 0x50, 0xb9, 0x88, 0x03, 0x1c, 0xa2, - 0xb5, 0x3b, 0x71, 0x4c, 0x6d, 0xaf, 0xd9, 0xdd, 0x44, 0xf2, 0x1f, 0xf0, 0x07, 0x5c, 0xb8, 0xf1, - 0x11, 0xbd, 0x72, 0xe2, 0xa3, 0x38, 0x21, 0x7b, 0xd7, 0x6e, 0x9a, 0xa4, 0xad, 0xd4, 0xdb, 0xce, - 0xcc, 0x9b, 0xb7, 0x33, 0x6f, 0x46, 0x03, 0xcd, 0x94, 0x53, 0x1c, 0xa2, 0x2f, 0x9d, 0x94, 0x33, - 0xc9, 0xc8, 0x52, 0x10, 0x4a, 0x1a, 0x65, 0x16, 0x44, 0x61, 0xa2, 0x7d, 0xd6, 0x1d, 0x31, 0xa2, - 0x1c, 0x4f, 0xb4, 0xb5, 0x15, 0x30, 0x16, 0x44, 0xd8, 0x2b, 0x2c, 0x6f, 0x3c, 0xec, 0xc9, 0x30, - 0x46, 0x21, 0x69, 0x9c, 0x2a, 0x80, 0xcd, 0x61, 0xf3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33, - 0x49, 0x53, 0xa1, 0x03, 0x94, 0x34, 0x8c, 0x84, 0x5b, 0x92, 0x90, 0x23, 0x68, 0x70, 0x0d, 0x6f, - 0x9b, 0x85, 0xae, 0x37, 0x23, 0xac, 0x58, 0x2c, 0x1f, 0xd6, 0xe7, 0xc2, 0x37, 0x51, 0x82, 0x58, - 0xd0, 0xf0, 0xf3, 0x91, 0x8a, 0x71, 0x5c, 0xe8, 0xbe, 0xec, 0x56, 0xb6, 0xfd, 0xcb, 0x80, 0x7b, - 0xfb, 0x2c, 0x11, 0xa1, 0x90, 0x98, 0xf8, 0xd9, 0x85, 0x45, 0xdd, 0x81, 0xb5, 0x49, 0xc8, 0xe5, - 0x98, 0x46, 0x03, 0x21, 0x19, 0xa7, 0x01, 0xaa, 0x51, 0xee, 0xd5, 0x7f, 0xfc, 0xdd, 0x36, 0xdc, - 0xa6, 0x0e, 0x1e, 0xab, 0x18, 0x79, 0x02, 0x4d, 0x49, 0x79, 0x80, 0xb2, 0x42, 0xab, 0xcf, 0x56, - 0x95, 0xb7, 0x84, 0x3d, 0x87, 0x75, 0x8e, 0x43, 0xe4, 0x98, 0xf8, 0x58, 0x21, 0x6b, 0x05, 0xb2, - 0x55, 0x05, 0x34, 0xd8, 0xfe, 0x63, 0x40, 0x7b, 0xbe, 0x3c, 0x3d, 0xc2, 0x6d, 0x20, 0x79, 0x97, - 0x73, 0x4b, 0xad, 0xa9, 0x52, 0x36, 0xbd, 0x91, 0xe4, 0x29, 0xac, 0xe9, 0xf2, 0x66, 0xc4, 0xd0, - 0x55, 0xef, 0x6b, 0x2f, 0xd9, 0xc9, 0x69, 0xcb, 0x02, 0x2b, 0xac, 0xaa, 0xf0, 0xbc, 0xf4, 0x0a, - 0xfe, 0x08, 0x56, 0xf2, 0x91, 0x0d, 0xbe, 0x31, 0x6f, 0x10, 0x9e, 0xb4, 0xeb, 0x1d, 0xa3, 0x5b, - 0x77, 0x97, 0x73, 0xd7, 0x7b, 0xe6, 0x1d, 0x9e, 0xf4, 0xcf, 0x4c, 0xd8, 0x38, 0xd2, 0xc7, 0xe5, - 0x30, 0x19, 0xb2, 0x63, 0xe4, 0x93, 0xd0, 0x47, 0x82, 0x40, 0xe6, 0x17, 0x83, 0x3c, 0xbe, 0x6a, - 0x69, 0x8a, 0xb1, 0x58, 0xf6, 0xf5, 0x7b, 0x65, 0x37, 0xfe, 0xfd, 0xec, 0xd6, 0x1b, 0x66, 0xcb, - 0x20, 0x14, 0x5a, 0xb3, 0x02, 0x92, 0xad, 0x92, 0xe1, 0x92, 0xc9, 0x5b, 0x9d, 0xcb, 0x01, 0x33, - 0x1f, 0x98, 0xbb, 0x06, 0xf9, 0x0c, 0xab, 0x17, 0x4e, 0x07, 0x79, 0x70, 0xc9, 0x45, 0x51, 0xe4, - 0x0f, 0xaf, 0xbc, 0x37, 0xe7, 0xa5, 0xef, 0xed, 0x7e, 0xc9, 0x91, 0x11, 0xf5, 0x1c, 0x9f, 0xc5, - 0x3d, 0xf5, 0xdc, 0x61, 0x3c, 0xe8, 0xa9, 0x7c, 0x75, 0x79, 0x7b, 0x01, 0xd3, 0x76, 0xea, 0x79, - 0x4b, 0x85, 0xeb, 0xe5, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xcc, 0xd2, 0x56, 0xce, 0x05, - 0x00, 0x00, + // 663 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x5d, 0x6e, 0xd3, 0x40, + 0x10, 0x96, 0x9d, 0xb4, 0xa4, 0x53, 0x9a, 0xa6, 0xdb, 0x42, 0x83, 0x05, 0x34, 0x58, 0x42, 0x44, + 0xd0, 0x3a, 0x25, 0x20, 0x81, 0x78, 0xa3, 0x2d, 0x0f, 0xe5, 0x01, 0xaa, 0x2d, 0xe2, 0x01, 0x1e, + 0xa2, 0xb5, 0x33, 0x49, 0x96, 0x3a, 0x5e, 0xb3, 0xb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x0c, 0xf6, 0x0c, 0x36, 0x24, 0x76, 0x50, 0x62, 0x14, 0x60, 0x8e, + 0x2c, 0x24, 0xc8, 0x4a, 0x9e, 0xc8, 0xc0, 0xaf, 0x60, 0xbb, 0xcd, 0x15, 0xf3, 0x43, 0x6c, 0x49, + 0x0c, 0x44, 0x14, 0xf0, 0x30, 0xe4, 0x4c, 0x73, 0x11, 0x55, 0x8b, 0x35, 0xab, 0x5e, 0xa2, 0x77, + 0x4d, 0x9a, 0x4e, 0x67, 0xdd, 0xbf, 0x16, 0x54, 0xe7, 0x75, 0x99, 0xde, 0xef, 0x02, 0x19, 0xdb, + 0x33, 0xf7, 0x37, 0x98, 0x37, 0xc4, 0x62, 0x72, 0x94, 0xc9, 0x13, 0x58, 0x37, 0xba, 0x66, 0x5c, + 0x34, 0x72, 0x0f, 0x4d, 0x94, 0xec, 0x8d, 0x69, 0x33, 0x65, 0x39, 0x36, 0x95, 0x76, 0xa1, 0x39, + 0x87, 0x3f, 0x84, 0xd5, 0x71, 0xaf, 0x5b, 0xdf, 0x84, 0xdf, 0xe2, 0xed, 0x44, 0x4f, 0x91, 0xae, + 0x8c, 0x43, 0xef, 0x85, 0x7f, 0xdc, 0x5e, 0x6c, 0xd4, 0xd2, 0x62, 0xa3, 0x9a, 0xe7, 0x36, 0x6c, + 0x9e, 0x98, 0x15, 0x76, 0x1c, 0x75, 0xc4, 0x29, 0xca, 0x21, 0x0f, 0x90, 0x20, 0x90, 0xf9, 0xf1, + 0x23, 0x8f, 0xae, 0x1a, 0xcd, 0xa4, 0xf9, 0x8e, 0x7b, 0xfd, 0xf4, 0xba, 0xa5, 0x7f, 0x3f, 0xeb, + 0xc5, 0x92, 0x5d, 0xb1, 0x08, 0x83, 0xca, 0xac, 0xdb, 0x64, 0x27, 0x63, 0xb8, 0x64, 0xbe, 0x9c, + 0xda, 0xe5, 0x80, 0x99, 0x0b, 0xec, 0x7d, 0x8b, 0x7c, 0x86, 0xb5, 0xa9, 0x05, 0x45, 0xee, 0x5f, + 0xb2, 0xb7, 0x52, 0xf2, 0x07, 0x57, 0x6e, 0xb5, 0x8b, 0xa7, 0x1f, 0xec, 0x7f, 0x19, 0x23, 0x43, + 0xe6, 0x7b, 0x81, 0xe8, 0x37, 0xd2, 0xcf, 0x3d, 0x21, 0xbb, 0x8d, 0xb4, 0x3e, 0xdd, 0xef, 0x8d, + 0xae, 0x30, 0xe7, 0xd8, 0xf7, 0x97, 0x93, 0xd0, 0x8b, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x02, + 0x47, 0xfa, 0x18, 0x34, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/praefect.proto b/proto/praefect.proto index 3b5b3225f..df4677ada 100644 --- a/proto/praefect.proto +++ b/proto/praefect.proto @@ -77,6 +77,9 @@ message ConsistencyCheckRequest { // 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 { @@ -86,4 +89,6 @@ message ConsistencyCheckResponse { // 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; } diff --git a/ruby/proto/gitaly/praefect_pb.rb b/ruby/proto/gitaly/praefect_pb.rb index f5c5a7d30..5e418cc97 100644 --- a/ruby/proto/gitaly/praefect_pb.rb +++ b/ruby/proto/gitaly/praefect_pb.rb @@ -29,12 +29,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :virtual_storage, :string, 1 optional :target_storage, :string, 2 optional :reference_storage, :string, 3 + optional :disable_reconcilliation, :bool, 4 end add_message "gitaly.ConsistencyCheckResponse" do optional :repo_relative_path, :string, 1 optional :target_checksum, :string, 2 optional :reference_checksum, :string, 3 optional :repl_job_id, :uint64, 4 + optional :reference_storage, :string, 5 end end |