Skip to content

Commit

Permalink
chore: remove EngineBackupRestoreFinish
Browse files Browse the repository at this point in the history
longhorn/longhorn-6613

Signed-off-by: Chin-Ya Huang <[email protected]>
  • Loading branch information
c3y1huang committed Aug 27, 2024
1 parent 8899774 commit 5526776
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
12 changes: 0 additions & 12 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 0 additions & 21 deletions pkg/spdk/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 5526776

Please sign in to comment.