Skip to content

Commit

Permalink
Implement volume expansion for V2 data engine
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Dewes <aaron.dewes@protonmail.com>
  • Loading branch information
AaronDewes committed Feb 25, 2024
1 parent 92b0db5 commit 0a67bc8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions pkg/proxy/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,18 @@ func (ops V1DataEngineProxyOps) VolumeExpand(ctx context.Context, req *rpc.Engin
}

func (ops V2DataEngineProxyOps) VolumeExpand(ctx context.Context, req *rpc.EngineVolumeExpandRequest) (resp *emptypb.Empty, err error) {
// TODO: Implement this
return nil, grpcstatus.Errorf(grpccodes.Unimplemented, "not implemented")
c, err := getSPDKClientFromEngineAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
}
defer c.Close()

err = c.EngineVolumeResize(req.ProxyEngineRequest.EngineName, uint64(req.Expand.Size))
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get engine %v", req.ProxyEngineRequest.EngineName).Error())
}

return &emptypb.Empty{}, nil
}

func (p *Proxy) VolumeFrontendStart(ctx context.Context, req *rpc.EngineVolumeFrontendStartRequest) (resp *emptypb.Empty, err error) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0a67bc8

Please sign in to comment.