Quiesce ClickHouse consumers during deploy CDC setup - #1330
Conversation
Production deploys failed when Configure ClickHouse CDC ran while analytics-worker and the metric-stream sink were already loading ClickHouse near its memory cap. Use a temporary Swarm overlay to keep those services at zero replicas through CDC setup, then redeploy the full stack. Co-authored-by: Cursor <cursoragent@cursor.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
📝 WalkthroughWalkthroughThe PR introduces a two-phase Docker Swarm deployment around ClickHouse CDC setup. A new compose overlay ( ChangesTwo-phase CDC-aware Docker Swarm deploy
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
Storybook previews for This comment updates automatically on each PR push. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.github/workflows/deploy-web-stack.yml:
- Around line 742-750: The paused service update case in the shell script is
using warn-and-continue behavior that masks failed rollouts. Instead of logging
a warning and continuing when the service update is paused but has running
tasks, treat the paused state as a failure condition and exit with error. Remove
the warning message and continue logic, and ensure that any paused service
update state causes the deployment to fail with an error message, consistent
with the guideline to not use warn-and-continue behavior that masks failures.
- Line 701: The restore deploy step is currently gated to only run when the
deploy_stack_quiesced step succeeds. This causes the restore phase to be skipped
if the quiesce step partially applies changes (like scaling down consumers) and
then fails during convergence checks, leaving services at zero replicas. Remove
or modify the condition on line 701 that checks for
deploy_stack_quiesced.outcome == 'success' to allow the restore deploy to always
run regardless of the quiesce step's outcome, ensuring the stack is always
returned to canonical service levels even when the quiesce step fails after
partial application.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d2e203f6-c03a-49a1-a1a3-008a2a394bfc
📒 Files selected for processing (2)
.github/workflows/deploy-web-stack.ymldeploy/stack.cdc-quiesce.yml
Run the consumer restore deploy whenever the quiesced deploy step ran, even if it failed, so analytics-worker is not left at zero replicas. Fail the final convergence loop on paused Swarm updates instead of warning and continuing. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Production deploy run 27889116821 failed at Configure ClickHouse CDC because ClickHouse was already at its memory cap while analytics-worker and the metric-stream sink were running. This adds a two-phase Swarm deploy: first apply
deploy/stack.cdc-quiesce.ymlto keep those services at zero replicas, run CDC setup, then redeploy the full stack to restore them. The full-stack redeploy still runs if CDC fails so analytics-worker is not left paused.Test plan
Made with Cursor
Summary by cubic
Quiesces ClickHouse consumers during deploy so CDC setup runs safely and avoids memory-cap failures. First deploy uses
deploy/stack.cdc-quiesce.ymlto pause consumers, runs CDC, then redeploys the full stack and waits for consumers to converge.deploy/stack.cdc-quiesce.ymlto setanalytics-workerandmetric-stream-clickhouse-sinkreplicas to 0; validate both the base stack and the overlay.analytics-workerandmetric-stream-clickhouse-sinkto converge.Written for commit 5e96618. Summary will update on new commits.
Summary by CodeRabbit