Skip to content

fix: Cache ops report what they did: 409 skipped refresh, GC pinned files, stale alias validation (#218) - #228

Closed
jrosskopf wants to merge 6 commits into
mainfrom
fix/gh-218-cache-ops
Closed

jrosskopf wants to merge 6 commits into
mainfrom
fix/gh-218-cache-ops

Conversation

@jrosskopf

@jrosskopf jrosskopf commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A refresh skipped because one of the same table is already running answers 409 + Retry-After: 5 (was 200 already_running); flapii cache refresh reports it and exits non-zero
  • cache/gc reports pinned_by and pinned_bytes when another cached table's retained snapshot pins this table's old files (was nothing_to_expire / 0 bytes); the pin-holder text is shared with drop-table
  • Populate validation against an alias the server attached before an atomic rename of its file returns a stale warning instead of a bind error (Linux: open file unlinked from its path); no re-attach inside validation
  • Plugin hook warns when an uncached template reads an alias only a populate template attaches; caching guide documents the rename-published source pattern (small cached stats endpoint that re-attaches)

Test plan

  • test_cache_ops_218.py (slow populate + concurrent refresh, two-table GC pin, stale alias after os.replace): red on the pre-fix binary, green after
  • hook helper unit test in test_template_validation_and_hook.py
  • make test (979/979), cache/validation/readiness integration tests
  • CLI vitest (cluster-c.spec.ts skippedRefresh) not run locally: no node_modules

Refs #218


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…a populate attaches (#218)

- A populate template's ATTACH runs on refresh only; an uncached endpoint reading that alias never sees it, or a rename-published update of it
- The hook also passes the server's stale-alias validation warning on
…reports a stale alias (red) (#218)

- Slow populate plus two concurrent refreshes: the second answers 200 already_running today
- Two cached tables on one catalog: GC for the first reports nothing_to_expire / 0 bytes, no pinned_by
- Populate validation after an atomic rename of the attached file: bind error, no stale warning
…nned files, stale alias in validation (#218)

- A refresh skipped because one of the same table is running answers 409 + Retry-After instead of 200 already_running
- GC names the other cached tables whose retained snapshots pin this table's old files and reports pinned_bytes, instead of nothing_to_expire / 0 bytes (pin holder text shared with drop-table)
- Populate validation against an alias the server attached before an atomic rename of its file reports a stale warning (Linux: the open file is unlinked from its path) instead of a bind error against the old file
…published sources (#218)

- CLI: cache refresh reports the 409 already_running answer and exits non-zero
- Caching guide: small cached stats endpoint whose populate re-attaches
- API reference, plugin API reference and spec updated
@jrosskopf

Copy link
Copy Markdown
Contributor Author

Superseded by #230 (combined and merged).

@jrosskopf jrosskopf closed this Nov 21, 2026
@jrosskopf
jrosskopf deleted the fix/gh-218-cache-ops branch November 21, 2026 03:27
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