Skip to content

Commit

Permalink
fix wrong behavior for restore --rbac-only and restore --rbac for…
Browse files Browse the repository at this point in the history
… backups which not contains any schema, fix #832
  • Loading branch information
Slach committed Feb 16, 2024
1 parent 6b377d5 commit e9428d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# 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)
- 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)

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)

# v2.4.30
BUG FIXES
Expand Down
9 changes: 8 additions & 1 deletion test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,14 @@ func TestDoRestoreRBAC(t *testing.T) {
log.Info("download+restore RBAC")
r.NoError(dockerExec("clickhouse", "ls", "-lah", "/var/lib/clickhouse/access"))
r.NoError(dockerExec("clickhouse-backup", "bash", "-xec", "ALLOW_EMPTY_BACKUPS=1 CLICKHOUSE_BACKUP_CONFIG=/etc/clickhouse-backup/config-s3.yml clickhouse-backup download test_rbac_backup"))
r.NoError(dockerExec("clickhouse-backup", "clickhouse-backup", "-c", "/etc/clickhouse-backup/config-s3.yml", "restore", "--rm", "--rbac", "--rbac-only", "test_rbac_backup"))

out, err := dockerExecOut("clickhouse-backup", "bash", "-xec", "ALLOW_EMPTY_BACKUPS=1 clickhouse-backup -c /etc/clickhouse-backup/config-s3.yml restore --rm --rbac test_rbac_backup")
r.Contains(out, "RBAC successfully restored")
r.NoError(err)

out, err = dockerExecOut("clickhouse-backup", "bash", "-xec", "ALLOW_EMPTY_BACKUPS=1 clickhouse-backup -c /etc/clickhouse-backup/config-s3.yml restore --rm --rbac-only test_rbac_backup")
r.Contains(out, "RBAC successfully restored")
r.NoError(err)
r.NoError(dockerExec("clickhouse", "ls", "-lah", "/var/lib/clickhouse/access"))

ch.chbackend.Close()
Expand Down

0 comments on commit e9428d1

Please sign in to comment.