Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/connectors/db/process_result_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func ReadOperationFromResultSet(res query.Row) (types.Operation, error) {
updatedTs = timestamppb.New(*updatedAt)
}

if operationType == string(types.OperationTypeTB) {
if operationType == string(types.LegacyOperationTypeTB) || operationType == string(types.OperationTypeTB) {
if backupId == nil {
return nil, fmt.Errorf("failed to read backup_id for TB operation: %s", operationId)
}
Expand All @@ -230,7 +230,7 @@ func ReadOperationFromResultSet(res query.Row) (types.Operation, error) {
UpdatedAt: updatedTs,
ParentOperationID: parentOperationID,
}, nil
} else if operationType == string(types.OperationTypeRB) {
} else if operationType == string(types.LegacyOperationTypeRB) || operationType == string(types.OperationTypeRB) {
if backupId == nil {
return nil, fmt.Errorf("failed to read backup_id for RB operation: %s", operationId)
}
Expand All @@ -249,7 +249,7 @@ func ReadOperationFromResultSet(res query.Row) (types.Operation, error) {
Audit: auditFromDb(creator, createdAt, completedAt),
UpdatedAt: updatedTs,
}, nil
} else if operationType == string(types.OperationTypeDB) {
} else if operationType == string(types.LegacyOperationTypeDB) || operationType == string(types.OperationTypeDB) {
if backupId == nil {
return nil, fmt.Errorf("failed to read backup_id for DB operation: %s", operationId)
}
Expand All @@ -273,7 +273,7 @@ func ReadOperationFromResultSet(res query.Row) (types.Operation, error) {
PathPrefix: pathPrefix,
UpdatedAt: updatedTs,
}, nil
} else if operationType == string(types.OperationTypeTBWR) {
} else if operationType == string(types.LegacyOperationTypeTBWR) || operationType == string(types.OperationTypeTBWR) {
var retryConfig *pb.RetryConfig = nil
if maxBackoff != nil {
retryConfig = &pb.RetryConfig{
Expand Down
4 changes: 2 additions & 2 deletions internal/connectors/db/yql/queries/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ UPSERT INTO Operations (id, type, status, message, initiated, created_at, contai
),

table.ValueParam("$id_1", table_types.StringValueFromString(opId)),
table.ValueParam("$type_1", table_types.StringValueFromString("TB")),
table.ValueParam("$type_1", table_types.StringValueFromString(types.OperationTypeTB.String())),
table.ValueParam(
"$status_1", table_types.StringValueFromString(string(tbOp.State)),
),
Expand Down Expand Up @@ -209,7 +209,7 @@ UPSERT INTO Operations (id, type, status, message, initiated, created_at, contai
table.ValueParam("$message_0", table_types.StringValueFromString("Success")),
table.ValueParam("$expire_at_0", table_types.NullableTimestampValueFromTime(nil)),
table.ValueParam("$id_1", table_types.StringValueFromString(opId)),
table.ValueParam("$type_1", table_types.StringValueFromString("TB")),
table.ValueParam("$type_1", table_types.StringValueFromString(types.OperationTypeTB.String())),
table.ValueParam(
"$status_1", table_types.StringValueFromString(string(tbOp.State)),
),
Expand Down
17 changes: 13 additions & 4 deletions internal/types/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,20 @@ var (
OperationStateStartCancelling = OperationState(pb.Operation_START_CANCELLING.String())
)

// Deprecated: these short operation type names are unclear and will be removed in the future. Use full names instead.
const (
OperationTypeTB = OperationType("TB")
OperationTypeRB = OperationType("RB")
OperationTypeDB = OperationType("DB")
OperationTypeTBWR = OperationType("TBWR")
LegacyOperationTypeTB = OperationType("TB")
LegacyOperationTypeRB = OperationType("RB")
LegacyOperationTypeDB = OperationType("DB")
LegacyOperationTypeTBWR = OperationType("TBWR")
)

const (
OperationTypeTB = OperationType("TakeBackup")
OperationTypeRB = OperationType("RestoreBackup")
OperationTypeDB = OperationType("DeleteBackup")
OperationTypeTBWR = OperationType("TakeBackupWithRetries")

BackupTimestampFormat = "20060102_150405"
OperationCreatorName = "ydbcp"
)
Expand Down
Loading