Skip to content

Commit cca0104

Browse files
shuo-wuderekbit
authored andcommitted
feat: pass DstReplicaSrcReplicaPairMap in proxy SnapshotClone
And bump proxy API version to 7 Longhorn 12552 Signed-off-by: Shuo Wu <shuo.wu@suse.com>
1 parent afb7d6e commit cca0104

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

pkg/client/proxy_snapshot.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func (c *ProxyClient) SnapshotList(dataEngine, engineName, volumeName,
133133

134134
func (c *ProxyClient) SnapshotClone(dataEngine, engineName, volumeName, serviceAddress,
135135
snapshotName, fromEngineAddress, fromVolumeName, fromEngineName string, fileSyncHTTPClientTimeout int,
136-
grpcTimeoutSeconds int64, cloneMode string) (err error) {
136+
grpcTimeoutSeconds int64, cloneMode string, dstReplicaSrcReplicaPairMap map[string]string) (err error) {
137137
input := map[string]string{
138138
"engineName": engineName,
139139
"volumeName": volumeName,
@@ -166,14 +166,15 @@ func (c *ProxyClient) SnapshotClone(dataEngine, engineName, volumeName, serviceA
166166
DataEngine: rpc.DataEngine(driver),
167167
VolumeName: volumeName,
168168
},
169-
FromEngineAddress: fromEngineAddress,
170-
SnapshotName: snapshotName,
171-
ExportBackingImageIfExist: false,
172-
FileSyncHttpClientTimeout: int32(fileSyncHTTPClientTimeout),
173-
FromEngineName: fromEngineName,
174-
FromVolumeName: fromVolumeName,
175-
GrpcTimeoutSeconds: grpcTimeoutSeconds,
176-
CloneMode: getCloneMode(cloneMode),
169+
FromEngineAddress: fromEngineAddress,
170+
SnapshotName: snapshotName,
171+
ExportBackingImageIfExist: false,
172+
FileSyncHttpClientTimeout: int32(fileSyncHTTPClientTimeout),
173+
FromEngineName: fromEngineName,
174+
FromVolumeName: fromVolumeName,
175+
GrpcTimeoutSeconds: grpcTimeoutSeconds,
176+
CloneMode: getCloneMode(cloneMode),
177+
DstReplicaSrcReplicaPairMap: dstReplicaSrcReplicaPairMap,
177178
}
178179
ctx, cancel := getContextWithGRPCLongTimeout(c.ctx, grpcTimeoutSeconds)
179180
defer cancel()

pkg/meta/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const (
66
InstanceManagerAPIMinVersion = 1
77

88
// InstanceManagerProxyAPIVersion is used for compatibility check for longhorn-manager
9-
InstanceManagerProxyAPIVersion = 6
9+
InstanceManagerProxyAPIVersion = 7
1010
InstanceManagerProxyAPIMinVersion = 1
1111

1212
// InstanceManagerDiskServiceAPIVersion used to communicate with the user e.g. longhorn-manager

pkg/proxy/snapshot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (ops V2DataEngineProxyOps) SnapshotClone(ctx context.Context, req *rpc.Engi
290290
}
291291
}()
292292

293-
err = c.EngineSnapshotClone(req.ProxyEngineRequest.EngineName, req.SnapshotName, req.FromEngineName, req.FromEngineAddress, spdkrpc.CloneMode(req.CloneMode))
293+
err = c.EngineSnapshotClone(req.ProxyEngineRequest.EngineName, req.SnapshotName, req.FromEngineName, req.FromEngineAddress, spdkrpc.CloneMode(req.CloneMode), req.DstReplicaSrcReplicaPairMap)
294294
if err != nil {
295295
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to do clone snapshot %v: %v", req.SnapshotName, err)
296296
}

0 commit comments

Comments
 (0)