Skip to content

Commit 8accf0d

Browse files
refactor(backup_service): remove destination_prefix field from MakeRestoreRequest (#175)
1 parent 1bc2a12 commit 8accf0d

File tree

4 files changed

+62
-84
lines changed

4 files changed

+62
-84
lines changed

cmd/integration/make_backup/main.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,11 @@ func main() {
600600

601601
restoreOperation, err := client.MakeRestore(
602602
context.Background(), &pb.MakeRestoreRequest{
603-
ContainerId: containerID,
604-
BackupId: backupOperation.BackupId,
605-
DatabaseName: databaseName,
606-
DatabaseEndpoint: databaseEndpoint,
607-
DestinationPrefix: "/tmp",
603+
ContainerId: containerID,
604+
BackupId: backupOperation.BackupId,
605+
DatabaseName: databaseName,
606+
DatabaseEndpoint: databaseEndpoint,
607+
DestinationPath: "/tmp",
608608
},
609609
)
610610
if err != nil {
@@ -632,12 +632,12 @@ func main() {
632632

633633
partialRestoreOperation, err := client.MakeRestore(
634634
context.Background(), &pb.MakeRestoreRequest{
635-
ContainerId: containerID,
636-
BackupId: backupOperation.BackupId,
637-
DatabaseName: databaseName,
638-
DatabaseEndpoint: databaseEndpoint,
639-
DestinationPrefix: "/partial_restore",
640-
SourcePaths: []string{"kv_test"},
635+
ContainerId: containerID,
636+
BackupId: backupOperation.BackupId,
637+
DatabaseName: databaseName,
638+
DatabaseEndpoint: databaseEndpoint,
639+
DestinationPath: "/partial_restore",
640+
SourcePaths: []string{"kv_test"},
641641
},
642642
)
643643
if err != nil {

internal/server/services/backup/backup_service.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,6 @@ func (s *BackupService) MakeRestore(ctx context.Context, req *pb.MakeRestoreRequ
376376
sourcePaths[fullPath] = true
377377
}
378378

379-
// TODO: remove this code after full migration to DestinationPath
380-
destinationPath := req.GetDestinationPath()
381-
if len(destinationPath) == 0 {
382-
destinationPath = req.GetDestinationPrefix()
383-
}
384-
385379
s3Settings := types.ImportSettings{
386380
Endpoint: s.s3.Endpoint,
387381
Region: s.s3.Region,
@@ -394,7 +388,7 @@ func (s *BackupService) MakeRestore(ctx context.Context, req *pb.MakeRestoreRequ
394388
BucketDbRoot: backup.S3PathPrefix,
395389
SourcePaths: sourcePaths,
396390
S3ForcePathStyle: s.s3.S3ForcePathStyle,
397-
DestinationPath: destinationPath,
391+
DestinationPath: req.GetDestinationPath(),
398392
}
399393

400394
clientOperationID, err := s.clientConn.ImportFromS3(ctx, clientDriver, s3Settings, s.featureFlags)
@@ -421,7 +415,7 @@ func (s *BackupService) MakeRestore(ctx context.Context, req *pb.MakeRestoreRequ
421415
Creator: subject,
422416
},
423417
SourcePaths: req.GetSourcePaths(),
424-
DestinationPath: destinationPath,
418+
DestinationPath: req.GetDestinationPath(),
425419
UpdatedAt: now,
426420
}
427421

pkg/proto/ydbcp/v1alpha1/backup_service.pb.go

Lines changed: 48 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/proto/ydbcp/v1alpha1/backup_service.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ message MakeRestoreRequest {
111111
string database_name = 3;
112112
// GRPC endpoint of the database.
113113
string database_endpoint = 4;
114-
// The prefix for the destination path.
115-
string destination_prefix = 5 [deprecated = true];
114+
reserved 5;
116115
// Paths to s3 objects to restore.
117116
repeated string source_paths = 6;
118117
// Destination path to restore paths inside database,

0 commit comments

Comments
 (0)