diff options
author | John Cai <jcai@gitlab.com> | 2020-03-19 00:37:15 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2020-03-19 01:27:30 +0300 |
commit | 3b9fd601b4edf5c99a05a650d57faf99372c4495 (patch) | |
tree | 066cd0ced93c327e9a8aaf53179f16f4ec3de619 | |
parent | 1b7629e1c76556e0e216784deebb989b43169d62 (diff) |
Calculate checksum by default in ReplicateRepositoryjc-replicate-checksums
-rw-r--r-- | internal/service/repository/replicate.go | 84 | ||||
-rw-r--r-- | internal/service/repository/replicate_test.go | 110 | ||||
-rw-r--r-- | proto/go/gitalypb/repository-service.pb.go | 123 | ||||
-rw-r--r-- | proto/repository-service.proto | 1 | ||||
-rw-r--r-- | ruby/proto/gitaly/repository-service_pb.rb | 1 |
5 files changed, 260 insertions, 59 deletions
diff --git a/internal/service/repository/replicate.go b/internal/service/repository/replicate.go index 35080fafc..df07ea58c 100644 --- a/internal/service/repository/replicate.go +++ b/internal/service/repository/replicate.go @@ -44,8 +44,8 @@ func (s *server) ReplicateRepository(ctx context.Context, in *gitalypb.Replicate } } - g, ctx := errgroup.WithContext(ctx) - outgoingCtx := helper.IncomingToOutgoing(ctx) + g, replCtx := errgroup.WithContext(ctx) + outgoingCtx := helper.IncomingToOutgoing(replCtx) for _, f := range syncFuncs { f := f // rescoping f @@ -56,6 +56,15 @@ func (s *server) ReplicateRepository(ctx context.Context, in *gitalypb.Replicate return nil, helper.ErrInternal(err) } + checksumsMatch, err := s.verifyChecksums(ctx, in) + if err != nil { + return nil, helper.ErrInternal(err) + } + + if !checksumsMatch { + return nil, helper.ErrInternal(errors.New("checksums do not match after replication")) + } + return &gitalypb.ReplicateRepositoryResponse{}, nil } @@ -223,6 +232,68 @@ func (s *server) syncInfoAttributes(ctx context.Context, in *gitalypb.ReplicateR return os.Rename(attributesPath, attributesPath) } +func (s *server) verifyChecksums(ctx context.Context, in *gitalypb.ReplicateRepositoryRequest) (bool, error) { + g, checksumCtx := errgroup.WithContext(ctx) + outgoingCtx := helper.IncomingToOutgoing(checksumCtx) + + var checksums [2]string + if !in.GetSkipChecksum() { + g.Go(func() error { + client, err := s.newInternalRepoClient() + if err != nil { + return err + } + + checksum, err := getChecksum(outgoingCtx, client, in.GetRepository()) + if err != nil { + return err + } + + checksums[0] = checksum + return nil + }) + g.Go(func() error { + client, err := s.newRepoClient(outgoingCtx, in.GetSource().GetStorageName()) + if err != nil { + return err + } + + checksum, err := getChecksum(outgoingCtx, client, in.GetSource()) + if err != nil { + return err + } + + checksums[1] = checksum + return nil + }) + } + + if err := g.Wait(); err != nil { + return false, err + } + + return checksumsMatch(checksums), nil +} + +func checksumsMatch(checksums [2]string) bool { + if checksums[0] == "" || checksums[1] == "" { + return false + } + + return checksums[0] == checksums[1] +} + +func getChecksum(ctx context.Context, client gitalypb.RepositoryServiceClient, repository *gitalypb.Repository) (string, error) { + resp, err := client.CalculateChecksum(ctx, &gitalypb.CalculateChecksumRequest{ + Repository: repository, + }) + if err != nil { + return "", err + } + + return resp.Checksum, nil +} + // newRemoteClient creates a new RemoteClient that talks to the same gitaly server func (s *server) newRemoteClient() (gitalypb.RemoteServiceClient, error) { cc, err := s.getOrCreateConnection(fmt.Sprintf("unix:%s", s.internalGitalySocket), "") @@ -233,6 +304,15 @@ func (s *server) newRemoteClient() (gitalypb.RemoteServiceClient, error) { return gitalypb.NewRemoteServiceClient(cc), nil } +func (s *server) newInternalRepoClient() (gitalypb.RepositoryServiceClient, error) { + cc, err := s.getOrCreateConnection(fmt.Sprintf("unix:%s", s.internalGitalySocket), "") + if err != nil { + return nil, err + } + + return gitalypb.NewRepositoryServiceClient(cc), nil +} + // newRepoClient creates a new RepositoryClient that talks to the gitaly of the source repository func (s *server) newRepoClient(ctx context.Context, storageName string) (gitalypb.RepositoryServiceClient, error) { conn, err := s.getConnectionByStorage(ctx, storageName) diff --git a/internal/service/repository/replicate_test.go b/internal/service/repository/replicate_test.go index 2dd9a8fbf..cfea9aea0 100644 --- a/internal/service/repository/replicate_test.go +++ b/internal/service/repository/replicate_test.go @@ -3,6 +3,7 @@ package repository_test import ( "bytes" "context" + "crypto/sha1" "fmt" "io/ioutil" "net" @@ -15,6 +16,8 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/config" "gitlab.com/gitlab-org/gitaly/internal/helper" "gitlab.com/gitlab-org/gitaly/internal/helper/text" + "gitlab.com/gitlab-org/gitaly/internal/rubyserver" + "gitlab.com/gitlab-org/gitaly/internal/service/remote" "gitlab.com/gitlab-org/gitaly/internal/service/repository" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/proto/go/gitalypb" @@ -315,6 +318,58 @@ func TestReplicateRepository_FailedFetchInternalRemote(t *testing.T) { require.Error(t, err) } +func TestReplicateRepository_BadChecksum(t *testing.T) { + tmpPath, cleanup := testhelper.TempDir(t, t.Name()) + defer cleanup() + + replicaPath := filepath.Join(tmpPath, "replica") + require.NoError(t, os.MkdirAll(replicaPath, 0755)) + + defer func(storages []config.Storage) { + config.Config.Storages = storages + }(config.Config.Storages) + + config.Config.Storages = []config.Storage{ + config.Storage{ + Name: "default", + Path: testhelper.GitlabTestStoragePath(), + }, + config.Storage{ + Name: "replica", + Path: replicaPath, + }, + } + + server, serverSocketPath := runServerWithBadChecksum(t) + defer server.Stop() + + testRepo, _, cleanupRepo := testhelper.NewTestRepo(t) + defer cleanupRepo() + + config.Config.SocketPath = serverSocketPath + + repoClient, conn := repository.NewRepositoryClient(t, serverSocketPath) + defer conn.Close() + + targetRepo := *testRepo + targetRepo.StorageName = "replica" + + ctx, cancel := testhelper.Context() + defer cancel() + + md := testhelper.GitalyServersMetadata(t, serverSocketPath) + injectedCtx := metadata.NewOutgoingContext(ctx, md) + + // first ReplicateRepository call will replicate via snapshot + _, err := repoClient.ReplicateRepository(injectedCtx, &gitalypb.ReplicateRepositoryRequest{ + Repository: &targetRepo, + Source: testRepo, + }) + require.Error(t, err) + testhelper.RequireGrpcError(t, err, codes.Internal) + testhelper.GrpcErrorHasMessage(err, "checksums do not match after replication") +} + func runServerWithBadFetchInternalRemote(t *testing.T) (*grpc.Server, string) { server := testhelper.NewTestGrpcServer(t, nil, nil) serverSocketPath := testhelper.GetTemporaryGitalySocketFileName() @@ -335,6 +390,61 @@ func runServerWithBadFetchInternalRemote(t *testing.T) (*grpc.Server, string) { return server, "unix://" + serverSocketPath } +func runServerWithBadChecksum(t *testing.T) (*grpc.Server, string) { + server := testhelper.NewTestGrpcServer(t, nil, nil) + serverSocketPath := testhelper.GetTemporaryGitalySocketFileName() + + listener, err := net.Listen("unix", serverSocketPath) + require.NoError(t, err) + internalListener, err := net.Listen("unix", config.GitalyInternalSocketPath()) + require.NoError(t, err) + + repositoryServer := repository.NewServer(repository.RubyServer, config.GitalyInternalSocketPath()) + + gitalypb.RegisterRepositoryServiceServer(server, &mockRepoServer{ + repositoryServer: repositoryServer, + }) + gitalypb.RegisterRemoteServiceServer(server, remote.NewServer(&rubyserver.Server{})) + reflection.Register(server) + + go server.Serve(listener) + go server.Serve(internalListener) + + return server, "unix://" + serverSocketPath +} + +type mockRepoServer struct { + repositoryServer gitalypb.RepositoryServiceServer + gitalypb.UnimplementedRepositoryServiceServer +} + +func (m *mockRepoServer) GetSnapshot(in *gitalypb.GetSnapshotRequest, stream gitalypb.RepositoryService_GetSnapshotServer) error { + return m.repositoryServer.GetSnapshot(in, stream) +} + +func (m *mockRepoServer) GetInfoAttributes(in *gitalypb.GetInfoAttributesRequest, stream gitalypb.RepositoryService_GetInfoAttributesServer) error { + return m.repositoryServer.GetInfoAttributes(in, stream) +} + +func (m *mockRepoServer) ReplicateRepository(ctx context.Context, in *gitalypb.ReplicateRepositoryRequest) (*gitalypb.ReplicateRepositoryResponse, error) { + return m.repositoryServer.ReplicateRepository(ctx, in) +} + +// CalculateChecksum returns random checksums +func (m *mockRepoServer) CalculateChecksum(ctx context.Context, in *gitalypb.CalculateChecksumRequest) (*gitalypb.CalculateChecksumResponse, error) { + // generate a random checksum + h := sha1.New() + rand, err := text.RandomHex(2) + if err != nil { + return nil, err + } + h.Write([]byte(rand)) + + return &gitalypb.CalculateChecksumResponse{ + Checksum: fmt.Sprintf("%x", h.Sum(nil)), + }, nil +} + type mockRemoteServer struct { gitalypb.UnimplementedRemoteServiceServer } diff --git a/proto/go/gitalypb/repository-service.pb.go b/proto/go/gitalypb/repository-service.pb.go index 6761f8307..2a7c893a1 100644 --- a/proto/go/gitalypb/repository-service.pb.go +++ b/proto/go/gitalypb/repository-service.pb.go @@ -3659,6 +3659,7 @@ var xxx_messageInfo_RenameRepositoryResponse proto.InternalMessageInfo type ReplicateRepositoryRequest struct { Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` Source *Repository `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` + SkipChecksum bool `protobuf:"varint,3,opt,name=skip_checksum,json=skipChecksum,proto3" json:"skip_checksum,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -3703,6 +3704,13 @@ func (m *ReplicateRepositoryRequest) GetSource() *Repository { return nil } +func (m *ReplicateRepositoryRequest) GetSkipChecksum() bool { + if m != nil { + return m.SkipChecksum + } + return false +} + type ReplicateRepositoryResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -3825,19 +3833,19 @@ func init() { func init() { proto.RegisterFile("repository-service.proto", fileDescriptor_e9b1768cf174c79b) } var fileDescriptor_e9b1768cf174c79b = []byte{ - // 2931 bytes of a gzipped FileDescriptorProto + // 2947 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4b, 0x6f, 0x1c, 0xc7, 0xf1, 0xd7, 0xf2, 0xb5, 0xbb, 0xc5, 0x95, 0xb4, 0x6c, 0x52, 0xe4, 0x72, 0x44, 0x8a, 0xd2, 0x48, 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c, 0xfa, 0xe3, 0xbf, 0x1e, 0x97, 0x8c, 0x18, 0xaf, 0xbe, 0x01, 0x8d, 0xac, 0xd0, 0xa0, 0x4f, 0xbc, 0x00, 0xa3, 0x45, 0x98, 0xc1, 0x9c, 0xc2, 0x25, 0x56, 0x0c, 0xd9, 0xd2, 0x4f, 0xf9, 0x18, 0xcb, 0x3e, 0x3f, 0xf0, 0x6c, 0x1f, 0xf7, 0xb0, 0x47, 0x2d, 0x77, 0x74, 0x4b, 0x6e, 0xc3, 0x72, 0x8e, 0x54, 0x61, 0x8a, 0xee, 0xc3, 0x9c, 0xe8, @@ -3916,7 +3924,7 @@ var fileDescriptor_e9b1768cf174c79b = []byte{ 0x7e, 0xd0, 0x25, 0xa3, 0x43, 0x12, 0xfa, 0x7b, 0x30, 0x9f, 0x90, 0x37, 0x24, 0x94, 0xbf, 0x2b, 0xc1, 0xfd, 0xbc, 0xc0, 0x1a, 0x9b, 0x31, 0x2c, 0x07, 0xed, 0x52, 0xda, 0x37, 0xd5, 0xb5, 0x54, 0x66, 0xed, 0x4f, 0x7d, 0x97, 0x5d, 0xb2, 0xbc, 0xcb, 0x1a, 0xd0, 0xae, 0x4c, 0xab, 0x38, 0xef, - 0xe6, 0x80, 0x76, 0xf5, 0x87, 0xf0, 0x60, 0xb8, 0x61, 0x32, 0xe6, 0xff, 0x58, 0x82, 0x85, 0x3d, + 0xe6, 0x80, 0x76, 0xf5, 0x87, 0xf0, 0x60, 0xb8, 0x61, 0x32, 0xe6, 0xff, 0x50, 0x82, 0x85, 0x3d, 0x4c, 0x0d, 0xeb, 0x72, 0xab, 0x6b, 0x79, 0x67, 0xe3, 0x00, 0x17, 0xee, 0xc3, 0xf5, 0x8e, 0x4f, 0x7a, 0x66, 0x02, 0x61, 0xa8, 0x1a, 0x35, 0x46, 0x8c, 0x5e, 0xa9, 0x6b, 0x30, 0x4b, 0x89, 0x99, 0x78, 0xe7, 0x56, 0x0d, 0xa0, 0x24, 0x64, 0xd0, 0xff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 0xb4, 0xbc, 0xae, 0x94, 0xb0, 0xcf, 0xe0, 0x46, 0xb2, 0xf0, 0x88, 0x56, 0xa3, 0x67, 0x5a, 0x5e, + 0x21, 0x54, 0xbb, 0x53, 0xd4, 0x9d, 0x15, 0x9c, 0xac, 0x02, 0x2a, 0xc1, 0xb9, 0x05, 0x47, 0x25, + 0x38, 0xbf, 0x78, 0x18, 0x09, 0xb6, 0x01, 0x65, 0xab, 0x77, 0x28, 0xf2, 0x5f, 0x61, 0x31, 0x51, + 0xd3, 0x87, 0xb1, 0xa4, 0x94, 0x1c, 0xc2, 0x6c, 0xac, 0x84, 0x85, 0x22, 0x4f, 0x66, 0x0b, 0x83, + 0xda, 0xed, 0xdc, 0xbe, 0x94, 0xbc, 0x2f, 0xa0, 0x9e, 0x4e, 0x56, 0x54, 0xd0, 0x15, 0x54, 0xc5, + 0x54, 0xd0, 0x15, 0x56, 0xb8, 0x42, 0xf1, 0xaf, 0x00, 0x54, 0x85, 0x47, 0x85, 0x44, 0xa6, 0xc4, + 0xa4, 0x42, 0x22, 0x5b, 0x10, 0x0a, 0x85, 0x3d, 0xe5, 0xd6, 0xa6, 0x2b, 0x36, 0xca, 0xda, 0x82, + 0x02, 0x91, 0xb2, 0xb6, 0xa8, 0xd8, 0x13, 0xdf, 0x22, 0x99, 0x12, 0x88, 0xda, 0x22, 0x45, 0x85, + 0x1f, 0xb5, 0x45, 0x0a, 0xeb, 0x27, 0x91, 0x3f, 0x7e, 0x02, 0x53, 0xbb, 0x81, 0x7d, 0x8e, 0xe6, + 0xa3, 0x21, 0xaa, 0x7a, 0xa2, 0x2d, 0x24, 0x89, 0xa9, 0xa1, 0x3b, 0x50, 0x09, 0x0b, 0x08, 0x68, + 0x29, 0xe4, 0x4c, 0x15, 0x43, 0xb4, 0x46, 0xb6, 0x23, 0x25, 0xe6, 0x14, 0xae, 0x27, 0xd0, 0x7f, + 0xb4, 0x12, 0x69, 0xcd, 0x29, 0x42, 0x68, 0xab, 0x05, 0xbd, 0x29, 0xcf, 0xbd, 0x00, 0x50, 0xa8, + 0xbc, 0x5a, 0xe7, 0x4c, 0xe5, 0x40, 0xad, 0x73, 0x0e, 0x88, 0x1f, 0xdb, 0x48, 0x59, 0x60, 0x5d, + 0x6d, 0xa4, 0x42, 0xa0, 0x5f, 0x6d, 0xa4, 0x62, 0x5c, 0x3e, 0xb2, 0x98, 0x2b, 0x49, 0x43, 0xe1, + 0x71, 0x25, 0x05, 0xd0, 0x7c, 0x5c, 0x49, 0x11, 0x92, 0x1e, 0x29, 0xf1, 0xb3, 0x95, 0x65, 0x09, + 0x61, 0xa3, 0x87, 0x45, 0x7b, 0x28, 0x89, 0xa8, 0x6b, 0xef, 0xfe, 0x20, 0x5f, 0xca, 0x7b, 0x27, + 0x50, 0x8b, 0x43, 0xd8, 0xe8, 0x76, 0x52, 0x40, 0x02, 0xeb, 0xd3, 0x56, 0xf2, 0x3b, 0x93, 0xd3, + 0x78, 0x5a, 0x42, 0xbf, 0x01, 0xad, 0x18, 0xc5, 0x43, 0xef, 0x0d, 0xb3, 0x31, 0xa9, 0xf0, 0xfd, + 0xb7, 0x61, 0x4d, 0xce, 0xe8, 0x51, 0x09, 0xed, 0x43, 0x35, 0x42, 0x96, 0x51, 0xa3, 0x08, 0x17, + 0xd7, 0x96, 0x73, 0x7a, 0x52, 0xde, 0xf9, 0x04, 0x6a, 0x71, 0xa4, 0x58, 0x79, 0x27, 0x07, 0xa4, + 0x56, 0xde, 0xc9, 0x05, 0x97, 0xe3, 0x47, 0xb2, 0xc2, 0x1a, 0x63, 0x47, 0x72, 0x06, 0xd0, 0x8c, + 0x1d, 0xc9, 0x59, 0x70, 0x32, 0x0a, 0x9a, 0x16, 0xff, 0x39, 0x20, 0x09, 0x10, 0xa2, 0x78, 0x75, + 0x3e, 0x17, 0x91, 0x54, 0xa7, 0x50, 0x21, 0xba, 0x18, 0x5b, 0xcf, 0x2f, 0x61, 0x2e, 0x83, 0xf8, + 0x29, 0x1d, 0x45, 0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0x0f, 0xb1, 0xa5, 0xb6, 0xf6, + 0x29, 0x5c, 0x4f, 0xe4, 0xab, 0x2a, 0x80, 0xf3, 0x50, 0x04, 0x15, 0xc0, 0xf9, 0x19, 0x7c, 0x38, + 0x0d, 0x37, 0x95, 0xe2, 0x87, 0x59, 0x30, 0x7a, 0x90, 0x3b, 0x3e, 0x95, 0xe7, 0x6b, 0xef, 0xfc, + 0x00, 0x57, 0xf6, 0xdd, 0x9b, 0xce, 0x7e, 0xe3, 0xc9, 0x56, 0x6e, 0xb2, 0x1d, 0x4f, 0xb6, 0x0a, + 0x12, 0xe7, 0x84, 0xf8, 0x64, 0x1a, 0x1b, 0x17, 0x9f, 0x9b, 0x5a, 0xc7, 0xc5, 0x17, 0x64, 0xc0, + 0xa1, 0xf8, 0x0e, 0xcc, 0xe7, 0xe4, 0x97, 0x28, 0x16, 0xf7, 0x45, 0x59, 0xb2, 0x76, 0x7f, 0x28, + 0x4f, 0x52, 0x4f, 0xf3, 0xe9, 0x6b, 0xc6, 0xed, 0x5a, 0xad, 0x75, 0x9b, 0xf4, 0x9e, 0x88, 0xcf, + 0x0f, 0x89, 0x7f, 0xf6, 0x44, 0xc8, 0x78, 0xc2, 0xff, 0x10, 0x7e, 0x72, 0x46, 0x64, 0xbb, 0xdf, + 0x6a, 0xcd, 0x70, 0xd2, 0xb3, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xf1, 0xec, 0xff, 0x72, 0x2c, 0x00, 0x00, } diff --git a/proto/repository-service.proto b/proto/repository-service.proto index 62e774127..dec8f20e7 100644 --- a/proto/repository-service.proto +++ b/proto/repository-service.proto @@ -602,6 +602,7 @@ message RenameRepositoryResponse{ message ReplicateRepositoryRequest { Repository repository = 1 [(target_repository)=true]; Repository source = 2; + bool skip_checksum = 3; } message ReplicateRepositoryResponse{} diff --git a/ruby/proto/gitaly/repository-service_pb.rb b/ruby/proto/gitaly/repository-service_pb.rb index cfec493d6..fe9068289 100644 --- a/ruby/proto/gitaly/repository-service_pb.rb +++ b/ruby/proto/gitaly/repository-service_pb.rb @@ -313,6 +313,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do add_message "gitaly.ReplicateRepositoryRequest" do optional :repository, :message, 1, "gitaly.Repository" optional :source, :message, 2, "gitaly.Repository" + optional :skip_checksum, :bool, 3 end add_message "gitaly.ReplicateRepositoryResponse" do end |