Replies: 1 comment
-
Updated Design: Refinements based on team discussionAfter further analysis and team discussions with @malinthaprasan and @VirajSalaka , here are the key refinements to the initial proposal: 1. Enhanced API ResponseThe {
"deployments": [
{
"apiId": "abc-123",
"deploymentId": "dep-789",
"kind": "RestAPI",
"state": "DEPLOYED",
"deployedAt": "2026-03-04T10:30:00Z"
}
]
}
2. Sync Actions ClarifiedBased on comparing platform state vs local state:
Note: 3. Race Condition Handling: Timestamp-Guarded WritesTo handle races between startup sync and WebSocket events: INSERT INTO artifacts (api_id, deployment_id, ..., deployed_at)
VALUES (?, ?, ..., ?)
ON CONFLICT (api_id) DO UPDATE SET ...
WHERE artifacts.deployed_at < EXCLUDED.deployed_atKey rule: Only publish to EventHub if 4. Integration with HA Sync (EventHub)Startup sync uses the same abstraction being developed for Gateway Controller HA: Self-published events: Controllers update their own ConfigStore via EventHub (clean single path for all updates). 5. Chunked Batch FetchingTo handle large number of deployments:
Configuration: [controller.sync]
batch_size = 506. DB SchemaBuilds on Discussion #1311: ALTER TABLE artifacts ADD COLUMN deployment_id TEXT;
CREATE INDEX IF NOT EXISTS idx_deployment_id ON artifacts(deployment_id);
7. EventHub Ordering AssumptionConfigStore does NOT have timestamp guard - relies on ordered EventHub delivery. This is safe as long as:
Discussion point: If EventHub architecture changes (multiple schedulers, parallel processing), ConfigStore should add timestamp guard. Phase 1 Scope (Updated)
Dependencies:
Open Discussion Points
Full design details: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Gateways restart with stale configurations because WebSocket events are missed while the gateway is down. The platform-api has newer deployments that the gateway doesn't know about, leading to:
Proposed Solution
Async sync on gateway startup — Gateway fetches expected deployment state from platform-api and reconciles locally.
Key Design Decisions
Required Changes
Gateway Controller - DB Schema
Platform API - New Internal Endpoints
1. List Expected Deployments
2. Batch Fetch Deployment Content
Zip Structure:
Each top-level directory is named by deploymentId, allowing the gateway to identify which content belongs to which deployment.
GW High-Level Flow
Phase 1 Scope
REST APIs, LLM Providers, LLM Proxies
Startup sync (async mode)
Batch fetch for efficiency
Beta Was this translation helpful? Give feedback.
All reactions