Skip to content

Commit

Permalink
fix 19.17 error can't freeze table: code: 218, message: Table is dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Jul 25, 2023
1 parent 44f2d13 commit 2ccaddf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func (b *Backuper) AddTableToBackup(ctx context.Context, backupName, shadowBacku
// Unfreeze to unlock data on S3 disks, https://github.com/Altinity/clickhouse-backup/issues/423
if version > 21004000 {
if err := b.ch.QueryContext(ctx, fmt.Sprintf("ALTER TABLE `%s`.`%s` UNFREEZE WITH NAME '%s'", table.Database, table.Name, shadowBackupUUID)); err != nil {
if (strings.Contains(err.Error(), "code: 60") || strings.Contains(err.Error(), "code: 81")) && b.cfg.ClickHouse.IgnoreNotExistsErrorDuringFreeze {
if (strings.Contains(err.Error(), "code: 60") || strings.Contains(err.Error(), "code: 81") || strings.Contains(err.Error(), "code: 218")) && b.cfg.ClickHouse.IgnoreNotExistsErrorDuringFreeze {
b.ch.Log.Warnf("can't unfreeze table: %v", err)
} else {
return disksToPartsMap, realSize, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ func (ch *ClickHouse) FreezeTable(ctx context.Context, table *Table, name string
}
query := fmt.Sprintf("ALTER TABLE `%s`.`%s` FREEZE %s;", table.Database, table.Name, withNameQuery)
if err := ch.QueryContext(ctx, query); err != nil {
if (strings.Contains(err.Error(), "code: 60") || strings.Contains(err.Error(), "code: 81")) && ch.Config.IgnoreNotExistsErrorDuringFreeze {
if (strings.Contains(err.Error(), "code: 60") || strings.Contains(err.Error(), "code: 81") || strings.Contains(err.Error(), "code: 218")) && ch.Config.IgnoreNotExistsErrorDuringFreeze {
ch.Log.Warnf("can't freeze table: %v", err)
return nil
}
Expand Down

0 comments on commit 2ccaddf

Please sign in to comment.