Skip to content

Commit c7e56b3

Browse files
committed
Revert "Backport: Adjust service chain ownership when reassigning services between workers (#5435) (#5506)"
This reverts commit 636dfe0.
1 parent 615116a commit c7e56b3

File tree

12 files changed

+42
-665
lines changed

12 files changed

+42
-665
lines changed

examples/Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/controller/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ bcs.workspace = true
1010
futures.workspace = true
1111
linera-sdk.workspace = true
1212
log.workspace = true
13-
serde = { workspace = true, features = ["derive"] }
1413
serde_json = { workspace = true }
1514

1615
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]

examples/controller/README.md

Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -92,77 +92,26 @@ sequenceDiagram
9292
participant W2 as Worker 2
9393
A->>C: ExecuteControllerCommand<br/>{UpdateService}
9494
C->>C: Update services registry
95-
C->>W1: Start{service_id,<br/>owners_to_remove: {},<br/>start_height: None}
96-
C->>W2: Start{service_id,<br/>owners_to_remove: {},<br/>start_height: None}
95+
C->>W1: Message::Start{service_id}
96+
C->>W2: Message::Start{service_id}
9797
W1->>W1: Add to local_services
9898
W2->>W2: Add to local_services
9999
```
100100

101-
### Service Handoff (Reassignment)
102-
103-
When a service is moved from one worker to another, all three chain types
104-
participate in a two-phase handoff protocol. The new worker's owners are added
105-
to the service chain first, then the old worker's owners are removed, ensuring
106-
there is no gap in ownership.
107-
108-
```mermaid
109-
sequenceDiagram
110-
participant A as Admin
111-
participant C as Controller Chain
112-
participant WA as Old Worker Chain
113-
participant S as Service Chain
114-
participant WB as New Worker Chain
115-
116-
A->>C: ExecuteControllerCommand<br/>{UpdateService{service, [WB]}}
117-
C->>C: Record pending handoff
118-
C->>WA: Stop{service, new_owners: [WB]}
119-
120-
note over WA,S: Phase 1: Add new owners
121-
WA->>S: AddOwners{service, [WB]}
122-
S->>S: Add WB as chain owner
123-
S->>WA: OwnersAdded{service, block_height}
124-
125-
WA->>WA: Remove from local_services
126-
WA->>C: HandoffStarted{service, block_height}
127-
128-
C->>C: Resolve pending handoff
129-
C->>WB: Start{service,<br/>owners_to_remove: [WA],<br/>start_height: block_height}
130-
WB->>WB: Add to local_pending_services
131-
132-
note over WB,S: Phase 2: Remove old owners
133-
WB->>WB: StartLocalService at start_height
134-
WB->>S: RemoveOwners{[WA]}
135-
S->>S: Remove WA as chain owner
136-
WB->>WB: Move to local_services
137-
```
138-
139101
### Service Removal
140102

141-
When a service is removed, Stop messages are sent to all workers. Each worker
142-
initiates ownership cleanup through the service chain before removing the
143-
service locally, following the same handoff protocol but with empty new owners.
144-
145103
```mermaid
146104
sequenceDiagram
147105
participant A as Admin
148106
participant C as Controller Chain
149107
participant W1 as Worker 1
150108
participant W2 as Worker 2
151-
participant S as Service Chain
152109
A->>C: ExecuteControllerCommand<br/>{RemoveService}
153110
C->>C: Remove from services registry
154-
C->>W1: Stop{service_id, new_owners: {}}
155-
C->>W2: Stop{service_id, new_owners: {}}
156-
157-
W1->>S: AddOwners{service_id, {}}
158-
S->>W1: OwnersAdded{service_id, block_height}
111+
C->>W1: Message::Stop{service_id}
112+
C->>W2: Message::Stop{service_id}
159113
W1->>W1: Remove from local_services
160-
W1->>C: HandoffStarted{service_id, block_height}
161-
162-
W2->>S: AddOwners{service_id, {}}
163-
S->>W2: OwnersAdded{service_id, block_height}
164114
W2->>W2: Remove from local_services
165-
W2->>C: HandoffStarted{service_id, block_height}
166115
```
167116

168117
## Operations
@@ -207,11 +156,7 @@ Messages are sent between chains to coordinate state:
207156
| `ExecuteWorkerCommand` | Worker -> Controller | Register/deregister worker |
208157
| `ExecuteControllerCommand` | Any -> Controller | Admin commands |
209158
| `Reset` | Controller -> Worker | Clear worker state |
210-
| `Start { service_id, owners_to_remove, start_height }` | Controller -> Worker | Start a service, optionally with handoff info |
211-
| `Stop { service_id, new_owners }` | Controller -> Worker | Stop a service, initiating ownership handoff via the service chain |
159+
| `Start { service_id }` | Controller -> Worker | Start a service |
160+
| `Stop { service_id }` | Controller -> Worker | Stop a service |
212161
| `FollowChain { chain_id }` | Controller -> Worker | Follow a chain |
213162
| `ForgetChain { chain_id }` | Controller -> Worker | Stop following a chain |
214-
| `AddOwners { service_id, new_owners }` | Worker -> Service Chain | Add new owners to a service chain during handoff |
215-
| `RemoveOwners { owners_to_remove }` | Worker -> Service Chain | Remove old owners from a service chain after handoff |
216-
| `OwnersAdded { service_id, added_at }` | Service Chain -> Worker | Confirm new owners were added at a given block height |
217-
| `HandoffStarted { service_id, target_block_height }` | Worker -> Controller | Notify controller that handoff phase 1 is complete |

0 commit comments

Comments
 (0)