Registry Mirror
Skip to content

Conversation

@danielle-mustillo

@danielle-mustillo danielle-mustillo commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Why

rolling-upgrade-tests (prev-stable) fails sometimes on release/v0.10.x with "target schema was not observed while old controller pods were still ready". It failed twice, then passed, on the same commit in #3738.

The test installs the previous release with 2 controller replicas, but its upgrade sets no replica count, so the chart drops to 1. At 1 replica the chart also deletes the leader-election Role. The old leader is then denied its Lease, logs leader election lost, and exits. When the new pod gets Ready before the crashed old pod restarts, no old pod is Ready after the migration, and the test times out.

What changed

  • The rolling upgrade test passes --set controller.replicas=2 to the upgrade, as an operator would.

Scope

  • Test only. main is not affected: its leader-election Role does not depend on the replica count.
  • The flake came from a mistake in the test. Its upgrade dropped from 2 controller replicas to 1, which an upgrade should never do. This PR fixes the test so it keeps 2 replicas, and it leaves the chart alone. An operator who makes the same mistake (usually by upgrading without --reuse-values) still sees the old controller restart once. The kagent UI and API can then be unavailable for up to about 30 seconds before they recover on their own, with no data lost.

Verification

  • Local kind runs, 0.9.12 to this branch, with the new pod's start delayed to match CI: before, the old leader exited in 8 of 9 runs and the test failed once with the CI message. After, the old leader exited in 0 of 8 runs and every run passed.
  • go vet and make -C go lint pass. rolling-upgrade-tests (prev-stable) is re-run several times on this PR.

The rolling upgrade test installs the previous release with 2 controller
replicas, but upgrades with `make helm-install-provider`, which sets no
replica count. The chart then falls back to 1 replica. On release/v0.10.x
that also turns leader election off and deletes the leader-election Role.

The old leader still has leader election on, so it is denied its Lease,
fails to renew within the deadline, and exits ("leader election lost").
The scale-down to 1 has already removed the other old pod. When the new
pod gets Ready before the crashed old pod comes back, no old pod is Ready
after the migration and the poll times out after 6 minutes with
"target schema was not observed while old controller pods were still
ready".

Pass --set controller.replicas=2 to the upgrade, as an operator doing a
rolling upgrade would. The Role stays, no old pod exits, and the rollout
keeps both old pods until the new one is Ready.

Signed-off-by: Danielle Mustillo <danielle.mustillo@solo.io>
@github-actions github-actions Bot added the testing Additional testing required label Nov 19, 2026
Signed-off-by: Danielle Mustillo <danielle.mustillo@solo.io>
@github-actions github-actions Bot added testing Additional testing required and removed testing Additional testing required labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Additional testing required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant