Skip to content

feat(master): support etcd-backed HA scheduler#154

Merged
beinan merged 2 commits into
mainfrom
feat/master-etcd-task-store
Jul 16, 2026
Merged

feat(master): support etcd-backed HA scheduler#154
beinan merged 2 commits into
mainfrom
feat/master-etcd-task-store

Conversation

@beinan

@beinan beinan commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep RocksDB as the default single-master/PVC scheduler backend and add a configurable etcd backend for stateless HA masters
  • use etcd transactions and leases for enqueue de-duplication, queue claims, orphan recovery, and per-experiment Compact/IndexId locking
  • coordinate stats writers and compaction sweeps across replicas, reload latest stats manifests for follower reads, and add a three-replica Kubernetes deployment example with auth/TLS configuration
  • run a real etcd integration test in Rust CI covering concurrent enqueue/claim, target locking, and lease-expiry recovery

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p lance-context-core -p lance-context-master --lib (core 135 passed, master 23 passed)
  • cargo test -p lance-context-core --doc
  • ETCD_TEST_ENDPOINTS=http://127.0.0.1:12379 cargo test -p lance-context-master task_store::tests::etcd_coordinates_dedupe_claims_and_target_locks -- --ignored --exact
  • uv run pytest python/tests/ -v (3 passed)
  • uv run ruff format --check python/
  • uv run ruff check python/
  • uv run pyright

beinan added 2 commits July 16, 2026 01:48
…-store

# Conflicts:
#	crates/lance-context-master/src/scheduler.rs
#	crates/lance-context-master/src/state.rs
#	crates/lance-context-master/src/task_store.rs
@beinan beinan merged commit cfd77d8 into main Jul 16, 2026
9 checks passed
beinan added a commit that referenced this pull request Jul 16, 2026
## Summary
- Remove the single-master RocksDB scheduler backend entirely. The
master is now always etcd-backed and horizontally scalable — no
`TASK_STORE_BACKEND` switch, no `TASK_DB_PATH`, no `rocksdb` dependency.
- `TaskStore` wraps `EtcdTaskStore` directly (deleted `RocksTaskStore`
and the `TaskStoreInner`/`ClaimBackend`/`GuardBackend` enums).
- `ETCD_ENDPOINTS` is now required to start the master.
- Deploy: delete the RocksDB `master.yaml`, promote `master-etcd.yaml` →
`master.yaml`, rewrite the k8s README for etcd-only.

## Testing
- `cargo build --workspace` ✅, `cargo clippy -p lance-context-master
--tests` ✅ (clean), `cargo fmt` ✅
- `cargo test -p lance-context-master`: 7 passed, 17 ignored. Unit tests
that build `MasterState`/`TaskStore` need a live etcd and are gated
behind `ETCD_TEST_ENDPOINTS` (`#[ignore]`). Added
`connect_requires_etcd_endpoints`.

## Note
Branched fresh from `main` (which already carries the etcd backend,
#154). Supersedes the single-master RocksDB lease work in #155 — with
RocksDB gone, that guard is unnecessary.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4 <noreply@anthropic.com>
@beinan beinan deleted the feat/master-etcd-task-store branch July 16, 2026 19:14
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.

1 participant