chore(release): v1.2.2 (#386)
* fix(lancedb): put table-handle resolution inside the deadline run9 reproduced the stall the previous commits were supposed to close, on a different table: episode went 13 minutes without a prune — versions climbing 63→66 while foresight and atomic_fact both collapsed to 1 — with **zero** failure, timeout, or conflict logs. Its last successful prune was logged at 11:41:59 and the staleness clock matched to the second. The deadline covered the critical section but not the await ahead of it: `table = await self._table()` sat outside `_locked`, so a hang while resolving the table handle never returned. The scheduler runs one maintenance task per kind and skips a kind whose task is still in flight, so that kind stops being maintained permanently, silently, because nothing failed. Move the handle resolution inside the deadline for all seven locked operations, and give the lock-free compaction beat its own `_deadline` (it takes no lock so it cannot block writers, but it can still park a kind by never returning). Belt and braces in the scheduler: both beats now run under `_MAINTENANCE_TASK_TIMEOUT_SECONDS`, a last-resort bound on the whole call, so any await I have not thought of costs one cadence rather than forever. Regression test: a repo whose `_table_lookup` never resolves must make prune, optimize and add all raise `VectorStoreBusyError` and leave the lock free. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * chore(release): v1.2.2 Bump to 1.2.2 and cut the changelog. This release is the storage-layer reliability work: LanceDB maintenance split into lock-free compaction and write-locked reclamation (fixing unbounded index growth), every write-lock critical section bounded by a deadline that covers acquisition, a per-kind prune-staleness signal on GET /health, `everos cascade rebuild` for a drifted or corrupt index, startup detection of column type drift, and a query-vector width check that fails fast instead of 13s deep inside LanceDB. Carries the table-handle deadline fix (previously #385) rather than shipping 1.2.2 with a known stall: the deadline covered the critical section but not the await ahead of it, so a hang while resolving a table handle parked that kind's maintenance permanently and silently. Found by a 1h high-rate soak run after #384 merged. No migration, no config change, no API change: `docs/openapi.json` differs only in the version string. The only operator-visible requirement is that `everos cascade rebuild` now refuses to run while a server holds the OME lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: zhanghui <zhanghui@shanda.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
zhanghui
parent
d256048a6d
commit
84554ebe22
@@ -821,6 +821,42 @@ async def test_waiting_for_a_stuck_holder_also_times_out(
|
||||
await repo.add([_row(owner="u1", entry="n2")])
|
||||
|
||||
|
||||
async def test_a_hanging_table_handle_still_hits_the_deadline(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""Resolving the table handle must happen **inside** the deadline.
|
||||
|
||||
With it outside, a hang there never returns, and the maintenance scheduler
|
||||
runs one task per kind and skips a kind whose task is still in flight — so
|
||||
that kind silently stops being maintained. A soak run hit exactly this: one
|
||||
table went 13 minutes without a prune, zero failure logs, while its two
|
||||
siblings pruned on schedule.
|
||||
"""
|
||||
from everos.core.errors import VectorStoreBusyError
|
||||
from everos.core.persistence.lancedb import repository as repo_mod
|
||||
|
||||
monkeypatch.setattr(repo_mod, "_PRUNE_TIMEOUT_SECONDS", 0.05)
|
||||
monkeypatch.setattr(repo_mod, "_COMPACT_TIMEOUT_SECONDS", 0.05)
|
||||
monkeypatch.setattr(repo_mod, "_WRITE_TIMEOUT_SECONDS", 0.05)
|
||||
|
||||
class _HangingLookupRepo(_NoteRepo):
|
||||
async def _table_lookup(self): # type: ignore[no-untyped-def]
|
||||
await asyncio.sleep(30) # never resolves within the deadline
|
||||
|
||||
repo = _HangingLookupRepo()
|
||||
|
||||
# Every maintenance/write entry point must give up rather than park.
|
||||
with pytest.raises(VectorStoreBusyError):
|
||||
await repo.prune(dt.timedelta(seconds=60))
|
||||
with pytest.raises(VectorStoreBusyError):
|
||||
await repo.optimize()
|
||||
with pytest.raises(VectorStoreBusyError):
|
||||
await repo.add([_row(owner="u1", entry="e1")])
|
||||
|
||||
# And the lock was never left held.
|
||||
assert not repo._write_lock(repo.table_name).locked()
|
||||
|
||||
|
||||
def test_write_budgets_are_sized_from_measurements_not_guesses() -> None:
|
||||
"""Write budgets must stay in the tens of seconds, not hundreds.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user