Home

giogio / openez-graph

public
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat: add lease-based indexing ownership with automatic expiry and heartbeat refresh

3 months ago

03a76d9
Authored
asta-nguyen8/11/2026, 2:05:19 PM
- Add `index_build_owner` and `index_lease_expires_at` columns to workspaces table for lease-based concurrency control
- Implement 60-second indexing leases with 15-second heartbeat refresh to detect stale/crashed indexers
- Allow new indexers to claim expired leases automatically without manual intervention
- Validate owner token on lease refresh and release operations to prevent unauthorized takeover
- Clear lease

Parent385ef1c

9 files changed
  • apps/web/src/server/index.ts+1−2
  • apps/web/src/server/sqlite.ts+4−0
  • packages/db/src/sqlite/registry-db.ts+4−0
  • packages/db/src/sqlite/registry-repository.ts+38−8
  • packages/db/src/sqlite/schema.ts+2−0
  • packages/db/src/sqlite/types.ts+7−3
  • packages/indexer/src/index-workspace.ts+55−2
  • tests/registry.test.ts+21−4
tests/web-index-endpoint.test.ts
+31
−2