From d55f52ec4cffef7649f14152f5b0bf19d5cbac82 Mon Sep 17 00:00:00 2001 From: Quang-Minh Nguyen Date: Wed, 15 Jan 2025 15:40:10 +0700 Subject: [PATCH 1/3] proto: Add raftpb to `make proto` pipeline Previously, Gitaly included some Raft-related protobufs. The upstream library compiles these protobufs using proto2. This results in generated code that is completely different from the code compiled with proto3 in Gitaly. Consequently, some protobufs were copied from the upstream etcd/raft repository. Gitaly transpiles back and forth when interacting with the etcd/raft library. Over time, more definitions were copied. We began wrapping etcd/raft's internal representations by embedding them as byte slices in Gitaly's Raft protobuf instead of declaring them as fields of the wrapper. This approach has several drawbacks in terms of both performance and architecture. To address this, we decided to introduce etcd's raftpb as a dependency of gitalypb. This commit updates the `make proto` pipeline. Before compiling Gitaly's protobufs, raftpb (and its sub-dependencies) are downloaded. They are properly declared with package names in the protoc command. --- Makefile | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a55274bebe7..d3c32ae11df 100644 --- a/Makefile +++ b/Makefile @@ -107,6 +107,13 @@ ifeq ($(origin PROTOC_BUILD_OPTIONS),undefined) PROTOC_BUILD_OPTIONS += -DCMAKE_CXX_STANDARD=14 endif +# This target is a part of the pipeline because some of Gitaly's protobufs consist of etcd's raftpb. +RAFTPB_REPO_URL ?= https://github.com/etcd-io/raft +RAFTPB_SOURCE_DIR ?= ${DEPENDENCY_DIR}/raft +# gogoproto is a dependency of raftpb. +GOGOPROTO_REPO_URL ?= https://github.com/gogo/protobuf +GOGOPROTO_SOURCE_DIR ?= ${DEPENDENCY_DIR}/gogo-protobuf + # Git target GIT_REPO_URL ?= https://gitlab.com/gitlab-org/git.git GIT_QUIET := @@ -478,17 +485,31 @@ clean: .PHONY: proto ## Regenerate protobuf definitions. -proto: SHARED_PROTOC_OPTS = --plugin=${PROTOC_GEN_GO} --plugin=${PROTOC_GEN_GO_GRPC} --plugin=${PROTOC_GEN_GITALY_PROTOLIST} --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative -proto: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GO_GRPC} ${PROTOC_GEN_GITALY_PROTOLIST} +proto: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GO_GRPC} ${PROTOC_GEN_GITALY_PROTOLIST} ${DEPENDENCY_DIR}/raftpb ${Q}rm -rf ${PROTO_DEST_DIR} && mkdir -p ${PROTO_DEST_DIR}/gitalypb - ${Q}${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${PROTOC_INSTALL_DIR}/include --go_out=${PROTO_DEST_DIR}/gitalypb --gitaly-protolist_out=proto_dir=${SOURCE_DIR}/proto,gitalypb_dir=${PROTO_DEST_DIR}/gitalypb:${SOURCE_DIR} --go-grpc_out=${PROTO_DEST_DIR}/gitalypb ${SOURCE_DIR}/proto/*.proto ${SOURCE_DIR}/proto/testproto/*.proto + ${Q}${PROTOC} \ + --plugin=${PROTOC_GEN_GO} \ + --plugin=${PROTOC_GEN_GO_GRPC} \ + --plugin=${PROTOC_GEN_GITALY_PROTOLIST} \ + --go_opt=paths=source_relative \ + --go_opt=Mraftpb/raft.proto=go.etcd.io/etcd/raft/v3/raftpb \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=Mraftpb/raft.proto=go.etcd.io/etcd/raft/v3/raftpb \ + --go_out=${PROTO_DEST_DIR}/gitalypb \ + --gitaly-protolist_out=proto_dir=${SOURCE_DIR}/proto,gitalypb_dir=${PROTO_DEST_DIR}/gitalypb:${SOURCE_DIR} \ + --go-grpc_out=${PROTO_DEST_DIR}/gitalypb \ + -I ${SOURCE_DIR}/proto \ + -I ${PROTOC_INSTALL_DIR}/include \ + -I ${RAFTPB_SOURCE_DIR} \ + -I ${GOGOPROTO_SOURCE_DIR} \ + ${SOURCE_DIR}/proto/*.proto \ + ${SOURCE_DIR}/proto/testproto/*.proto .PHONY: check-proto check-proto: no-proto-changes lint-proto .PHONY: lint-proto -lint-proto: ${PROTOC} ${PROTOLINT} ${PROTOC_GEN_GITALY_LINT} - ${Q}${PROTOC} -I ${SOURCE_DIR}/proto -I ${PROTOC_INSTALL_DIR}/include --plugin=${PROTOC_GEN_GITALY_LINT} --gitaly-lint_out=${SOURCE_DIR} ${SOURCE_DIR}/proto/*.proto +lint-proto: ${PROTOC} ${PROTOLINT} ${PROTOC_GEN_GITALY_LINT} proto ${Q}${PROTOLINT} lint -config_dir_path=${SOURCE_DIR}/proto ${SOURCE_DIR}/proto/*.proto .PHONY: build-proto-gem @@ -648,6 +669,20 @@ ${PROTOC_GEN_GITALY_LINT}: proto | ${TOOLS_DIR} ${PROTOC_GEN_GITALY_PROTOLIST}: | ${TOOLS_DIR} ${Q}go build -o $@ ${SOURCE_DIR}/tools/protoc-gen-gitaly-protolist +${DEPENDENCY_DIR}/gogoproto: + ${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${GOGOPROTO_SOURCE_DIR}" + ${Q}${GIT} -C "${GOGOPROTO_SOURCE_DIR}" config remote.origin.url ${GOGOPROTO_REPO_URL} + ${Q}${GIT} -C "${GOGOPROTO_SOURCE_DIR}" config remote.origin.tagOpt --no-tags + ${Q}${GIT} -C "${GOGOPROTO_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin master + ${Q}${GIT} -C "${GOGOPROTO_SOURCE_DIR}" checkout ${GIT_QUIET} --detach FETCH_HEAD + +${DEPENDENCY_DIR}/raftpb: ${DEPENDENCY_DIR}/gogoproto + ${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${RAFTPB_SOURCE_DIR}" + ${Q}${GIT} -C "${RAFTPB_SOURCE_DIR}" config remote.origin.url ${RAFTPB_REPO_URL} + ${Q}${GIT} -C "${RAFTPB_SOURCE_DIR}" config remote.origin.tagOpt --no-tags + ${Q}${GIT} -C "${RAFTPB_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin main + ${Q}${GIT} -C "${RAFTPB_SOURCE_DIR}" checkout ${GIT_QUIET} --detach FETCH_HEAD + ${GIT_FILTER_REPO}: ${DEPENDENCY_DIR}/git-filter-repo.version | ${BUILD_DIR}/bin ${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} "${GIT_FILTER_REPO_SOURCE_DIR}" ${Q}${GIT} -C "${GIT_FILTER_REPO_SOURCE_DIR}" config remote.origin.url ${GIT_FILTER_REPO_REPO_URL} -- GitLab From da3c4e7032738c72478b4fc421487235161b04bb Mon Sep 17 00:00:00 2001 From: Quang-Minh Nguyen Date: Wed, 15 Jan 2025 16:25:28 +0700 Subject: [PATCH 2/3] raft: Revise Raft-related protobufs This commit revises Raft-related protobufs stored in cluster.proto: - Remove RaftMessageType, RaftConfStateV1, and RaftHardStateV1 . We can now use the upstream raftpb. - Merge ReferencedLogData and PackedLogData into one single LogData. - Rename RaftMessageV1 to InternalRaftRequest. - Create RaftService and corresponding request/response object. - Move cluster_id, authority_name, and partition_id to RaftService. --- internal/gitaly/storage/raftmgr/transport.go | 16 +- .../gitaly/storage/raftmgr/transport_test.go | 85 +-- proto/cluster.proto | 143 ++--- proto/go/gitalypb/cluster.pb.go | 533 +++++------------- proto/go/gitalypb/cluster_grpc.pb.go | 122 ++++ 5 files changed, 349 insertions(+), 550 deletions(-) create mode 100644 proto/go/gitalypb/cluster_grpc.pb.go diff --git a/internal/gitaly/storage/raftmgr/transport.go b/internal/gitaly/storage/raftmgr/transport.go index 77cfa744108..279ffdd2405 100644 --- a/internal/gitaly/storage/raftmgr/transport.go +++ b/internal/gitaly/storage/raftmgr/transport.go @@ -50,7 +50,7 @@ func (t *NoopTransport) Send(ctx context.Context, pathForLSN func(storage.LSN) s if messages[i].Entries[j].Type != raftpb.EntryNormal { continue } - var msg gitalypb.RaftMessageV1 + var msg gitalypb.RaftEntry if err := proto.Unmarshal(messages[i].Entries[j].Data, &msg); err != nil { return fmt.Errorf("unmarshalling entry type: %w", err) @@ -63,10 +63,7 @@ func (t *NoopTransport) Send(ctx context.Context, pathForLSN func(storage.LSN) s // purpose. A real implementation of Transaction will likely use an optimized method // (such as sidechannel) to deliver the data. It does not necessarily store the data in // the memory. - switch msg.GetLogData().(type) { - case *gitalypb.RaftMessageV1_Packed: - continue - case *gitalypb.RaftMessageV1_Referenced: + if len(msg.GetData().GetPacked()) == 0 { lsn := storage.LSN(messages[i].Entries[j].Index) path := pathForLSN(lsn) if err := t.packLogData(ctx, lsn, &msg, path); err != nil { @@ -96,7 +93,7 @@ func (t *NoopTransport) Send(ctx context.Context, pathForLSN func(storage.LSN) s return nil } -func (t *NoopTransport) packLogData(ctx context.Context, lsn storage.LSN, message *gitalypb.RaftMessageV1, logEntryPath string) error { +func (t *NoopTransport) packLogData(ctx context.Context, lsn storage.LSN, message *gitalypb.RaftEntry, logEntryPath string) error { var logData bytes.Buffer if err := archive.WriteTarball(ctx, t.logger.WithFields(log.Fields{ "raft.component": "WAL archiver", @@ -105,10 +102,9 @@ func (t *NoopTransport) packLogData(ctx context.Context, lsn storage.LSN, messag }), &logData, logEntryPath, "."); err != nil { return fmt.Errorf("archiving WAL log entry") } - message.LogData = &gitalypb.RaftMessageV1_Packed{ - Packed: &gitalypb.RaftMessageV1_PackedLogData{ - Data: logData.Bytes(), - }, + message.Data = &gitalypb.RaftEntry_LogData{ + LocalPath: message.GetData().GetLocalPath(), + Packed: logData.Bytes(), } return nil } diff --git a/internal/gitaly/storage/raftmgr/transport_test.go b/internal/gitaly/storage/raftmgr/transport_test.go index 0795964fc2d..876814f9d58 100644 --- a/internal/gitaly/storage/raftmgr/transport_test.go +++ b/internal/gitaly/storage/raftmgr/transport_test.go @@ -30,18 +30,18 @@ func TestNoopTransport_Send(t *testing.T) { tests := []struct { name string - setupFunc func(tempDir string) ([]*gitalypb.LogEntry, []raftpb.Message, testhelper.DirectoryState) + setupFunc func(tempDir string) ([]raftpb.Message, testhelper.DirectoryState) }{ { name: "No messages", - setupFunc: func(tempDir string) ([]*gitalypb.LogEntry, []raftpb.Message, testhelper.DirectoryState) { - return nil, []raftpb.Message{}, nil + setupFunc: func(tempDir string) ([]raftpb.Message, testhelper.DirectoryState) { + return []raftpb.Message{}, nil }, }, { name: "Empty Entries", - setupFunc: func(tempDir string) ([]*gitalypb.LogEntry, []raftpb.Message, testhelper.DirectoryState) { - return nil, []raftpb.Message{ + setupFunc: func(tempDir string) ([]raftpb.Message, testhelper.DirectoryState) { + return []raftpb.Message{ { Type: raftpb.MsgApp, From: 2, @@ -54,27 +54,10 @@ func TestNoopTransport_Send(t *testing.T) { }, { name: "Messages with already packed data", - setupFunc: func(tempDir string) ([]*gitalypb.LogEntry, []raftpb.Message, testhelper.DirectoryState) { - logEntry := &gitalypb.LogEntry{ - RelativePath: "relative-path", - Operations: []*gitalypb.LogEntry_Operation{ - { - Operation: &gitalypb.LogEntry_Operation_CreateHardLink_{ - CreateHardLink: &gitalypb.LogEntry_Operation_CreateHardLink{ - SourcePath: []byte("source"), - DestinationPath: []byte("destination"), - }, - }, - }, - }, - } - initialMessage := gitalypb.RaftMessageV1{ - Id: 1, - ClusterId: "44c58f50-0a8b-4849-bf8b-d5a56198ea7c", - AuthorityName: "sample-storage", - PartitionId: 1, - LogEntry: logEntry, - LogData: &gitalypb.RaftMessageV1_Packed{Packed: &gitalypb.RaftMessageV1_PackedLogData{Data: []byte("already packed data")}}, + setupFunc: func(tempDir string) ([]raftpb.Message, testhelper.DirectoryState) { + initialMessage := gitalypb.RaftEntry{ + Id: 1, + Data: &gitalypb.RaftEntry_LogData{Packed: []byte("already packed data")}, } messages := []raftpb.Message{ { @@ -86,12 +69,12 @@ func TestNoopTransport_Send(t *testing.T) { Entries: []raftpb.Entry{{Index: uint64(1), Type: raftpb.EntryNormal, Data: mustMarshalProto(&initialMessage)}}, }, } - return []*gitalypb.LogEntry{logEntry}, messages, nil + return messages, nil }, }, { name: "Messages with referenced data", - setupFunc: func(tempDir string) ([]*gitalypb.LogEntry, []raftpb.Message, testhelper.DirectoryState) { + setupFunc: func(tempDir string) ([]raftpb.Message, testhelper.DirectoryState) { // Simulate a log entry dir with files fileContents := testhelper.DirectoryState{ ".": {Mode: archive.TarFileMode | archive.ExecuteMode | fs.ModeDir}, @@ -106,27 +89,9 @@ func TestNoopTransport_Send(t *testing.T) { } } - // Construct message with ReferencedLogData - logEntry := &gitalypb.LogEntry{ - RelativePath: "relative-path", - Operations: []*gitalypb.LogEntry_Operation{ - { - Operation: &gitalypb.LogEntry_Operation_CreateHardLink_{ - CreateHardLink: &gitalypb.LogEntry_Operation_CreateHardLink{ - SourcePath: []byte("source"), - DestinationPath: []byte("destination"), - }, - }, - }, - }, - } - initialMessage := gitalypb.RaftMessageV1{ - Id: 1, - ClusterId: "44c58f50-0a8b-4849-bf8b-d5a56198ea7c", - AuthorityName: "sample-storage", - PartitionId: 1, - LogEntry: logEntry, - LogData: &gitalypb.RaftMessageV1_Referenced{Referenced: &gitalypb.RaftMessageV1_ReferencedLogData{}}, + initialMessage := gitalypb.RaftEntry{ + Id: 1, + Data: &gitalypb.RaftEntry_LogData{LocalPath: []byte(tempDir)}, } messages := []raftpb.Message{ @@ -141,7 +106,7 @@ func TestNoopTransport_Send(t *testing.T) { }, }, } - return []*gitalypb.LogEntry{logEntry}, messages, fileContents + return messages, fileContents }, }, } @@ -154,7 +119,7 @@ func TestNoopTransport_Send(t *testing.T) { tempDir := testhelper.TempDir(t) // Execute setup function to prepare messages and any necessary file contents - entries, messages, expectedContents := tc.setupFunc(tempDir) + messages, expectedContents := tc.setupFunc(tempDir) // Setup logger and transport logger := testhelper.SharedLogger(t) @@ -179,27 +144,17 @@ func TestNoopTransport_Send(t *testing.T) { if len(messages[i].Entries) == 0 { require.Empty(t, recordedMessages[i].Entries) } else { - var resultMessage gitalypb.RaftMessageV1 + var resultMessage gitalypb.RaftEntry require.NoError(t, proto.Unmarshal(recordedMessages[i].Entries[0].Data, &resultMessage)) - testhelper.ProtoEqual(t, entries[i], resultMessage.GetLogEntry()) - - packedData, ok := resultMessage.GetLogData().(*gitalypb.RaftMessageV1_Packed) - require.True(t, ok) - - tarballData := packedData.Packed.GetData() + require.True(t, len(resultMessage.GetData().GetPacked()) > 0, "packed data must have packed type") + tarballData := resultMessage.GetData().GetPacked() require.NotEmpty(t, tarballData) // Optionally verify packed data if expected if expectedContents != nil { - var resultMessage gitalypb.RaftMessageV1 - require.NoError(t, proto.Unmarshal(recordedMessages[0].Entries[0].Data, &resultMessage)) - - packedData, ok := resultMessage.GetLogData().(*gitalypb.RaftMessageV1_Packed) - require.True(t, ok, "packed data must have packed type") - // Verify tarball content matches expectations - reader := bytes.NewReader(packedData.Packed.GetData()) + reader := bytes.NewReader(tarballData) testhelper.RequireTarState(t, reader, expectedContents) } } diff --git a/proto/cluster.proto b/proto/cluster.proto index b8e19261d1b..1a6289edb04 100644 --- a/proto/cluster.proto +++ b/proto/cluster.proto @@ -1,107 +1,74 @@ syntax = "proto3"; package gitaly; -import "log.proto"; -option go_package = "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"; +import "lint.proto"; +import "raftpb/raft.proto"; // Upstream go.etcd.io/etcd/raft/v3/raftpb/raft.proto -// RaftMessageType defines the types of messages that can be used within the Raft protocol. -// These types help in identifying the nature of the message being processed. -enum RaftMessageType { - // UNSPECIFIED is used to indicate unspecified message type enum. - UNSPECIFIED = 0; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // NORMAL represents a standard Raft log entry proposed by the application. - NORMAL = 1; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // VERIFICATION refers to a special type of no-op entries during leader - // confirmation. Raft inserts such entries for verification. - VERIFICATION = 2; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // CONFIG_CHANGE signifies a change in the configuration of the Raft cluster, - // typically involving node additions or removals. - CONFIG_CHANGE = 3; // protolint:disable:this ENUM_FIELD_NAMES_PREFIX -} +option go_package = "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb"; -// RaftMessageV1 serves as a wrapper for messages exchanged in the Raft protocol, -// encapsulating essential information such as the log entry and related metadata. -message RaftMessageV1 { - // ReferencedLogData holds a reference path to the log data stored externally, - // which can be used to access large log entries without including them directly. - message ReferencedLogData { - // path represents the external storage location of the log data. - bytes path = 1; - } - // PackedLogData contains serialized log data including log entry itself and - // all attached files in the log entry directory. Those data are exchanged at - // the Transport layer before sending after after receiving messages. Hence, - // they are transparent to the core Raft engine. - message PackedLogData { - // data is serialized form of the log entry data. Transport implementations - // can choose to populate this data or read the data directly on disk. The - // latter approach is recommended. - bytes data = 1; +// RaftEntry encapsulates critical data for replication using etcd/raft library. +// It has a request ID allowing the primary to track when the action is +// effectively applied. +message RaftEntry { + // LogData contains serialized log data, including the log entry itself + // and all attached files in the log entry's directory. These data are + // exchanged at the Transport layer before sending and after receiving + // messages. They remain transparent to the core Raft engine. + message LogData { + // local_path is the path to the staging log entry directory. Before the + // request is sent to other nodes, this whole directory of the entry is + // serialized. So, this field is only relevant to the primary node who + // issues the request. + bytes local_path = 1; + // packed is the serialized form of the log entry data. Transport + // implementations populates this field before sending out messages to other + // members of a Raft group. + bytes packed = 2; } - // id is unique identifier for the Raft message. This ID is generated by an - // in-memory revent registry. Raft uses this ID to notify the committment - // status of a log entry. + // id is the unique identifier for the Raft message. This ID is generated by + // an in-memory event registry. Raft uses this ID to track the commit status + // of a log entry. uint64 id = 1; - // cluster_id is the identifier of the Raft cluster to which this message belongs. - string cluster_id = 2; - - // authority_name is the storage name of storage that creates a partition. - string authority_name = 3; + // data represents packed and serialized log data. + LogData data = 2; +} - // partition_id is the local incremental ID of the specific partition within a - // storage. (authority_name, partition_id) can be used as a unique identifier - // of a partition across the cluster. - uint64 partition_id = 4; +// RaftMessageRequest is a request for the SendMessage RPC. It serves as a +// wrapper for raftpb.Message. etcd/raft's state machines on each member emit +// this message. Since Gitaly employs multi-raft, routing metadata is attached +// to ensure the message reaches the correct Raft group inside the receiving +// Gitaly server. +message RaftMessageRequest { + // cluster_id is the identifier of the Raft cluster to which this message belongs. + string cluster_id = 1; - // log_entry is the actual log entry being processed or transmitted. - LogEntry log_entry = 5; + // authority_name is the storage name of the authority that creates a partition. + string authority_name = 2 [(gitaly.storage) = true]; - // log_data holds files inside log entry dir in one of two possible forms: - // referenced or packed. - oneof log_data { - // referenced represents reference to on-disk log data. - ReferencedLogData referenced = 6; + // partition_id is the local incrementing ID of a specific partition within a + // storage. Together with `authority_name`, this forms a unique identifier for + // a partition across the cluster. A partition belongs to a Raft group. + uint64 partition_id = 3; - // packed represents packed and serialized log data. - PackedLogData packed = 7; - } + // message is the Raft message to be delivered. + raftpb.Message message = 4; } -// RaftHardStateV1 is a wrapper for raftpb.HardState. The upstream uses proto2 -// syntax while Gitaly uses proto3. In addition, the protobuf package in -// upstream is outdated. The generated structs are not compatible with Gitaly's -// protobuf utilities. -// Source: -// https://github.com/etcd-io/raft/blob/12f0e5dc1b5bfff9bc6886ef1be4cba19495d6f2/raftpb/raft.proto#L110-114 -message RaftHardStateV1 { - // term represents the current term of the raft group. - uint64 term = 1; - // vote represents the vote of the raft group. - uint64 vote = 2; - // commit represents the latest commit index of the raft group. - uint64 commit = 3; +// RaftMessageResponse represents a response to the SendMessage RPC. +message RaftMessageResponse { } -// RaftConfStateV1 is a wrapper for raftpb.ConfState. For more information, -// please refer to RaftHardStateV1. Source: -// https://github.com/etcd-io/raft/blob/12f0e5dc1b5bfff9bc6886ef1be4cba19495d6f2/raftpb/raft.proto#L136 -message RaftConfStateV1 { - // voters in the incoming config. (If the configuration is not joint, - // then the outgoing config is empty). - repeated uint64 voters = 1; - // learners in the incoming config. - repeated uint64 learners = 2; - // voters_outgoing in the outgoing config. - repeated uint64 voters_outgoing = 3; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED - // learners_next is the nodes that will become learners when the outgoing - // config is removed. These nodes are necessarily currently in nodes_joint (or - // they would have been added to the incoming config right away). - repeated uint64 learners_next = 4; // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED - // auto_leave is set when the config is joint and Raft will automatically - // transition into the final config (i.e. remove the outgoing config) when - // this is safe. - bool auto_leave = 5; +// RaftService manages the sending of Raft messages to peers. +service RaftService { + // SendMessage processes Raft messages and ensures they are handled by + // the receiving node to update its Raft state machine. + rpc SendMessage(stream RaftMessageRequest) returns (RaftMessageResponse) { + option (op_type) = { + op: MUTATOR + scope_level: STORAGE + }; + } } diff --git a/proto/go/gitalypb/cluster.pb.go b/proto/go/gitalypb/cluster.pb.go index 11fef165cf2..559d8b88375 100644 --- a/proto/go/gitalypb/cluster.pb.go +++ b/proto/go/gitalypb/cluster.pb.go @@ -7,6 +7,7 @@ package gitalypb import ( + raftpb "go.etcd.io/etcd/raft/v3/raftpb" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -20,110 +21,35 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// RaftMessageType defines the types of messages that can be used within the Raft protocol. -// These types help in identifying the nature of the message being processed. -type RaftMessageType int32 - -const ( - // UNSPECIFIED is used to indicate unspecified message type enum. - RaftMessageType_UNSPECIFIED RaftMessageType = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // NORMAL represents a standard Raft log entry proposed by the application. - RaftMessageType_NORMAL RaftMessageType = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // VERIFICATION refers to a special type of no-op entries during leader - // confirmation. Raft inserts such entries for verification. - RaftMessageType_VERIFICATION RaftMessageType = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX - // CONFIG_CHANGE signifies a change in the configuration of the Raft cluster, - // typically involving node additions or removals. - RaftMessageType_CONFIG_CHANGE RaftMessageType = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX -) - -// Enum value maps for RaftMessageType. -var ( - RaftMessageType_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "NORMAL", - 2: "VERIFICATION", - 3: "CONFIG_CHANGE", - } - RaftMessageType_value = map[string]int32{ - "UNSPECIFIED": 0, - "NORMAL": 1, - "VERIFICATION": 2, - "CONFIG_CHANGE": 3, - } -) - -func (x RaftMessageType) Enum() *RaftMessageType { - p := new(RaftMessageType) - *p = x - return p -} - -func (x RaftMessageType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RaftMessageType) Descriptor() protoreflect.EnumDescriptor { - return file_cluster_proto_enumTypes[0].Descriptor() -} - -func (RaftMessageType) Type() protoreflect.EnumType { - return &file_cluster_proto_enumTypes[0] -} - -func (x RaftMessageType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RaftMessageType.Descriptor instead. -func (RaftMessageType) EnumDescriptor() ([]byte, []int) { - return file_cluster_proto_rawDescGZIP(), []int{0} -} - -// RaftMessageV1 serves as a wrapper for messages exchanged in the Raft protocol, -// encapsulating essential information such as the log entry and related metadata. -type RaftMessageV1 struct { +// RaftEntry encapsulates critical data for replication using etcd/raft library. +// It has a request ID allowing the primary to track when the action is +// effectively applied. +type RaftEntry struct { state protoimpl.MessageState `protogen:"open.v1"` - // id is unique identifier for the Raft message. This ID is generated by an - // in-memory revent registry. Raft uses this ID to notify the committment - // status of a log entry. + // id is the unique identifier for the Raft message. This ID is generated by + // an in-memory event registry. Raft uses this ID to track the commit status + // of a log entry. Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // cluster_id is the identifier of the Raft cluster to which this message belongs. - ClusterId string `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` - // authority_name is the storage name of storage that creates a partition. - AuthorityName string `protobuf:"bytes,3,opt,name=authority_name,json=authorityName,proto3" json:"authority_name,omitempty"` - // partition_id is the local incremental ID of the specific partition within a - // storage. (authority_name, partition_id) can be used as a unique identifier - // of a partition across the cluster. - PartitionId uint64 `protobuf:"varint,4,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` - // log_entry is the actual log entry being processed or transmitted. - LogEntry *LogEntry `protobuf:"bytes,5,opt,name=log_entry,json=logEntry,proto3" json:"log_entry,omitempty"` - // log_data holds files inside log entry dir in one of two possible forms: - // referenced or packed. - // - // Types that are valid to be assigned to LogData: - // - // *RaftMessageV1_Referenced - // *RaftMessageV1_Packed - LogData isRaftMessageV1_LogData `protobuf_oneof:"log_data"` + // data represents packed and serialized log data. + Data *RaftEntry_LogData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *RaftMessageV1) Reset() { - *x = RaftMessageV1{} +func (x *RaftEntry) Reset() { + *x = RaftEntry{} mi := &file_cluster_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RaftMessageV1) String() string { +func (x *RaftEntry) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RaftMessageV1) ProtoMessage() {} +func (*RaftEntry) ProtoMessage() {} -func (x *RaftMessageV1) ProtoReflect() protoreflect.Message { +func (x *RaftEntry) ProtoReflect() protoreflect.Message { mi := &file_cluster_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -135,121 +61,60 @@ func (x *RaftMessageV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RaftMessageV1.ProtoReflect.Descriptor instead. -func (*RaftMessageV1) Descriptor() ([]byte, []int) { +// Deprecated: Use RaftEntry.ProtoReflect.Descriptor instead. +func (*RaftEntry) Descriptor() ([]byte, []int) { return file_cluster_proto_rawDescGZIP(), []int{0} } -func (x *RaftMessageV1) GetId() uint64 { +func (x *RaftEntry) GetId() uint64 { if x != nil { return x.Id } return 0 } -func (x *RaftMessageV1) GetClusterId() string { - if x != nil { - return x.ClusterId - } - return "" -} - -func (x *RaftMessageV1) GetAuthorityName() string { - if x != nil { - return x.AuthorityName - } - return "" -} - -func (x *RaftMessageV1) GetPartitionId() uint64 { - if x != nil { - return x.PartitionId - } - return 0 -} - -func (x *RaftMessageV1) GetLogEntry() *LogEntry { +func (x *RaftEntry) GetData() *RaftEntry_LogData { if x != nil { - return x.LogEntry - } - return nil -} - -func (x *RaftMessageV1) GetLogData() isRaftMessageV1_LogData { - if x != nil { - return x.LogData - } - return nil -} - -func (x *RaftMessageV1) GetReferenced() *RaftMessageV1_ReferencedLogData { - if x != nil { - if x, ok := x.LogData.(*RaftMessageV1_Referenced); ok { - return x.Referenced - } - } - return nil -} - -func (x *RaftMessageV1) GetPacked() *RaftMessageV1_PackedLogData { - if x != nil { - if x, ok := x.LogData.(*RaftMessageV1_Packed); ok { - return x.Packed - } + return x.Data } return nil } -type isRaftMessageV1_LogData interface { - isRaftMessageV1_LogData() -} - -type RaftMessageV1_Referenced struct { - // referenced represents reference to on-disk log data. - Referenced *RaftMessageV1_ReferencedLogData `protobuf:"bytes,6,opt,name=referenced,proto3,oneof"` -} - -type RaftMessageV1_Packed struct { - // packed represents packed and serialized log data. - Packed *RaftMessageV1_PackedLogData `protobuf:"bytes,7,opt,name=packed,proto3,oneof"` -} - -func (*RaftMessageV1_Referenced) isRaftMessageV1_LogData() {} - -func (*RaftMessageV1_Packed) isRaftMessageV1_LogData() {} - -// RaftHardStateV1 is a wrapper for raftpb.HardState. The upstream uses proto2 -// syntax while Gitaly uses proto3. In addition, the protobuf package in -// upstream is outdated. The generated structs are not compatible with Gitaly's -// protobuf utilities. -// Source: -// https://github.com/etcd-io/raft/blob/12f0e5dc1b5bfff9bc6886ef1be4cba19495d6f2/raftpb/raft.proto#L110-114 -type RaftHardStateV1 struct { +// RaftMessageRequest is a request for the SendMessage RPC. It serves as a +// wrapper for raftpb.Message. etcd/raft's state machines on each member emit +// this message. Since Gitaly employs multi-raft, routing metadata is attached +// to ensure the message reaches the correct Raft group inside the receiving +// Gitaly server. +type RaftMessageRequest struct { state protoimpl.MessageState `protogen:"open.v1"` - // term represents the current term of the raft group. - Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` - // vote represents the vote of the raft group. - Vote uint64 `protobuf:"varint,2,opt,name=vote,proto3" json:"vote,omitempty"` - // commit represents the latest commit index of the raft group. - Commit uint64 `protobuf:"varint,3,opt,name=commit,proto3" json:"commit,omitempty"` + // cluster_id is the identifier of the Raft cluster to which this message belongs. + ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` + // authority_name is the storage name of the authority that creates a partition. + AuthorityName string `protobuf:"bytes,2,opt,name=authority_name,json=authorityName,proto3" json:"authority_name,omitempty"` + // partition_id is the local incrementing ID of a specific partition within a + // storage. Together with `authority_name`, this forms a unique identifier for + // a partition across the cluster. A partition belongs to a Raft group. + PartitionId uint64 `protobuf:"varint,3,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"` + // message is the Raft message to be delivered. + Message *raftpb.Message `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *RaftHardStateV1) Reset() { - *x = RaftHardStateV1{} +func (x *RaftMessageRequest) Reset() { + *x = RaftMessageRequest{} mi := &file_cluster_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RaftHardStateV1) String() string { +func (x *RaftMessageRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RaftHardStateV1) ProtoMessage() {} +func (*RaftMessageRequest) ProtoMessage() {} -func (x *RaftHardStateV1) ProtoReflect() protoreflect.Message { +func (x *RaftMessageRequest) ProtoReflect() protoreflect.Message { mi := &file_cluster_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -261,70 +126,60 @@ func (x *RaftHardStateV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RaftHardStateV1.ProtoReflect.Descriptor instead. -func (*RaftHardStateV1) Descriptor() ([]byte, []int) { +// Deprecated: Use RaftMessageRequest.ProtoReflect.Descriptor instead. +func (*RaftMessageRequest) Descriptor() ([]byte, []int) { return file_cluster_proto_rawDescGZIP(), []int{1} } -func (x *RaftHardStateV1) GetTerm() uint64 { +func (x *RaftMessageRequest) GetClusterId() string { if x != nil { - return x.Term + return x.ClusterId } - return 0 + return "" } -func (x *RaftHardStateV1) GetVote() uint64 { +func (x *RaftMessageRequest) GetAuthorityName() string { if x != nil { - return x.Vote + return x.AuthorityName } - return 0 + return "" } -func (x *RaftHardStateV1) GetCommit() uint64 { +func (x *RaftMessageRequest) GetPartitionId() uint64 { if x != nil { - return x.Commit + return x.PartitionId } return 0 } -// RaftConfStateV1 is a wrapper for raftpb.ConfState. For more information, -// please refer to RaftHardStateV1. Source: -// https://github.com/etcd-io/raft/blob/12f0e5dc1b5bfff9bc6886ef1be4cba19495d6f2/raftpb/raft.proto#L136 -type RaftConfStateV1 struct { - state protoimpl.MessageState `protogen:"open.v1"` - // voters in the incoming config. (If the configuration is not joint, - // then the outgoing config is empty). - Voters []uint64 `protobuf:"varint,1,rep,packed,name=voters,proto3" json:"voters,omitempty"` - // learners in the incoming config. - Learners []uint64 `protobuf:"varint,2,rep,packed,name=learners,proto3" json:"learners,omitempty"` - // voters_outgoing in the outgoing config. - VotersOutgoing []uint64 `protobuf:"varint,3,rep,packed,name=voters_outgoing,json=votersOutgoing,proto3" json:"voters_outgoing,omitempty"` // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED - // learners_next is the nodes that will become learners when the outgoing - // config is removed. These nodes are necessarily currently in nodes_joint (or - // they would have been added to the incoming config right away). - LearnersNext []uint64 `protobuf:"varint,4,rep,packed,name=learners_next,json=learnersNext,proto3" json:"learners_next,omitempty"` // protolint:disable:this REPEATED_FIELD_NAMES_PLURALIZED - // auto_leave is set when the config is joint and Raft will automatically - // transition into the final config (i.e. remove the outgoing config) when - // this is safe. - AutoLeave bool `protobuf:"varint,5,opt,name=auto_leave,json=autoLeave,proto3" json:"auto_leave,omitempty"` +func (x *RaftMessageRequest) GetMessage() *raftpb.Message { + if x != nil { + return x.Message + } + return nil +} + +// RaftMessageResponse represents a response to the SendMessage RPC. +type RaftMessageResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *RaftConfStateV1) Reset() { - *x = RaftConfStateV1{} +func (x *RaftMessageResponse) Reset() { + *x = RaftMessageResponse{} mi := &file_cluster_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RaftConfStateV1) String() string { +func (x *RaftMessageResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RaftConfStateV1) ProtoMessage() {} +func (*RaftMessageResponse) ProtoMessage() {} -func (x *RaftConfStateV1) ProtoReflect() protoreflect.Message { +func (x *RaftMessageResponse) ProtoReflect() protoreflect.Message { mi := &file_cluster_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -336,70 +191,44 @@ func (x *RaftConfStateV1) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RaftConfStateV1.ProtoReflect.Descriptor instead. -func (*RaftConfStateV1) Descriptor() ([]byte, []int) { +// Deprecated: Use RaftMessageResponse.ProtoReflect.Descriptor instead. +func (*RaftMessageResponse) Descriptor() ([]byte, []int) { return file_cluster_proto_rawDescGZIP(), []int{2} } -func (x *RaftConfStateV1) GetVoters() []uint64 { - if x != nil { - return x.Voters - } - return nil -} - -func (x *RaftConfStateV1) GetLearners() []uint64 { - if x != nil { - return x.Learners - } - return nil -} - -func (x *RaftConfStateV1) GetVotersOutgoing() []uint64 { - if x != nil { - return x.VotersOutgoing - } - return nil -} - -func (x *RaftConfStateV1) GetLearnersNext() []uint64 { - if x != nil { - return x.LearnersNext - } - return nil -} - -func (x *RaftConfStateV1) GetAutoLeave() bool { - if x != nil { - return x.AutoLeave - } - return false -} - -// ReferencedLogData holds a reference path to the log data stored externally, -// which can be used to access large log entries without including them directly. -type RaftMessageV1_ReferencedLogData struct { +// LogData contains serialized log data, including the log entry itself +// and all attached files in the log entry's directory. These data are +// exchanged at the Transport layer before sending and after receiving +// messages. They remain transparent to the core Raft engine. +type RaftEntry_LogData struct { state protoimpl.MessageState `protogen:"open.v1"` - // path represents the external storage location of the log data. - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // local_path is the path to the staging log entry directory. Before the + // request is sent to other nodes, this whole directory of the entry is + // serialized. So, this field is only relevant to the primary node who + // issues the request. + LocalPath []byte `protobuf:"bytes,1,opt,name=local_path,json=localPath,proto3" json:"local_path,omitempty"` + // packed is the serialized form of the log entry data. Transport + // implementations populates this field before sending out messages to other + // members of a Raft group. + Packed []byte `protobuf:"bytes,2,opt,name=packed,proto3" json:"packed,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *RaftMessageV1_ReferencedLogData) Reset() { - *x = RaftMessageV1_ReferencedLogData{} +func (x *RaftEntry_LogData) Reset() { + *x = RaftEntry_LogData{} mi := &file_cluster_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *RaftMessageV1_ReferencedLogData) String() string { +func (x *RaftEntry_LogData) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RaftMessageV1_ReferencedLogData) ProtoMessage() {} +func (*RaftEntry_LogData) ProtoMessage() {} -func (x *RaftMessageV1_ReferencedLogData) ProtoReflect() protoreflect.Message { +func (x *RaftEntry_LogData) ProtoReflect() protoreflect.Message { mi := &file_cluster_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -411,65 +240,21 @@ func (x *RaftMessageV1_ReferencedLogData) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RaftMessageV1_ReferencedLogData.ProtoReflect.Descriptor instead. -func (*RaftMessageV1_ReferencedLogData) Descriptor() ([]byte, []int) { +// Deprecated: Use RaftEntry_LogData.ProtoReflect.Descriptor instead. +func (*RaftEntry_LogData) Descriptor() ([]byte, []int) { return file_cluster_proto_rawDescGZIP(), []int{0, 0} } -func (x *RaftMessageV1_ReferencedLogData) GetPath() []byte { +func (x *RaftEntry_LogData) GetLocalPath() []byte { if x != nil { - return x.Path + return x.LocalPath } return nil } -// PackedLogData contains serialized log data including log entry itself and -// all attached files in the log entry directory. Those data are exchanged at -// the Transport layer before sending after after receiving messages. Hence, -// they are transparent to the core Raft engine. -type RaftMessageV1_PackedLogData struct { - state protoimpl.MessageState `protogen:"open.v1"` - // data is serialized form of the log entry data. Transport implementations - // can choose to populate this data or read the data directly on disk. The - // latter approach is recommended. - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RaftMessageV1_PackedLogData) Reset() { - *x = RaftMessageV1_PackedLogData{} - mi := &file_cluster_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RaftMessageV1_PackedLogData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RaftMessageV1_PackedLogData) ProtoMessage() {} - -func (x *RaftMessageV1_PackedLogData) ProtoReflect() protoreflect.Message { - mi := &file_cluster_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RaftMessageV1_PackedLogData.ProtoReflect.Descriptor instead. -func (*RaftMessageV1_PackedLogData) Descriptor() ([]byte, []int) { - return file_cluster_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *RaftMessageV1_PackedLogData) GetData() []byte { +func (x *RaftEntry_LogData) GetPacked() []byte { if x != nil { - return x.Data + return x.Packed } return nil } @@ -478,59 +263,40 @@ var File_cluster_proto protoreflect.FileDescriptor var file_cluster_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x06, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x09, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x9b, 0x03, 0x0a, 0x0d, 0x52, 0x61, 0x66, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x56, 0x31, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2d, 0x0a, - 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x49, 0x0a, 0x0a, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x66, 0x74, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x56, 0x31, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2e, 0x52, 0x61, 0x66, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x56, 0x31, 0x2e, 0x50, - 0x61, 0x63, 0x6b, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x06, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x1a, 0x27, 0x0a, 0x11, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x1a, - 0x23, 0x0a, 0x0d, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x42, 0x0a, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x51, 0x0a, 0x0f, 0x52, 0x61, 0x66, 0x74, 0x48, 0x61, 0x72, 0x64, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x56, 0x31, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x22, 0xb2, 0x01, 0x0a, 0x0f, 0x52, 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x56, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x6f, 0x74, 0x65, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x04, 0x52, 0x08, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x76, - 0x6f, 0x74, 0x65, 0x72, 0x73, 0x5f, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x04, 0x52, 0x0e, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x73, 0x4f, 0x75, 0x74, 0x67, - 0x6f, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x65, 0x61, 0x72, 0x6e, 0x65, 0x72, 0x73, - 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x65, 0x61, - 0x72, 0x6e, 0x65, 0x72, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x74, - 0x6f, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, - 0x75, 0x74, 0x6f, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x2a, 0x53, 0x0a, 0x0f, 0x52, 0x61, 0x66, 0x74, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, - 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x45, 0x52, 0x49, - 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, - 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x03, 0x42, 0x34, 0x5a, - 0x32, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x6c, - 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2f, 0x76, 0x31, - 0x36, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, - 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x06, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x1a, 0x0a, 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x72, 0x61, 0x66, 0x74, 0x70, 0x62, 0x2f, 0x72, 0x61, 0x66, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x09, 0x52, 0x61, 0x66, 0x74, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x66, 0x74, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x1a, 0x40, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, + 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, + 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, + 0x61, 0x63, 0x6b, 0x65, 0x64, 0x22, 0xae, 0x01, 0x0a, 0x12, 0x52, 0x61, 0x66, 0x74, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x0e, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x04, 0x88, 0xc6, 0x2c, 0x01, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, + 0x61, 0x66, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x52, 0x61, 0x66, 0x74, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x61, 0x0a, + 0x0b, 0x52, 0x61, 0x66, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x0b, + 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x2e, 0x67, 0x69, + 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x61, 0x66, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, + 0x2e, 0x52, 0x61, 0x66, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, 0xfa, 0x97, 0x28, 0x04, 0x08, 0x01, 0x10, 0x02, 0x28, 0x01, + 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, + 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, + 0x2f, 0x76, 0x31, 0x36, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x69, + 0x74, 0x61, 0x6c, 0x79, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -545,26 +311,24 @@ func file_cluster_proto_rawDescGZIP() []byte { return file_cluster_proto_rawDescData } -var file_cluster_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_cluster_proto_goTypes = []any{ - (RaftMessageType)(0), // 0: gitaly.RaftMessageType - (*RaftMessageV1)(nil), // 1: gitaly.RaftMessageV1 - (*RaftHardStateV1)(nil), // 2: gitaly.RaftHardStateV1 - (*RaftConfStateV1)(nil), // 3: gitaly.RaftConfStateV1 - (*RaftMessageV1_ReferencedLogData)(nil), // 4: gitaly.RaftMessageV1.ReferencedLogData - (*RaftMessageV1_PackedLogData)(nil), // 5: gitaly.RaftMessageV1.PackedLogData - (*LogEntry)(nil), // 6: gitaly.LogEntry + (*RaftEntry)(nil), // 0: gitaly.RaftEntry + (*RaftMessageRequest)(nil), // 1: gitaly.RaftMessageRequest + (*RaftMessageResponse)(nil), // 2: gitaly.RaftMessageResponse + (*RaftEntry_LogData)(nil), // 3: gitaly.RaftEntry.LogData + (*raftpb.Message)(nil), // 4: raftpb.Message } var file_cluster_proto_depIdxs = []int32{ - 6, // 0: gitaly.RaftMessageV1.log_entry:type_name -> gitaly.LogEntry - 4, // 1: gitaly.RaftMessageV1.referenced:type_name -> gitaly.RaftMessageV1.ReferencedLogData - 5, // 2: gitaly.RaftMessageV1.packed:type_name -> gitaly.RaftMessageV1.PackedLogData - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 3, // 0: gitaly.RaftEntry.data:type_name -> gitaly.RaftEntry.LogData + 4, // 1: gitaly.RaftMessageRequest.message:type_name -> raftpb.Message + 1, // 2: gitaly.RaftService.SendMessage:input_type -> gitaly.RaftMessageRequest + 2, // 3: gitaly.RaftService.SendMessage:output_type -> gitaly.RaftMessageResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_cluster_proto_init() } @@ -572,24 +336,19 @@ func file_cluster_proto_init() { if File_cluster_proto != nil { return } - file_log_proto_init() - file_cluster_proto_msgTypes[0].OneofWrappers = []any{ - (*RaftMessageV1_Referenced)(nil), - (*RaftMessageV1_Packed)(nil), - } + file_lint_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cluster_proto_rawDesc, - NumEnums: 1, - NumMessages: 5, + NumEnums: 0, + NumMessages: 4, NumExtensions: 0, - NumServices: 0, + NumServices: 1, }, GoTypes: file_cluster_proto_goTypes, DependencyIndexes: file_cluster_proto_depIdxs, - EnumInfos: file_cluster_proto_enumTypes, MessageInfos: file_cluster_proto_msgTypes, }.Build() File_cluster_proto = out.File diff --git a/proto/go/gitalypb/cluster_grpc.pb.go b/proto/go/gitalypb/cluster_grpc.pb.go new file mode 100644 index 00000000000..6071dace34f --- /dev/null +++ b/proto/go/gitalypb/cluster_grpc.pb.go @@ -0,0 +1,122 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v4.23.1 +// source: cluster.proto + +package gitalypb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + RaftService_SendMessage_FullMethodName = "/gitaly.RaftService/SendMessage" +) + +// RaftServiceClient is the client API for RaftService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// RaftService manages the sending of Raft messages to peers. +type RaftServiceClient interface { + // SendMessage processes Raft messages and ensures they are handled by + // the receiving node to update its Raft state machine. + SendMessage(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[RaftMessageRequest, RaftMessageResponse], error) +} + +type raftServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRaftServiceClient(cc grpc.ClientConnInterface) RaftServiceClient { + return &raftServiceClient{cc} +} + +func (c *raftServiceClient) SendMessage(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[RaftMessageRequest, RaftMessageResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &RaftService_ServiceDesc.Streams[0], RaftService_SendMessage_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[RaftMessageRequest, RaftMessageResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type RaftService_SendMessageClient = grpc.ClientStreamingClient[RaftMessageRequest, RaftMessageResponse] + +// RaftServiceServer is the server API for RaftService service. +// All implementations must embed UnimplementedRaftServiceServer +// for forward compatibility. +// +// RaftService manages the sending of Raft messages to peers. +type RaftServiceServer interface { + // SendMessage processes Raft messages and ensures they are handled by + // the receiving node to update its Raft state machine. + SendMessage(grpc.ClientStreamingServer[RaftMessageRequest, RaftMessageResponse]) error + mustEmbedUnimplementedRaftServiceServer() +} + +// UnimplementedRaftServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedRaftServiceServer struct{} + +func (UnimplementedRaftServiceServer) SendMessage(grpc.ClientStreamingServer[RaftMessageRequest, RaftMessageResponse]) error { + return status.Errorf(codes.Unimplemented, "method SendMessage not implemented") +} +func (UnimplementedRaftServiceServer) mustEmbedUnimplementedRaftServiceServer() {} +func (UnimplementedRaftServiceServer) testEmbeddedByValue() {} + +// UnsafeRaftServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RaftServiceServer will +// result in compilation errors. +type UnsafeRaftServiceServer interface { + mustEmbedUnimplementedRaftServiceServer() +} + +func RegisterRaftServiceServer(s grpc.ServiceRegistrar, srv RaftServiceServer) { + // If the following call pancis, it indicates UnimplementedRaftServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&RaftService_ServiceDesc, srv) +} + +func _RaftService_SendMessage_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RaftServiceServer).SendMessage(&grpc.GenericServerStream[RaftMessageRequest, RaftMessageResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type RaftService_SendMessageServer = grpc.ClientStreamingServer[RaftMessageRequest, RaftMessageResponse] + +// RaftService_ServiceDesc is the grpc.ServiceDesc for RaftService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RaftService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gitaly.RaftService", + HandlerType: (*RaftServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "SendMessage", + Handler: _RaftService_SendMessage_Handler, + ClientStreams: true, + }, + }, + Metadata: "cluster.proto", +} -- GitLab From d6fb56775c4293a25ee6951f9a369228dc34d044 Mon Sep 17 00:00:00 2001 From: Quang-Minh Nguyen Date: Wed, 15 Jan 2025 17:54:30 +0700 Subject: [PATCH 3/3] tools/protoc-gen-go: Update module google.golang.org/protobuf to v1.36.2 This commit updates the protoc-gen-go tool to newer version. This tool is used to compile *.proto files to corresponding Go code. The changelog has nothing interesting. This commit is drafted manually because the renovation bot could not upgrade this dependency. --- proto/go/gitalypb/analysis.pb.go | 2 +- proto/go/gitalypb/blob.pb.go | 2 +- proto/go/gitalypb/cleanup.pb.go | 2 +- proto/go/gitalypb/cluster.pb.go | 2 +- proto/go/gitalypb/commit.pb.go | 2 +- proto/go/gitalypb/conflicts.pb.go | 2 +- proto/go/gitalypb/diff.pb.go | 2 +- proto/go/gitalypb/errors.pb.go | 2 +- proto/go/gitalypb/hook.pb.go | 2 +- proto/go/gitalypb/internal.pb.go | 2 +- proto/go/gitalypb/lint.pb.go | 2 +- proto/go/gitalypb/log.pb.go | 2 +- proto/go/gitalypb/objectpool.pb.go | 2 +- proto/go/gitalypb/operations.pb.go | 2 +- proto/go/gitalypb/packfile.pb.go | 2 +- proto/go/gitalypb/partition.pb.go | 2 +- proto/go/gitalypb/praefect.pb.go | 2 +- proto/go/gitalypb/ref.pb.go | 2 +- proto/go/gitalypb/remote.pb.go | 2 +- proto/go/gitalypb/repository.pb.go | 2 +- proto/go/gitalypb/server.pb.go | 2 +- proto/go/gitalypb/service_config.pb.go | 2 +- proto/go/gitalypb/shared.pb.go | 2 +- proto/go/gitalypb/smarthttp.pb.go | 2 +- proto/go/gitalypb/ssh.pb.go | 2 +- proto/go/gitalypb/testproto/error_metadata.pb.go | 2 +- proto/go/gitalypb/testproto/invalid.pb.go | 2 +- proto/go/gitalypb/testproto/valid.pb.go | 2 +- proto/go/gitalypb/transaction.pb.go | 2 +- tools/protoc-gen-go/go.mod | 2 +- tools/protoc-gen-go/go.sum | 4 ++-- 31 files changed, 32 insertions(+), 32 deletions(-) diff --git a/proto/go/gitalypb/analysis.pb.go b/proto/go/gitalypb/analysis.pb.go index d1e757b1d7e..65ee189f03e 100644 --- a/proto/go/gitalypb/analysis.pb.go +++ b/proto/go/gitalypb/analysis.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: analysis.proto diff --git a/proto/go/gitalypb/blob.pb.go b/proto/go/gitalypb/blob.pb.go index 66a01a09900..7b9056e0aa9 100644 --- a/proto/go/gitalypb/blob.pb.go +++ b/proto/go/gitalypb/blob.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: blob.proto diff --git a/proto/go/gitalypb/cleanup.pb.go b/proto/go/gitalypb/cleanup.pb.go index 6a3212ab998..90eb6031315 100644 --- a/proto/go/gitalypb/cleanup.pb.go +++ b/proto/go/gitalypb/cleanup.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: cleanup.proto diff --git a/proto/go/gitalypb/cluster.pb.go b/proto/go/gitalypb/cluster.pb.go index 559d8b88375..e68f2212b37 100644 --- a/proto/go/gitalypb/cluster.pb.go +++ b/proto/go/gitalypb/cluster.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: cluster.proto diff --git a/proto/go/gitalypb/commit.pb.go b/proto/go/gitalypb/commit.pb.go index da722e8bf7f..a2fd50d271a 100644 --- a/proto/go/gitalypb/commit.pb.go +++ b/proto/go/gitalypb/commit.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: commit.proto diff --git a/proto/go/gitalypb/conflicts.pb.go b/proto/go/gitalypb/conflicts.pb.go index 5e4a9288319..81284c2816a 100644 --- a/proto/go/gitalypb/conflicts.pb.go +++ b/proto/go/gitalypb/conflicts.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: conflicts.proto diff --git a/proto/go/gitalypb/diff.pb.go b/proto/go/gitalypb/diff.pb.go index 10d4232001a..cae07e46e41 100644 --- a/proto/go/gitalypb/diff.pb.go +++ b/proto/go/gitalypb/diff.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: diff.proto diff --git a/proto/go/gitalypb/errors.pb.go b/proto/go/gitalypb/errors.pb.go index 5f1b848aedd..5f6402ed032 100644 --- a/proto/go/gitalypb/errors.pb.go +++ b/proto/go/gitalypb/errors.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: errors.proto diff --git a/proto/go/gitalypb/hook.pb.go b/proto/go/gitalypb/hook.pb.go index 7e641894b5a..0c38e803206 100644 --- a/proto/go/gitalypb/hook.pb.go +++ b/proto/go/gitalypb/hook.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: hook.proto diff --git a/proto/go/gitalypb/internal.pb.go b/proto/go/gitalypb/internal.pb.go index b6ac6fedcaa..c940447ec86 100644 --- a/proto/go/gitalypb/internal.pb.go +++ b/proto/go/gitalypb/internal.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: internal.proto diff --git a/proto/go/gitalypb/lint.pb.go b/proto/go/gitalypb/lint.pb.go index 9d1581621ac..a0d8d5c164a 100644 --- a/proto/go/gitalypb/lint.pb.go +++ b/proto/go/gitalypb/lint.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: lint.proto diff --git a/proto/go/gitalypb/log.pb.go b/proto/go/gitalypb/log.pb.go index ff0064ed18e..fcc288cd373 100644 --- a/proto/go/gitalypb/log.pb.go +++ b/proto/go/gitalypb/log.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: log.proto diff --git a/proto/go/gitalypb/objectpool.pb.go b/proto/go/gitalypb/objectpool.pb.go index 5d67ff0285c..80505323554 100644 --- a/proto/go/gitalypb/objectpool.pb.go +++ b/proto/go/gitalypb/objectpool.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: objectpool.proto diff --git a/proto/go/gitalypb/operations.pb.go b/proto/go/gitalypb/operations.pb.go index 39471304788..b7118e100f8 100644 --- a/proto/go/gitalypb/operations.pb.go +++ b/proto/go/gitalypb/operations.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: operations.proto diff --git a/proto/go/gitalypb/packfile.pb.go b/proto/go/gitalypb/packfile.pb.go index fd29e44c220..2bab3ca3e86 100644 --- a/proto/go/gitalypb/packfile.pb.go +++ b/proto/go/gitalypb/packfile.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: packfile.proto diff --git a/proto/go/gitalypb/partition.pb.go b/proto/go/gitalypb/partition.pb.go index b7b0b4c8322..834d903dabd 100644 --- a/proto/go/gitalypb/partition.pb.go +++ b/proto/go/gitalypb/partition.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: partition.proto diff --git a/proto/go/gitalypb/praefect.pb.go b/proto/go/gitalypb/praefect.pb.go index 28409673f15..23b8a51f2af 100644 --- a/proto/go/gitalypb/praefect.pb.go +++ b/proto/go/gitalypb/praefect.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: praefect.proto diff --git a/proto/go/gitalypb/ref.pb.go b/proto/go/gitalypb/ref.pb.go index aba86cc1a9a..4e4f4362604 100644 --- a/proto/go/gitalypb/ref.pb.go +++ b/proto/go/gitalypb/ref.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: ref.proto diff --git a/proto/go/gitalypb/remote.pb.go b/proto/go/gitalypb/remote.pb.go index 7edffde1bfa..1bb9fa2950d 100644 --- a/proto/go/gitalypb/remote.pb.go +++ b/proto/go/gitalypb/remote.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: remote.proto diff --git a/proto/go/gitalypb/repository.pb.go b/proto/go/gitalypb/repository.pb.go index 6657517f77f..40e50e79368 100644 --- a/proto/go/gitalypb/repository.pb.go +++ b/proto/go/gitalypb/repository.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: repository.proto diff --git a/proto/go/gitalypb/server.pb.go b/proto/go/gitalypb/server.pb.go index 78defd6b311..11370be2c0a 100644 --- a/proto/go/gitalypb/server.pb.go +++ b/proto/go/gitalypb/server.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: server.proto diff --git a/proto/go/gitalypb/service_config.pb.go b/proto/go/gitalypb/service_config.pb.go index 281825be8aa..59697065926 100644 --- a/proto/go/gitalypb/service_config.pb.go +++ b/proto/go/gitalypb/service_config.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: service_config.proto diff --git a/proto/go/gitalypb/shared.pb.go b/proto/go/gitalypb/shared.pb.go index c8fd36d216d..4c512c5de40 100644 --- a/proto/go/gitalypb/shared.pb.go +++ b/proto/go/gitalypb/shared.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: shared.proto diff --git a/proto/go/gitalypb/smarthttp.pb.go b/proto/go/gitalypb/smarthttp.pb.go index 588f1cbeacd..b2f0d9f4fd0 100644 --- a/proto/go/gitalypb/smarthttp.pb.go +++ b/proto/go/gitalypb/smarthttp.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: smarthttp.proto diff --git a/proto/go/gitalypb/ssh.pb.go b/proto/go/gitalypb/ssh.pb.go index d3edd37c62e..baf306aa4b8 100644 --- a/proto/go/gitalypb/ssh.pb.go +++ b/proto/go/gitalypb/ssh.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: ssh.proto diff --git a/proto/go/gitalypb/testproto/error_metadata.pb.go b/proto/go/gitalypb/testproto/error_metadata.pb.go index 308d2962b0d..26a505d83f3 100644 --- a/proto/go/gitalypb/testproto/error_metadata.pb.go +++ b/proto/go/gitalypb/testproto/error_metadata.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: testproto/error_metadata.proto diff --git a/proto/go/gitalypb/testproto/invalid.pb.go b/proto/go/gitalypb/testproto/invalid.pb.go index 6f4566e8dfc..fc9667b1653 100644 --- a/proto/go/gitalypb/testproto/invalid.pb.go +++ b/proto/go/gitalypb/testproto/invalid.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: testproto/invalid.proto diff --git a/proto/go/gitalypb/testproto/valid.pb.go b/proto/go/gitalypb/testproto/valid.pb.go index d26d94fefa3..e8d103325f3 100644 --- a/proto/go/gitalypb/testproto/valid.pb.go +++ b/proto/go/gitalypb/testproto/valid.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: testproto/valid.proto diff --git a/proto/go/gitalypb/transaction.pb.go b/proto/go/gitalypb/transaction.pb.go index 57d36e20ce2..0949bf8dd9a 100644 --- a/proto/go/gitalypb/transaction.pb.go +++ b/proto/go/gitalypb/transaction.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 +// protoc-gen-go v1.36.2 // protoc v4.23.1 // source: transaction.proto diff --git a/tools/protoc-gen-go/go.mod b/tools/protoc-gen-go/go.mod index 6dc2c50329c..5dacc5bb3cd 100644 --- a/tools/protoc-gen-go/go.mod +++ b/tools/protoc-gen-go/go.mod @@ -2,6 +2,6 @@ module gitlab.com/gitlab-org/gitaly/tools/protoc-gen-go go 1.22 -require google.golang.org/protobuf v1.36.0 +require google.golang.org/protobuf v1.36.2 require github.com/google/go-cmp v0.5.9 // indirect diff --git a/tools/protoc-gen-go/go.sum b/tools/protoc-gen-go/go.sum index 1f1f24bc681..7b933ccd5f6 100644 --- a/tools/protoc-gen-go/go.sum +++ b/tools/protoc-gen-go/go.sum @@ -1,4 +1,4 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= -google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= +google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= -- GitLab