From 5526776cdeb3816962be9b46d2a2aebc6f9e354c Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Mon, 26 Aug 2024 10:29:30 +0800 Subject: [PATCH] chore: remove EngineBackupRestoreFinish longhorn/longhorn-6613 Signed-off-by: Chin-Ya Huang --- pkg/client/client.go | 12 ------------ pkg/spdk/server.go | 21 --------------------- 2 files changed, 33 deletions(-) diff --git a/pkg/client/client.go b/pkg/client/client.go index c6f88741..0c3f2bcc 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -860,18 +860,6 @@ func (c *SPDKClient) ReplicaBackupRestore(req *BackupRestoreRequest) error { return err } -func (c *SPDKClient) EngineBackupRestoreFinish(engineName string) error { - client := c.getSPDKServiceClient() - ctx, cancel := context.WithTimeout(context.Background(), GRPCServiceTimeout) - defer cancel() - - _, err := client.EngineBackupRestoreFinish(ctx, &spdkrpc.EngineBackupRestoreFinishRequest{ - EngineName: engineName, - }) - - return err -} - func (c *SPDKClient) EngineRestoreStatus(engineName string) (*spdkrpc.RestoreStatusResponse, error) { client := c.getSPDKServiceClient() ctx, cancel := context.WithTimeout(context.Background(), GRPCServiceTimeout) diff --git a/pkg/spdk/server.go b/pkg/spdk/server.go index ec7d01cf..13e185fa 100644 --- a/pkg/spdk/server.go +++ b/pkg/spdk/server.go @@ -1359,27 +1359,6 @@ func (s *Server) ReplicaBackupRestore(ctx context.Context, req *spdkrpc.ReplicaB return &emptypb.Empty{}, nil } -func (s *Server) EngineBackupRestoreFinish(ctx context.Context, req *spdkrpc.EngineBackupRestoreFinishRequest) (ret *emptypb.Empty, err error) { - logrus.WithFields(logrus.Fields{ - "engine": req.EngineName, - }).Info("Finishing backup restoration") - - s.RLock() - e := s.engineMap[req.EngineName] - s.RUnlock() - - if e == nil { - return nil, grpcstatus.Errorf(grpccodes.NotFound, "cannot find engine %v for finishing backup restoration", req.EngineName) - } - - err = e.BackupRestoreFinish(s.spdkClient) - if err != nil { - err = errors.Wrapf(err, "failed to finish backup restoration for engine %v", req.EngineName) - return nil, grpcstatus.Errorf(grpccodes.Internal, err.Error()) - } - return &emptypb.Empty{}, nil -} - func (s *Server) EngineRestoreStatus(ctx context.Context, req *spdkrpc.RestoreStatusRequest) (*spdkrpc.RestoreStatusResponse, error) { s.RLock() e := s.engineMap[req.EngineName]