Skip to content

fix(controller): repair main after the idle requeue merge - #318

Merged
IvanHunters merged 4 commits into
mainfrom
fix/main-test-interactions
Nov 23, 2026
Merged

IvanHunters merged 4 commits into
mainfrom
fix/main-test-interactions

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Two unit tests fail on main after today's merges, although every PR was green on its own.

TestReconcileComesBackWhenAPlacementHoldRunsOut gets RequeueAfter = 0s. #303 added the placement hold and relied on the RD reconciler coming back every 5 s to add the witness once the hold expires. #308 removed that requeue and kept a timed comeback only for the suppression and keep-tiebreaker deadlines. So an RD whose placement died before removing its hold never gets a witness. Fix: nextTiebreakerDeadline now counts the placement hold too.

The same #308 change also broke #307: a witness is not placed on a node a survivor's kernel still holds, and the wait for the survivor to drop it relied on the 5 s requeue too, because dropping a peer is a status write and the RD reconciler ignores those. On this PR's first E2E run tiebreaker-r-d-cleanup caught it: after r d of one diskful replica out of three, no witness ever came. Now the reconciler asks for the usual deferred-witness retry while a node is excluded only as a departed peer. TestReconcileComesBackForAWitnessHeldByADepartedPeer covers it.

TestManagerIndexesCachedReplicasByDefinitionKey fails with controller with name satellite-resource already exists. The latency test from #277 registers the satellite ResourceReconciler on its own manager, and controller-runtime keeps controller names process-wide, so the NewManager call from #303 in the same test binary is refused. The satellite builds one manager, so only tests collide. The latency test now skips name validation, same as the envtest suite in internal/controller.

TestGroupFRAutoPlace3WithTieBreaker on 1e095f3 I think is a flake: 1e095f3 has the same Go code as d617106, which passed Integration, and bd9d4df passed too. That run had two tests in a row hit their 150 s waits and then the 15 m package timeout, which we saw before these PRs as well. Not touched here.

Testing: the failing tests and the new one fail on origin/main and pass on this branch. go build ./..., go vet ./... and the full ./internal/controller and ./pkg/satellite/controllers packages with envtest pass locally.

The RD reconciler stopped requeueing every 5 s and now comes back on
its own only for the witness deadlines it knows: the suppression after
a witness delete and the keep-tiebreaker window. The placement hold
landed in parallel and leaned on that periodic requeue: a placement
that dies before it removes its hold leaves two diskful replicas and
no witness, and nothing writes to the RD again to wake it. With both
merged, that RD stayed without a witness for good.

Count the latest live placement hold among the deadlines, so the pass
that skipped the witness comes back just after the hold runs out.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
controller-runtime keeps controller names in a process-wide registry
for their metrics. The new-Resource latency test registers the
satellite's ResourceReconciler on a manager of its own, and the
replica-key index test builds the satellite's manager through
NewManager in the same test binary, so whichever runs second fails
with "controller with name satellite-resource already exists". Each
passed alone; together on main the index test fails.

The satellite process builds exactly one manager, so the clash exists
only between tests. Skip name validation on the test's own manager, as
the controller package's envtest suite already does.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2d66835-6b97-4a81-ac58-f339d7af7f77
Commits

Reviewing files that changed from the base of the PR and between bd9d4df and 3ef0faa.

Files selected for processing: 3

  • internal/controller/departed_peer_requeue_test.go
  • internal/controller/resourcedefinition_controller.go
  • pkg/satellite/controllers/new_resource_latency_envtest_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…lice

The linter flags the capacity literal as a magic number. Start the
list from the placement hold instead; a zero deadline is never ahead
of now and is skipped like an expired one.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
A witness does not go to a node a survivor's kernel still holds a
connection to, and waits until the survivor drops it. That drop is a
status write, and the RD reconciler ignores status-only Resource
updates, so the wait leaned on the 5 s requeue that the idle-requeue
change removed. Together, deleting one diskful replica of three left
two diskful and no witness for good, which the tiebreaker-r-d-cleanup
e2e scenario caught.

Ask for the regular deferred-witness retry while a node is excluded
only because a survivor still lists it as a peer.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps Andrei Kvapil (kvaps) changed the title fix(controller): repair main after the placement hold and idle requeue merges fix(controller): repair main after the idle requeue merge Nov 23, 2026

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.

Fixes both reds on main. The placement hold now counts as a witness deadline, the departed-peer wait asks for the usual retry, and the new test fails without the change because the no-candidate path in createWitness never asks for one. The retry only fires while a witness is being picked, so it does not bring back the idle requeue.

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.

3 participants