docs: add ClickHouse backup and restore guide#761
Conversation
Document the validated clickhouse-backup sidecar workflow so operators can back up and restore ClickHouse data with S3-compatible storage. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a detailed, end-to-end guide for backing up and restoring ClickHouse on ACP 4.3.x using a clickhouse-backup sidecar with S3-compatible storage, including manifests, manual and automated backup/restore workflows, verification commands, troubleshooting, and validation notes. ChangesClickHouse Backup and Restore Guide
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
docs/en/solutions/How_to_Backup_and_Restore_ClickHouse_with_clickhouse_backup.md (2)
108-109: 💤 Low valueConsider documenting when ALLOW_EMPTY_BACKUPS should be enabled.
Setting
ALLOW_EMPTY_BACKUPS: "true"allows backups to succeed even when no data is present. This can be useful for initial setup or testing, but may mask configuration issues in production where data is expected. Consider adding a note about when this setting should be enabled versus disabled.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/en/solutions/How_to_Backup_and_Restore_ClickHouse_with_clickhouse_backup.md` around lines 108 - 109, Add a brief explanatory note next to the ALLOW_EMPTY_BACKUPS environment variable describing when to enable it: state that ALLOW_EMPTY_BACKUPS="true" permits backups to succeed with no data (useful for initial setup, CI/testing, or templates), but that it can mask issues in production where data is expected and therefore should generally be false in production; update the documentation section that contains the ALLOW_EMPTY_BACKUPS YAML snippet and include this guidance and a recommendation to default to "false" for production environments.
460-460: 💤 Low valueClarify the file reference for the restore Job manifest.
Line 460 references
clickhouse-restore-job.yaml, but the YAML manifest in lines 416-455 was shown inline without a filename. For consistency with Step 5 (which showsclickhouse-backup-job.yamlon line 273), consider adding "Createclickhouse-restore-job.yaml." before the YAML block in Step 8.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/en/solutions/How_to_Backup_and_Restore_ClickHouse_with_clickhouse_backup.md` at line 460, Add an explicit filename heading before the inline restore Job manifest in Step 8 so it matches the later kubectl apply command: insert a short line like "Create `clickhouse-restore-job.yaml`." immediately before the YAML block that defines the restore Job (the manifest referenced by kubectl apply -f clickhouse-restore-job.yaml), mirroring the style used for `clickhouse-backup-job.yaml` in Step 5 to keep the documentation consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@docs/en/solutions/How_to_Backup_and_Restore_ClickHouse_with_clickhouse_backup.md`:
- Around line 132-133: Add a security note next to the S3_DISABLE_SSL
environment variable entry (S3_DISABLE_SSL) explaining that setting it to "true"
disables SSL and causes backups to be transmitted unencrypted, that this is
acceptable only for local testing or trusted isolated networks, and that in
production or across untrusted/external networks it should be set to "false" (or
omitted) and proper TLS configured; keep the note concise and position it
immediately after the S3_DISABLE_SSL value example so readers see the warning
inline with the configuration.
- Line 437: The YAML shows a placeholder value: `value: <backup-name>` which
must be replaced before applying; update the doc to instruct users to substitute
`<backup-name>` with the real backup name (e.g., from Step 4/5), and provide a
short example workflow such as saving the manifest as
`clickhouse-restore-job.yaml` and replacing the placeholder either manually,
with `sed` (e.g., `sed -i 's/<backup-name>/$BACKUP_NAME/'
clickhouse-restore-job.yaml`), or by demonstrating environment variable
substitution (set `BACKUP_NAME` and use `${BACKUP_NAME}` for the
`RESTORE_BACKUP` env entry) so users can apply the manifest safely.
- Around line 126-129: Replace the plain-text env vars S3_ACCESS_KEY and
S3_SECRET_KEY with references to a Kubernetes Secret: create a Secret (e.g.,
clickhouse-s3-creds) containing the access and secret keys and update the
Deployment/Pod manifest to use valueFrom.secretKeyRef for S3_ACCESS_KEY and
S3_SECRET_KEY so credentials are pulled from the Secret rather than hardcoded in
the manifest.
---
Nitpick comments:
In
`@docs/en/solutions/How_to_Backup_and_Restore_ClickHouse_with_clickhouse_backup.md`:
- Around line 108-109: Add a brief explanatory note next to the
ALLOW_EMPTY_BACKUPS environment variable describing when to enable it: state
that ALLOW_EMPTY_BACKUPS="true" permits backups to succeed with no data (useful
for initial setup, CI/testing, or templates), but that it can mask issues in
production where data is expected and therefore should generally be false in
production; update the documentation section that contains the
ALLOW_EMPTY_BACKUPS YAML snippet and include this guidance and a recommendation
to default to "false" for production environments.
- Line 460: Add an explicit filename heading before the inline restore Job
manifest in Step 8 so it matches the later kubectl apply command: insert a short
line like "Create `clickhouse-restore-job.yaml`." immediately before the YAML
block that defines the restore Job (the manifest referenced by kubectl apply -f
clickhouse-restore-job.yaml), mirroring the style used for
`clickhouse-backup-job.yaml` in Step 5 to keep the documentation consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 737f22f4-b743-4542-a9f6-38515caff187
📒 Files selected for processing (1)
docs/en/solutions/How_to_Backup_and_Restore_ClickHouse_with_clickhouse_backup.md
Align the article with the knowledge base How To template by replacing solution-specific sections with Purpose, Resolution, Troubleshooting, and Related Information. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Use placeholders for resource names and namespaces, move S3 credentials into a Secret reference, and clarify backup and restore configuration notes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Use environment-variable templates for the ClickHouse backup manifests so users can render them directly while preserving runtime variables inside Job scripts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
clickhouse-backupas a sidecar./var/lib/clickhousedata volume requirement to avoid metadata-only backups.Test plan
clickhouse-backup create_remoteuploads metadata and MergeTree data part archives to S3-compatible storage.system.backup_actionscan triggercreate_remote <backup-name>.clickhouse-backup restore_remote <backup-name>restores data into a separate ClickHouseInstallation.events_localandeventstables both return1000rows.🤖 Generated with Claude Code
Summary by CodeRabbit