Skip to content

Commit

Permalink
upload will delete local backup if upload successful, fix #834
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Feb 16, 2024
1 parent e9428d1 commit 5ab0892
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# v2.4.31
IMPROVEMENTS
- add `check_sum_algorithm` parameter for `s3` config section with "" default value, to avoid useless CPU usage during upload to `S3` storage, additional fix [829](https://github.com/Altinity/clickhouse-backup/issues/829)
- `upload` will delete local backup if upload successful, fix [834](https://github.com/Altinity/clickhouse-backup/issues/834)

BUG FIXES
- fix miss checksum for CopyObject in `s3`, fix [835](https://github.com/Altinity/clickhouse-backup/issues/835), affected 2.4.30
- fix wrong behavior for `restore --rbac-only` and `restore --rbac` for backups which not contains any schema, fix [832](https://github.com/Altinity/clickhouse-backup/issues/832)

- fix wrong behavior for `restore --rbac-only` and `restore --rbac` for backups which not contains any schema, fix [832](https://github.com/Altinity/clickhouse-backup/issues/832)
# v2.4.30
BUG FIXES
- fix `download` command corner cases for increment backup for tables with projections, fix [830](https://github.com/Altinity/clickhouse-backup/issues/830)
Expand Down
4 changes: 0 additions & 4 deletions pkg/backup/create_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package backup

import (
"context"
"fmt"
"github.com/Altinity/clickhouse-backup/v2/pkg/status"
)

Expand All @@ -23,8 +22,5 @@ func (b *Backuper) CreateToRemote(backupName, diffFrom, diffFromRemote, tablePat
return err
}

if err := b.RemoveOldBackupsLocal(ctx, false, nil); err != nil {
return fmt.Errorf("can't remove old local backups: %v", err)
}
return nil
}
5 changes: 5 additions & 0 deletions pkg/backup/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ func (b *Backuper) Upload(backupName, diffFrom, diffFromRemote, tablePattern str
if err = b.RemoveOldBackupsRemote(ctx); err != nil {
return fmt.Errorf("can't remove old backups on remote storage: %v", err)
}
// fix https://github.com/Altinity/clickhouse-backup/issues/834
if err = b.RemoveOldBackupsLocal(ctx, false, nil); err != nil {
return fmt.Errorf("can't remove old local backups: %v", err)
}

return nil
}

Expand Down

0 comments on commit 5ab0892

Please sign in to comment.