From 3f0f1f8f092f3ea97e2173ce32ac5d9d84a7e821 Mon Sep 17 00:00:00 2001 From: Derek Su Date: Mon, 28 Nov 2022 13:48:18 +0800 Subject: [PATCH] rebuilding speedup: update proxy api Longhorn 4783 Signed-off-by: Derek Su --- pkg/client/proxy_replica.go | 3 ++- pkg/proxy/replica.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/client/proxy_replica.go b/pkg/client/proxy_replica.go index cba5045c4..b3c60ac05 100644 --- a/pkg/client/proxy_replica.go +++ b/pkg/client/proxy_replica.go @@ -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, @@ -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 { diff --git a/pkg/proxy/replica.go b/pkg/proxy/replica.go index a3fb1ae6e..9cf1f310e 100644 --- a/pkg/proxy/replica.go +++ b/pkg/proxy/replica.go @@ -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) @@ -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 } }