Skip to content

Keep a leader-eligible replica active per shard during managed rollig restart - #930

Draft
janhoy wants to merge 3 commits into
apache:mainfrom
janhoy:gh-922-leader-eligible-replica
Draft

janhoy wants to merge 3 commits into
apache:mainfrom
janhoy:gh-922-leader-eligible-replica

Conversation

@janhoy

@janhoy janhoy commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI Assisted

Fixes #922

  • maxShardReplicasUnavailable counted PULL replicas like NRT/TLOG, so a budget of 2+ (or a percentage) could take down every leader-eligible replica of a shard in one round.
  • Pod selection now tracks active NRT/TLOG replicas per shard and keeps at least one active when the shard has more than one.
  • Unchanged: a shard with a single NRT/TLOG replica (that pod must restart at some point), and maxShardReplicasUnavailable: 0.
  • Four existing TestPickPodsToUpgrade expectations changed: they selected the pod holding the last active TLOG replica of a PULL+TLOG+TLOG shard.

Tests:

  • make prepare, make build: OK, nothing regenerated
  • make test: ok controllers 124.349s, ok controllers/util 0.411s
  • make lint DOCS_LINT=, operator-check-docs, make check-git: OK
  • e2e not run

@janhoy
janhoy requested a balanced review from Copilot December 3, 2026 16:03
Generated-By: Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The restart guard can allow a pod hosting both active leader-eligible replicas to restart, leaving the shard without an active leader-eligible replica; the behavior needs correction or an explicit exception and regression coverage.

1 open issue
What changed in this PR

This PR addresses mixed-replica shard availability during managed rolling updates by tracking leader-eligible NRT/TLOG replicas separately from PULL replicas.

Changes:

  • Adds leader-eligible replica accounting and restart safeguards.
  • Updates regression tests while preserving single-replica and unlimited-budget exceptions.
  • Documents the behavior and adds a Helm changelog entry.
File Description
helm/​solr-operator/​Chart.yaml Adds the managed-update fix to the changelog.
docs/​modules/​solr-cloud/​pages/​managed-updates.adoc Documents the safeguard and exceptions.
controllers/​util/​solr_update_util.go Tracks leader-eligible replicas during pod selection.
controllers/​util/​solr_update_util_test.go Adds mixed-replica coverage and updates expectations.

Review effort: Balanced

Comment thread controllers/util/solr_update_util.go Resolved

This branch has not been deployed

No deployments
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.

Managed rolling update can take down a shard's only leader-eligible replica

2 participants