[#1333] services/control: Allow to synchronize local trees

Do not check that a node indeed belongs to the container, because the
synchronization will fail in this case anyway.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-05-16 19:31:50 +03:00 committed by fyrchik
parent 0dc1a4e336
commit bfdd68dcb3
13 changed files with 836 additions and 180 deletions

View file

@ -16,6 +16,7 @@ const (
rpcSetShardMode = "SetShardMode"
rpcDumpShard = "DumpShard"
rpcRestoreShard = "RestoreShard"
rpcSynchronizeTree = "SynchronizeTree"
)
// HealthCheck executes ControlService.HealthCheck RPC.
@ -172,3 +173,16 @@ func RestoreShard(cli *client.Client, req *RestoreShardRequest, opts ...client.C
return wResp.RestoreShardResponse, nil
}
// SynchronizeTree executes ControlService.SynchronizeTree RPC.
func SynchronizeTree(cli *client.Client, req *SynchronizeTreeRequest, opts ...client.CallOption) (*SynchronizeTreeResponse, error) {
wResp := &synchronizeTreeResponseWrapper{new(SynchronizeTreeResponse)}
wReq := &requestWrapper{m: req}
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceName, rpcSynchronizeTree), wReq, wResp, opts...)
if err != nil {
return nil, err
}
return wResp.SynchronizeTreeResponse, nil
}