Skip to content

Commit

Permalink
rebuilding speedup: update proxy api
Browse files Browse the repository at this point in the history
Longhorn 4783

Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit authored and innobead committed Nov 30, 2022
1 parent 2a7d00f commit 3f0f1f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/client/proxy_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
eptypes "github.com/longhorn/longhorn-engine/proto/ptypes"
)

func (c *ProxyClient) ReplicaAdd(serviceAddress, replicaAddress string, restore bool, size, currentSize int64) (err error) {
func (c *ProxyClient) ReplicaAdd(serviceAddress, replicaAddress string, restore bool, size, currentSize int64, fastSync bool) (err error) {
input := map[string]string{
"serviceAddress": serviceAddress,
"replicaAddress": replicaAddress,
Expand All @@ -35,6 +35,7 @@ func (c *ProxyClient) ReplicaAdd(serviceAddress, replicaAddress string, restore
Restore: restore,
Size: size,
CurrentSize: currentSize,
FastSync: fastSync,
}
_, err = c.service.ReplicaAdd(getContextWithGRPCLongTimeout(c.ctx), req)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/proxy/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func (p *Proxy) ReplicaAdd(ctx context.Context, req *rpc.EngineReplicaAddRequest
"restore": req.Restore,
"size": req.Size,
"currentSize": req.CurrentSize,
"fastSync": req.FastSync,
})
log.Debugf("Adding replica %v", req.ReplicaAddress)

Expand All @@ -31,7 +32,7 @@ func (p *Proxy) ReplicaAdd(ctx context.Context, req *rpc.EngineReplicaAddRequest
return nil, err
}
} else {
if err := task.AddReplica(req.Size, req.CurrentSize, req.ReplicaAddress); err != nil {
if err := task.AddReplica(req.Size, req.CurrentSize, req.ReplicaAddress, req.FastSync); err != nil {
return nil, err
}
}
Expand Down

0 comments on commit 3f0f1f8

Please sign in to comment.