Skip to content

Commit

Permalink
fix corner case for backup/restore RBAC object with trailing slash, w…
Browse files Browse the repository at this point in the history
…arn /clickhouse/access//uuid have no children, skip Dump
  • Loading branch information
Slach committed Aug 13, 2024
1 parent 71000c8 commit 862b736
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.5.29
BUG FIXES
- fix corner case for backup/restore RBAC object with trailing slash, warn /clickhouse/access//uuid have no children, skip Dump

# v2.5.28
BUG FIXES
- fix corner cases for wrong *_last* metrics calculation after restart, fix [980](https://github.com/Altinity/clickhouse-backup/issues/980)
Expand Down
2 changes: 1 addition & 1 deletion pkg/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ func (b *Backuper) createBackupRBACReplicated(ctx context.Context, rbacBackup st
return 0, err
}
if rbacUUIDObjectsCount == 0 {
log.Warn().Str("logger", "createBackupRBACReplicated").Msgf("%s/%s have no childs, skip Dump", replicatedAccessPath, "uuid")
log.Warn().Str("logger", "createBackupRBACReplicated").Msgf("%s/%s have no children, skip Dump", replicatedAccessPath, "uuid")
continue
}
if err = os.MkdirAll(rbacBackup, 0755); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (k *Keeper) GetReplicatedAccessPath(userDirectory string) (string, error) {
if zookeeperPathNode == nil {
return "", fmt.Errorf("can't find %s in %s", xPathQuery, k.xmlConfigFile)
}
return zookeeperPathNode.InnerText(), nil
return strings.TrimSuffix(zookeeperPathNode.InnerText(), "/"), nil
}

func (k *Keeper) Dump(prefix, dumpFile string) (int, error) {
Expand Down

0 comments on commit 862b736

Please sign in to comment.