Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e9b58ad

Browse files
author
Andrew Cai
committedSep 30, 2020
[YW][#5890] Fix nested backup info to include the destination universe in the event of restoring cross-universe.
Summary: When restoring to a universe we check the universeUUID of the backupInfo object but universe backups contain nested backupInfo, so the fix is to update the nested objects to match the parent universeUUID. Test Plan: Create universe backup and then try restoring to a different universe from the Backups tabs and selecting a specific backup from the table action. Reviewers: sanketh, arnav Reviewed By: arnav Subscribers: jenkins-bot, yugaware Differential Revision: https://phabricator.dev.yugabyte.com/D9514
1 parent 1c6c113 commit e9b58ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎managed/src/main/java/com/yugabyte/yw/controllers/BackupsController.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ public Result restore(UUID customerUUID, UUID universeUUID) {
6767
return ApiResponse.error(BAD_REQUEST, errMsg);
6868
}
6969

70+
taskParams.universeUUID = universeUUID;
71+
7072
// Change the BackupTableParams in list to be "RESTORE" action type
7173
if (taskParams.backupList != null) {
7274
for (BackupTableParams subParams: taskParams.backupList) {
@@ -78,6 +80,7 @@ public Result restore(UUID customerUUID, UUID universeUUID) {
7880
subParams.tableUUID = null;
7981
subParams.tableName = null;
8082
subParams.keyspace = null;
83+
subParams.universeUUID = universeUUID;
8184
subParams.parallelism = taskParams.parallelism;;
8285
}
8386
}
@@ -91,8 +94,6 @@ public Result restore(UUID customerUUID, UUID universeUUID) {
9194
return ApiResponse.error(BAD_REQUEST, errMsg);
9295
}
9396

94-
taskParams.universeUUID = universeUUID;
95-
9697
Backup newBackup = Backup.create(customerUUID, taskParams);
9798
UUID taskUUID = commissioner.submit(TaskType.BackupUniverse, taskParams);
9899
LOG.info("Submitted task to restore table backup to {}.{}, task uuid = {}.",

0 commit comments

Comments
 (0)
Please sign in to comment.