Skip to content

Backport: Adjust service chain ownership when reassigning services between workers (#5435)#5506

Merged
bart-linera merged 11 commits intolinera-io:testnet_conwayfrom
bart-linera:controller-chain-ownership-backport
Feb 25, 2026
Merged

Backport: Adjust service chain ownership when reassigning services between workers (#5435)#5506
bart-linera merged 11 commits intolinera-io:testnet_conwayfrom
bart-linera:controller-chain-ownership-backport

Conversation

@bart-linera
Copy link
Copy Markdown
Contributor

Motivation

If a service is reassign from worker A to worker B by the controller application, worker A should cease to be the owner of the service's chain, and worker B should become an owner.

Proposal

Upon reassignment, when telling worker A to stop running the service, worker A will add worker B as an owner and notify the main controller chain.

The main controller will then tell worker B to take over, telling it at which height on the service chain it became an owner. Worker B then waits until it synchronizes the service chain until that height, and when it's ready, it starts listening to the chain in FullChain mode and removes worker A as an owner.

Test Plan

test_controller was extended to reassign a service from one worker to another, and then check if the second worker properly handles a task request.

Release Plan

  • These changes should be released in a new SDK

Links

bart-linera and others added 7 commits February 24, 2026 17:05
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Start and Stop messages now carry handoff-related fields. Update the
service assignment, service removal, and messages table to match the code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bart-linera bart-linera requested review from afck, deuszx and ma2bd February 24, 2026 17:25
@bart-linera bart-linera marked this pull request as ready for review February 24, 2026 17:26
@bart-linera bart-linera merged commit 636dfe0 into linera-io:testnet_conway Feb 25, 2026
36 checks passed
@bart-linera bart-linera deleted the controller-chain-ownership-backport branch February 25, 2026 15:48
github-merge-queue bot pushed a commit that referenced this pull request Feb 25, 2026
## Motivation

#5506 revealed a bug in the `ChainListener`, which is not exposed by the
existing tests on `main` due to different handling of event
subscriptions. The bug is that when the `ChainListener` stops listening
to a chain, it doesn't remove it from the `event_subscriptions` map.

## Proposal

Always remove a chain from `event_subscriptions` when no longer
listening to it.

## Test Plan

CI will catch regressions.

## Release Plan

- Nothing to do / These changes follow the usual release cycle.

## Links

- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
ndr-ds added a commit that referenced this pull request Feb 27, 2026
ndr-ds added a commit that referenced this pull request Feb 27, 2026
…vices between workers (#5435) (#5506)" (#5539)

## Motivation

Temporarily revert to unblock pm-infra.

## Proposal

Reverts 636dfe0 ("Adjust service chain ownership when reassigning
services between
workers").

## Test Plan

CI.
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