Skip to content

Commit

Permalink
fix corner cases for ResumeOperationsAfterRestart and `keep_backup_…
Browse files Browse the repository at this point in the history
…local: -1` behavior
  • Loading branch information
Slach committed May 8, 2024
1 parent f46b452 commit 2ba936b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.5.8
BUG FIXES
- fix corner cases for `ResumeOperationsAfterRestart` and `keep_backup_local: -1` behavior

# v2.5.7
BUG FIXES
- wrong skip tables by engine when empty variables value `CLICKHOUSE_SKIP_TABLE_ENGINES=engine,` instead of `CLICKHOUSE_SKIP_TABLE_ENGINES=engine` fix [915](https://github.com/Altinity/clickhouse-backup/issues/915)
Expand Down
6 changes: 5 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1641,8 +1641,12 @@ func (api *APIServer) ResumeOperationsAfterRestart() error {
if err != nil {
return err
}

if err = os.Remove(stateFile); err != nil {
return err
if api.config.General.BackupsToKeepLocal >= 0 {
return err
}
api.log.WithField("operation", "ResumeOperationsAfterRestart").Warnf("remove %s return error: ", err)
}
default:
return fmt.Errorf("unkown command for state file %s", stateFile)
Expand Down

0 comments on commit 2ba936b

Please sign in to comment.