[go: up one dir, main page]

Skip to content

Embed raftpb to Gitaly for direct use

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.

This MR also updates cluster.proto to prepare for !7553 (merged) and #6401 (closed).

Merge request reports

Loading