Skip to content

refactor(client): drop the read-cache keywords from connect - #95

Merged
nhobin219 merged 1 commit into
mainfrom
connect-without-cache
Oct 4, 2026
Merged

nhobin219 merged 1 commit into
mainfrom
connect-without-cache

Conversation

@nhobin219

Copy link
Copy Markdown
Owner

Removes memory_cache, disk_cache, cache_key and disk_cache_volume_limit from connect, added in #93. They're unreleased, so this breaks no one.

Why

A catch-up is a one-off sequential read: the gap from the subscriber's cursor to the published end. A consumer that restarts reads a different gap each time and never the same files twice, so a disk cache has nothing to reuse, and the memory cache doesn't help a single read. The case where caching helps, several subscribers on one box catching up over the same range at once, is niche, and four extra keywords on the subscriber's main entry point were mostly confusing.

The settings stay where reads repeat: Stream.snapshot, scan and sql, and Stream.live's base and its rebase every rebase_every seconds.

live

live used connect's keywords to pass its settings to its own catch-up. That catch-up now uses litelink's defaults, by the same argument. It runs only:

  • at open, if the broker refuses the base's end as too old (publishing lagging the broker by more than max_replay);
  • after a dropped connection.

In normal operation a live view connects once, and a rebase never reconnects. The cost: a view with non-default settings builds a second DuckDB database for that catch-up, once per process (about a quarter-second, mostly LOAD iceberg).

Changes

  • connect: the four keywords are gone, and Catcher no longer carries a cache.
  • Live: its catch-up no longer passes its settings; its base and rebases still do.
  • ReadCache.keywords() is removed, since Live was its only user.
  • Docs: Stream.snapshot's docstring, API.md (connect's signature, plus a sentence on why it has no cache keywords), the README and the CHANGELOG.
  • Tests: test_a_catch_up_reads_with_the_callers_cache_settings is removed with the keywords it tested. test_the_settings_reach_every_read_of_a_stream still checks snapshot, the live base and a rebase.

Gates clean; the reader tests (test_catchup, test_live, test_published, test_snapshot) pass, 76 tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FsSDkeb5rVAxA1FSmKKfQi

A catch-up reads the gap to its cursor once, never the same files twice,
so neither cache has anything to reuse there. The settings stay on the
reads that repeat: snapshot, scan, sql, and live's base and rebases.
live's own catch-up, at open or after a dropped connection, now reads
with litelink's defaults. Unreleased, so nothing breaks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FsSDkeb5rVAxA1FSmKKfQi
@nhobin219
nhobin219 merged commit 9db172f into main Oct 4, 2026
6 checks passed
@nhobin219 nhobin219 mentioned this pull request Oct 4, 2026
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