Skip to content

cache: migrate to Otter v2 with write-based expiry - #7357

Draft
Flo4604 wants to merge 1 commit into
deps/sqlcfrom
deps/cache
Draft

cache: migrate to Otter v2 with write-based expiry#7357
Flo4604 wants to merge 1 commit into
deps/sqlcfrom
deps/cache

Conversation

@Flo4604

@Flo4604 Flo4604 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Problem:

Otter v2 changes the cache API and expiry policy. A direct version bump could change overwrite TTL behavior.

Solution:

Migrate to Otter 2.3.0 with write-based expiry and an overwrite-expiry regression test.

Impact:

Preserves positive capacity/TTL checks and deletion metric labels. Eviction changes from S3-FIFO to W-TinyLFU.

Draft stack prerequisites: #7330 and #7320 through #7326. deps/integration-base is a merge-only review anchor, not implementation work to merge separately. Do not merge this stack into that anchor. After both prerequisites land, rebase the dependency stack onto current main and retarget bottom PR #7353 to main; keep later PRs based on the preceding layer. Existing prerequisite PRs are unchanged.

Testing:

Cache package passed 55 tests under the race detector in combined verification.

Final combined compatible stack (not an independent run of every intermediate PR):

  • mise run test --concurrency=4: 303 suites, 24,506 passed, zero failed, 7,875 ignored; 186 cached.
  • GOFLAGS=-race mise run test --concurrency=4: 303 suites, 24,506 passed, zero failed, 7,875 ignored; 279 cached.
  • mise run build: passed; lint reported zero issues.
  • Tagged control-plane suite: 25 passed.

Full normal and race runs used separate test-container scopes. The race run resumed after fixing the cancellation fixture. An earlier analytics-count timeout did not recur; its cause remains unconfirmed. These are local verification results, not a claim that draft CI ran or passed.

Keep positive capacity and TTL validation, overwrite expiration, and deletion metric labels. Cover overwrite expiry with virtual time. Otter v2 changes eviction from S3-FIFO to W-TinyLFU; cache entries remain best-effort.

Amp-Thread-ID: https://ampcode.com/threads/T-01a08089-bc34-7278-9e04-d691e62b07f9
Co-authored-by: Amp <amp@ampcode.com>
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dashboard Ready Ready Preview Sep 9, 2026 8:57am UTC
design Ready Ready Preview Sep 9, 2026 8:57am UTC

Request Review

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​maypok86/​otter/​v2@​v2.3.0100100100100100

View full report

@Flo4604
Flo4604 added this pull request to stack #7369 September 9, 2026 08:42
@Flo4604 Flo4604 changed the title cache: migrate to Otter v2 with write-based expiration cache: migrate to Otter v2 with write-based expiry Sep 9, 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