Skip to content

perf(runtime): bound created-at reservation listing (v0.1.25.54) - #242

Merged
amavashev merged 2 commits into
mainfrom
agent/sorted-reservation-index-240
Jul 14, 2026
Merged

amavashev merged 2 commits into
mainfrom
agent/sorted-reservation-index-240

Conversation

@amavashev

@amavashev amavashev commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add one completeness-gated per-tenant created_at_ms reservation ZSET, atomically dual-written by every reserve
  • serve only the default created-at sort through bounded, tie-safe candidate batches; preserve all filters, cursor shape, and the authoritative SCAN fallback
  • add restartable backfill, READY/count validation, lazy and nightly stale cleanup, bounded observability, rollout/rollback controls, tests, docs, and the 0.1.25.54 release bump
  • close review gaps with explicit rollout opt-in, scheduler isolation and failed-row backoff, uniform cursor validation, corruption-safe invalidation, wrong-type repair, and Java/Lua projection contracts

Why

Sorted reservation pages previously scanned and hydrated the global reservation keyspace, then sorted every matching row in memory. At 10,000 rows that made the default limit=20 request O(total reservations) on every page. The index is used only when its completeness proof is valid; reservation hashes remain authoritative and any uncertainty returns to the existing full-SCAN behavior.

Impact

Same-host three-trial medians improved from 22.5 ms to 10.7 ms at 1,000 rows and from 164.9 ms to 11.1 ms at 10,000 rows. Reserve p50/p99 and 32-thread lifecycle throughput remained within the 25% regression gate. The application and both production Compose files default the read/backfill switch off; operators explicitly enable it only after every writer runs the index-aware release.

Validation

  • mvn -B -f cycles-protocol-service/pom.xml clean verify -Pintegration-tests
    • 1,181 tests: 31 model, 561 data, 589 API
    • zero failures, errors, or skips
    • protocol coverage 11/11
    • JaCoCo line coverage: data 95.10%, API 95.56%
  • 23 focused real-Redis index tests, including 10,000-row traversal, 300-way timestamp ties, malformed cursors on ready/fallback paths, selective filters, readiness races, drift, eviction, wrong types, per-tenant sweep isolation, repair backoff, and post-readiness identity corruption
  • Java/Lua contract tests pin the index key grammar and Java batch size against the Lua page cap
  • three complete 17-case benchmark trials with zero errors
  • both production Compose files render successfully
  • git diff --check

Closes #240

@amavashev
amavashev marked this pull request as ready for review July 14, 2026 15:55
@amavashev
amavashev merged commit 182ea05 into main Jul 14, 2026
8 checks passed
@amavashev
amavashev deleted the agent/sorted-reservation-index-240 branch July 14, 2026 15:55
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.

perf(runtime): bound sorted reservation listing without incomplete indices

1 participant