Skip to content

Commit

Permalink
[BACKPORT 2.14.9][PLAT-8570]Don't provide table name list to yb_backu…
Browse files Browse the repository at this point in the history
…p during YCQL restore

Summary:
Removed code part which was adding `--table` parameter to yb_backup params.
Required because it fails on uneven table name list, and was mainly used for rename which is not supported now.

Test Plan: No tests

Reviewers: dkumar

Reviewed By: dkumar

Subscribers: jenkins-bot, yugaware

Differential Revision: https://phabricator.dev.yugabyte.com/D24823
  • Loading branch information
kv83821-yb committed Apr 26, 2023
1 parent 9f8a3b6 commit 0cbfb04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.yugabyte.yw.models.helpers.PlatformMetrics;
import com.yugabyte.yw.models.helpers.TaskType;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -317,7 +318,7 @@ public void run() {
tableBackupParams.useTablespaces = params().useTablespaces;
log.info("Task id {} for the backup {}", backup.taskUUID, backup.backupUUID);

for (BackupTableParams backupParams : backupParamsList) {
for (BackupTableParams backupParams : tableBackupParams.backupList) {
createEncryptedUniverseKeyBackupTask(backupParams)
.setSubTaskGroupType(UserTaskDetails.SubTaskGroupType.CreatingTableBackup);
}
Expand Down Expand Up @@ -345,7 +346,12 @@ public void run() {
} catch (CancellationException ce) {
log.error("Aborting backups for task: {}", userTaskUUID);
Backup.fetchAllBackupsByTaskUUID(userTaskUUID)
.forEach((backup) -> backup.transitionState(BackupState.Stopped));
.forEach(
backup -> {
backup.transitionState(BackupState.Stopped);
backup.setCompletionTime(new Date());
backup.save();
});
throw ce;
} catch (Throwable t) {
if (params().alterLoadBalancer) {
Expand All @@ -364,6 +370,15 @@ public void run() {
} catch (Throwable t) {
try {
log.error("Error executing task {} with error='{}'.", getName(), t.getMessage(), t);
Backup.fetchAllBackupsByTaskUUID(userTaskUUID)
.forEach(
backup -> {
if (backup.state.equals(BackupState.InProgress)) {
backup.transitionState(BackupState.Failed);
backup.setCompletionTime(new Date());
backup.save();
}
});
BACKUP_FAILURE_COUNTER.labels(metricLabelsBuilder.getPrometheusValues()).inc();
metricService.setFailureStatusMetric(
buildMetricTemplate(PlatformMetrics.CREATE_BACKUP_STATUS, universe));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ public ShellResponse runCommand(RestoreBackupParams restoreBackupParams) {
BackupStorageInfo backupStorageInfo = restoreBackupParams.backupStorageInfoList.get(0);
ActionType actionType = restoreBackupParams.actionType;
if (actionType.equals(ActionType.RESTORE)) {
if (backupStorageInfo.tableNameList != null) {
for (String tableName : backupStorageInfo.tableNameList) {
commandArgs.add("--table");
commandArgs.add(tableName);
}
}
if (backupStorageInfo.keyspace != null) {
commandArgs.add("--keyspace");
commandArgs.add(backupStorageInfo.keyspace);
Expand Down

0 comments on commit 0cbfb04

Please sign in to comment.