What a shard computes on survives the agent's and the control plane's restarts

It was sent once, with READY, and kept only in the leader's memory: a
failover or an agent restart lost it. The agent now keeps it with the
shard's state on disk (ShardSpec.Compute, set by Supervisor.SetCompute) and
reports it with each running shard when it registers (RunningShard.compute),
which adoption carries onto the replica.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-07 13:51:40 +02:00
1 parent 0add189e02
commit 25b3e129fe
11 files changed
+152 -54

No files matched your search

+46 -33
View File
@@ -1197,7 +1197,11 @@ type RunningShard struct {
// replica across its own restart, so without this a shard adopted after a
// restart could not be compared with the catalog — which is exactly when the
// catalog is most likely to have been edited.
ProfileFp string `protobuf:"bytes,15,opt,name=profile_fp,json=profileFp,proto3" json:"profile_fp,omitempty"`
ProfileFp string `protobuf:"bytes,15,opt,name=profile_fp,json=profileFp,proto3" json:"profile_fp,omitempty"`
// compute is where its engine said it put the model when it became ready,
// kept by the agent across its own restarts: a control plane that takes
// over, or restarts, learns it here.
Compute *Compute `protobuf:"bytes,16,opt,name=compute,proto3" json:"compute,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -1337,6 +1341,13 @@ func (x *RunningShard) GetProfileFp() string {
return ""
}
func (x *RunningShard) GetCompute() *Compute {
if x != nil {
return x.Compute
}
return nil
}
type GPU struct {
state protoimpl.MessageState `protogen:"open.v1"`
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
@@ -4656,7 +4667,7 @@ const file_llmgw_v1_agent_proto_rawDesc = "" +
"free_bytes\x18\x02 \x01(\x03R\tfreeBytes\x12\x1f\n" +
"\vtotal_bytes\x18\x03 \x01(\x03R\n" +
"totalBytes\x12\x16\n" +
"\x06shared\x18\x04 \x01(\bR\x06shared\"\xb6\x03\n" +
"\x06shared\x18\x04 \x01(\bR\x06shared\"\xe3\x03\n" +
"\fRunningShard\x12\x1d\n" +
"\n" +
"replica_id\x18\x01 \x01(\tR\treplicaId\x12\x19\n" +
@@ -4678,7 +4689,8 @@ const file_llmgw_v1_agent_proto_rawDesc = "" +
"\vleader_port\x18\x0e \x01(\x05R\n" +
"leaderPort\x12\x1d\n" +
"\n" +
"profile_fp\x18\x0f \x01(\tR\tprofileFp\"\xca\x06\n" +
"profile_fp\x18\x0f \x01(\tR\tprofileFp\x12+\n" +
"\acompute\x18\x10 \x01(\v2\x11.llmgw.v1.ComputeR\acompute\"\xca\x06\n" +
"\x03GPU\x12\x14\n" +
"\x05index\x18\x01 \x01(\x05R\x05index\x12\x12\n" +
"\x04uuid\x18\x02 \x01(\tR\x04uuid\x12\x12\n" +
@@ -5108,36 +5120,37 @@ var file_llmgw_v1_agent_proto_depIdxs = []int32{
7, // 28: llmgw.v1.Register.host:type_name -> llmgw.v1.Host
19, // 29: llmgw.v1.Register.imex:type_name -> llmgw.v1.IMEX
0, // 30: llmgw.v1.RunningShard.state:type_name -> llmgw.v1.ShardStatus.State
46, // 31: llmgw.v1.GPU.nic_paths:type_name -> llmgw.v1.GPU.NicPathsEntry
11, // 32: llmgw.v1.GPU.mig:type_name -> llmgw.v1.MIGDevice
16, // 33: llmgw.v1.NodeLoad.shards:type_name -> llmgw.v1.ShardLoad
15, // 34: llmgw.v1.NodeLoad.gpus:type_name -> llmgw.v1.GPUSensor
47, // 35: llmgw.v1.IBPort.counters:type_name -> llmgw.v1.IBPort.CountersEntry
18, // 36: llmgw.v1.IBPort.subnet_managers:type_name -> llmgw.v1.SubnetManager
8, // 37: llmgw.v1.Heartbeat.storage:type_name -> llmgw.v1.Storage
13, // 38: llmgw.v1.Heartbeat.weights:type_name -> llmgw.v1.LocalWeights
48, // 39: llmgw.v1.Heartbeat.engine_versions:type_name -> llmgw.v1.Heartbeat.EngineVersionsEntry
24, // 40: llmgw.v1.Heartbeat.provision:type_name -> llmgw.v1.ProvisionStatus
14, // 41: llmgw.v1.Heartbeat.load:type_name -> llmgw.v1.NodeLoad
17, // 42: llmgw.v1.Heartbeat.ib_ports:type_name -> llmgw.v1.IBPort
12, // 43: llmgw.v1.Heartbeat.fabrics:type_name -> llmgw.v1.FabricAttachment
20, // 44: llmgw.v1.Heartbeat.gpu_fabric:type_name -> llmgw.v1.GPUFabricState
19, // 45: llmgw.v1.Heartbeat.imex:type_name -> llmgw.v1.IMEX
23, // 46: llmgw.v1.Provision.engines:type_name -> llmgw.v1.EngineWant
49, // 47: llmgw.v1.EngineWant.offline_sha256:type_name -> llmgw.v1.EngineWant.OfflineSha256Entry
0, // 48: llmgw.v1.ShardStatus.state:type_name -> llmgw.v1.ShardStatus.State
27, // 49: llmgw.v1.ShardStatus.fetch:type_name -> llmgw.v1.FetchProgress
25, // 50: llmgw.v1.ShardStatus.compute:type_name -> llmgw.v1.Compute
29, // 51: llmgw.v1.StartShard.profile:type_name -> llmgw.v1.EngineProfile
50, // 52: llmgw.v1.EngineProfile.env:type_name -> llmgw.v1.EngineProfile.EnvEntry
42, // 53: llmgw.v1.EngineProfile.adapters:type_name -> llmgw.v1.LoraAdapter
1, // 54: llmgw.v1.AgentService.Connect:input_type -> llmgw.v1.AgentMessage
3, // 55: llmgw.v1.AgentService.Connect:output_type -> llmgw.v1.ControlMessage
55, // [55:56] is the sub-list for method output_type
54, // [54:55] is the sub-list for method input_type
54, // [54:54] is the sub-list for extension type_name
54, // [54:54] is the sub-list for extension extendee
0, // [0:54] is the sub-list for field type_name
25, // 31: llmgw.v1.RunningShard.compute:type_name -> llmgw.v1.Compute
46, // 32: llmgw.v1.GPU.nic_paths:type_name -> llmgw.v1.GPU.NicPathsEntry
11, // 33: llmgw.v1.GPU.mig:type_name -> llmgw.v1.MIGDevice
16, // 34: llmgw.v1.NodeLoad.shards:type_name -> llmgw.v1.ShardLoad
15, // 35: llmgw.v1.NodeLoad.gpus:type_name -> llmgw.v1.GPUSensor
47, // 36: llmgw.v1.IBPort.counters:type_name -> llmgw.v1.IBPort.CountersEntry
18, // 37: llmgw.v1.IBPort.subnet_managers:type_name -> llmgw.v1.SubnetManager
8, // 38: llmgw.v1.Heartbeat.storage:type_name -> llmgw.v1.Storage
13, // 39: llmgw.v1.Heartbeat.weights:type_name -> llmgw.v1.LocalWeights
48, // 40: llmgw.v1.Heartbeat.engine_versions:type_name -> llmgw.v1.Heartbeat.EngineVersionsEntry
24, // 41: llmgw.v1.Heartbeat.provision:type_name -> llmgw.v1.ProvisionStatus
14, // 42: llmgw.v1.Heartbeat.load:type_name -> llmgw.v1.NodeLoad
17, // 43: llmgw.v1.Heartbeat.ib_ports:type_name -> llmgw.v1.IBPort
12, // 44: llmgw.v1.Heartbeat.fabrics:type_name -> llmgw.v1.FabricAttachment
20, // 45: llmgw.v1.Heartbeat.gpu_fabric:type_name -> llmgw.v1.GPUFabricState
19, // 46: llmgw.v1.Heartbeat.imex:type_name -> llmgw.v1.IMEX
23, // 47: llmgw.v1.Provision.engines:type_name -> llmgw.v1.EngineWant
49, // 48: llmgw.v1.EngineWant.offline_sha256:type_name -> llmgw.v1.EngineWant.OfflineSha256Entry
0, // 49: llmgw.v1.ShardStatus.state:type_name -> llmgw.v1.ShardStatus.State
27, // 50: llmgw.v1.ShardStatus.fetch:type_name -> llmgw.v1.FetchProgress
25, // 51: llmgw.v1.ShardStatus.compute:type_name -> llmgw.v1.Compute
29, // 52: llmgw.v1.StartShard.profile:type_name -> llmgw.v1.EngineProfile
50, // 53: llmgw.v1.EngineProfile.env:type_name -> llmgw.v1.EngineProfile.EnvEntry
42, // 54: llmgw.v1.EngineProfile.adapters:type_name -> llmgw.v1.LoraAdapter
1, // 55: llmgw.v1.AgentService.Connect:input_type -> llmgw.v1.AgentMessage
3, // 56: llmgw.v1.AgentService.Connect:output_type -> llmgw.v1.ControlMessage
56, // [56:57] is the sub-list for method output_type
55, // [55:56] is the sub-list for method input_type
55, // [55:55] is the sub-list for extension type_name
55, // [55:55] is the sub-list for extension extendee
0, // [0:55] is the sub-list for field type_name
}
func init() { file_llmgw_v1_agent_proto_init() }
+5
View File
@@ -266,6 +266,11 @@ message RunningShard {
// restart could not be compared with the catalog — which is exactly when the
// catalog is most likely to have been edited.
string profile_fp = 15;
// compute is where its engine said it put the model when it became ready,
// kept by the agent across its own restarts: a control plane that takes
// over, or restarts, learns it here.
Compute compute = 16;
}
message GPU {