Skip to content

feat(master): persist scheduler tasks in RocksDB#151

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

feat(master): persist scheduler tasks in RocksDB#151
beinan merged 4 commits into
mainfrom
feat/master-rocksdb-task-store

Conversation

@beinan

@beinan beinan commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • persist scheduler task records and lifecycle transitions in a master-local RocksDB with synchronous WAL writes
  • reload queued tasks and requeue interrupted running tasks in FIFO order after master restart
  • retain a bounded terminal task history while keeping queued and running tasks until completion
  • add TASK_DB_PATH and TASK_HISTORY_LIMIT master configuration
  • add a single-replica Kubernetes master Deployment with a dedicated ReadWriteOnce PVC and Recreate strategy
  • install RocksDB native build dependencies in Rust CI and run master tests in the Rust test workflow

Operational notes

  • the RocksDB path must be local filesystem storage backed by the master PVC, not the rollout object-store URI
  • only one active master may open the PVC; the provided Deployment enforces one replica and Recreate updates
  • compaction and WAL-merge operations are safe to retry when an interrupted task is recovered

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • final cargo clippy -p lance-context-master --all-targets -- -D warnings
  • final cargo test -p lance-context-master --lib (22 passed)
  • npm ci && npm run build (crates/lance-context-master/ui)
  • parsed and validated the PVC, Service, and Deployment YAML documents

@beinan
beinan merged commit aa406fd into main Jul 16, 2026
10 checks passed
@beinan
beinan deleted the feat/master-rocksdb-task-store branch July 16, 2026 19:14
beinan added a commit that referenced this pull request Jul 21, 2026
## Background
The Rust Tests job has been consistently slow (~23min). Two unrelated
PRs (#151, #159) showed the same pattern, which pointed to a CI config
issue rather than anything a specific change introduced.

## Root cause
1. **Wrong rust-cache path** (the real culprit): `workspaces` pointed at
`crates/lance-context-core` and `python`, but this is a **single root
workspace** whose build output lives in `./target`. Those subdirs have
no `target/`, so the cache was always empty and every run rebuilt all
dependencies from scratch — including the rocksdb C++ library compiled
from source.
2. **Doctest step has near-zero value**: `lance-context-core` has a
single doctest (~7s locally), but the step re-links the entire
rocksdb-bearing crate, costing ~6.85min per run.

## Changes
- `workspaces: "."` — cache the actual `./target`.
- Remove the `Run doc tests` step.

## Expected impact
- Drops the doctest step outright: **~-7min**.
- Once the cache is warm, dependencies (especially rocksdb) are no
longer rebuilt every run. The first run still has to populate the cache;
from the **second run onward** compile time drops substantially.

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

Co-authored-by: Claude Opus 4 <noreply@anthropic.com>
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