feat(cloud-scheduler): renew active leases

This commit is contained in:
2026-07-12 17:23:07 +08:00
parent b0a5b1426f
commit 1b15a8a218
4 changed files with 225 additions and 2 deletions
@@ -20,7 +20,7 @@
- [x] 3.1 Extend scheduled-task persistence with attempt count, lease id/expiry, terminal result, failure reason, and auditable attempt records.
- [x] 3.2 Implement atomic queued-task assignment and device reservation while excluding devices with active assignments even when snapshots report idle.
- [x] 3.3 Implement owning-host claim that atomically transitions one assigned attempt to dispatched under its active lease.
- [ ] 3.4 Implement lease renewal with host/task/attempt ownership validation and conflict responses for stale leases.
- [x] 3.4 Implement lease renewal with host/task/attempt ownership validation and conflict responses for stale leases.
- [ ] 3.5 Implement idempotent terminal result recording and reservation release for active leases.
- [ ] 3.6 Implement expired-lease requeue/failure behavior with bounded attempts and preserved attempt history.
- [ ] 3.7 Add PostgreSQL concurrency tests proving one assignment/claim winner and SQLite tests documenting single-control-plane behavior.