Repository navigation
fix(controller): repair main after the idle requeue merge - #318
Conversation
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>
|
Warning Review limit reachedYou'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. View limit details
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. |
…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>
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
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.
Two unit tests fail on main after today's merges, although every PR was green on its own.
TestReconcileComesBackWhenAPlacementHoldRunsOutgetsRequeueAfter = 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:nextTiebreakerDeadlinenow 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-cleanupcaught it: afterr dof 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.TestReconcileComesBackForAWitnessHeldByADepartedPeercovers it.TestManagerIndexesCachedReplicasByDefinitionKeyfails withcontroller with name satellite-resource already exists. The latency test from #277 registers the satelliteResourceReconcileron its own manager, and controller-runtime keeps controller names process-wide, so theNewManagercall 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 ininternal/controller.TestGroupFRAutoPlace3WithTieBreakeron 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/controllerand./pkg/satellite/controllerspackages with envtest pass locally.