mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #232] [CLOSED] feat: add single-active scheduler HA #275
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#275
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/232
Author: @ethe
Created: 8/30/2026
Status: ❌ Closed
Base:
main← Head:feat/scheduler-ha-upstream📝 Commits (1)
370476ffeat: add scheduler leader election📊 Changes
11 files changed (+463 additions, -44 deletions)
View changed files
📝
CLAUDE.md(+1 -1)📝
docs/src/configuration/env-vars.md(+1 -0)📝
docs/src/internals/architecture.md(+1 -1)📝
services/README.md(+3 -1)➕
services/scheduler/cmd/leadership.go(+81 -0)➕
services/scheduler/cmd/leadership_test.go(+43 -0)📝
services/scheduler/cmd/main.go(+87 -22)📝
services/scheduler/internal/service.go(+26 -7)📝
services/scheduler/internal/service_test.go(+25 -0)📝
services/shared/config/config.go(+91 -12)📝
services/shared/config/config_test.go(+104 -0)📄 Description
Summary
Why
Running multiple full Scheduler replicas behind one Service currently creates independent in-memory node heartbeat/resource views, round-robin cursors, and artifact indexes. Even with Redis-backed bindings, active-active scheduling can use stale or incomplete capacity state. This change makes the full Scheduler single-active while retaining query-only data-plane availability.
Validation
make -C services testgo test ./...fromservices/go vet ./...fromservices/Deployment contract
Leader-election deployments need a Service whose readiness probe uses gRPC health, Lease RBAC for the full Scheduler service account, a unique Pod identity through
SCHEDULER_LEADER_ELECTION_IDENTITY, Redis-backed bindings, and separate query-only replicas for uninterruptedLookupNode. Observed node/resource state and the P2P artifact index remain intentionally ephemeral and are rebuilt after failover.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.