Skip to content

docs(dha): correct the stock-HPA motivation (topology, not victim selection) - #42

Merged
scooby87 merged 1 commit into
mainfrom
docs/dha-hpa-motivation-fix
Jul 23, 2026
Merged

docs(dha): correct the stock-HPA motivation (topology, not victim selection)#42
scooby87 merged 1 commit into
mainfrom
docs/dha-hpa-motivation-fix

Conversation

@scooby87

Copy link
Copy Markdown

What this changes

Corrects a factual error in the Database Horizontal Autoscaler design proposal's motivation. The text claimed a stock HorizontalPodAutoscaler "would happily remove a synchronous standby." That misattributes the mechanism: HPA only writes a replica count (for CloudNativePG that field is Cluster.spec.instances, not spec.replicas), and which instance to add or remove — and in what order — is the engine operator's decision. CNPG removes the highest-ordinal standby and never the primary; an autoscaler cannot express victim selection at all.

The corrected wording states the real reason a stock HPA does not fit: it is topology-blind. Nothing in HPA encodes the synchronous-commit quorum floor (maxSyncReplicas + 1), so it can drive the count below it — at which point the operator either rejects the change or loses its write quorum — and it has no gate on replication lag, scaling on the load metric alone while standbys are arbitrarily behind. This is exactly the split the proposed operator implements: it owns the count and the safety guardrails and leaves instance lifecycle to the engine operator.

The "fights Flux" clause is dropped from the HPA point; the accurate "a direct patch to the operator CR is reverted by Flux" note under the direct-patch alternative already covers that ground, so the design's rationale for writing through the apps API is not lost.

Prose-only change to design-proposals/database-horizontal-autoscaling/README.md; no code is affected.

…ection)

The motivation and the "Stock HPA + KEDA" alternative claimed HPA "would
happily remove a synchronous standby." That misattributes the mechanism:
HPA only writes a replica count (for CloudNativePG, Cluster.spec.instances,
not spec.replicas), and which instance to add or remove — and in what order
— is the engine operator's decision (CNPG removes the highest-ordinal
standby, never the primary).

Restate the real reason a stock HPA does not fit: it is topology-blind —
nothing encodes the synchronous-commit quorum floor (maxSyncReplicas + 1),
so it can drive the count below it, and there is no replication-lag gate.
The Flux argument is dropped from the HPA point; the accurate "a direct
patch to the operator CR is reverted by Flux" note under the direct-patch
alternative already covers that ground.

Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@scooby87, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4883721a-8b37-4b92-adb4-0628791df99f

📥 Commits

Reviewing files that changed from the base of the PR and between 8818336 and 324815a.

📒 Files selected for processing (1)
  • design-proposals/database-horizontal-autoscaling/README.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/dha-hpa-motivation-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@scooby87
scooby87 merged commit c484063 into main Jul 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants