Skip to content

Commit

Permalink
clickhouse-backup should not fail when --rbac used but rbac object is…
Browse files Browse the repository at this point in the history
… not present in backup, but it should log warnings/errors, look #793 for details
  • Loading branch information
Slach committed Dec 1, 2023
1 parent 50cf3bf commit cb0f2d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# v2.4.9
BUG FIXES
- fix list remote command date parsing for all `remote_storage: custom` integration examples
- clickhouse-backup should not fail when --rbac used but rbac object is not present in backup, but it should log warnings/errors, partial fix [793](https://github.com/Altinity/clickhouse-backup/issues/793)

# v2.4.8
BUG FIXES
Expand Down
7 changes: 6 additions & 1 deletion pkg/backup/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ func (b *Backuper) restoreRBAC(ctx context.Context, backupName string, disks []c
if err != nil && !os.IsNotExist(err) {
return err
}
if err = b.restoreRBACReplicated(ctx, backupName, "access"); err != nil {
if err != nil && os.IsNotExist(err) {
return nil
}
if err = b.restoreRBACReplicated(ctx, backupName, "access"); err != nil && !os.IsNotExist(err) {
return err
}
return nil
Expand All @@ -317,6 +320,7 @@ func (b *Backuper) restoreRBACReplicated(ctx context.Context, backupName string,
srcBackupDir := path.Join(b.DefaultDataPath, "backup", backupName, backupPrefixDir)
info, err := os.Stat(srcBackupDir)
if err != nil {
log.Warnf("stat: %s error: %v", srcBackupDir, err)
return err
}

Expand Down Expand Up @@ -378,6 +382,7 @@ func (b *Backuper) restoreBackupRelatedDir(backupName, backupPrefixDir, destinat
srcBackupDir := path.Join(b.DefaultDataPath, "backup", backupName, backupPrefixDir)
info, err := os.Stat(srcBackupDir)
if err != nil {
log.Warnf("stat: %s error: %v", srcBackupDir, err)
return err
}

Expand Down

0 comments on commit cb0f2d7

Please sign in to comment.