GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Database-wide eviction for (some) reads by joshua-spacetime · Pull Request #6607 · clockworklabs/SpacetimeDB

Conversation

@joshua-spacetime

@joshua-spacetime joshua-spacetime commented Nov 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Description of Changes

Before this change, a read could hit the resident-memory limit even when another table had evictable pages. The existing retry could only free memory from the page or blob set being accessed.

On a resident-memory error, ordinary datastore reads now request eviction of eligible committed pages and blobs, then retry once. This covers point lookups, equality and range scans, full-table scans, and reads used for view maintenance.

Iterators retry the same page or row rather than advancing again, so a failed attempt cannot cause a row to be skipped. Eviction runs after the failed access has released its temporary guards. Other errors propagate normally.

The change uses a borrowed eviction context to call the existing committed-state trimmer.

API and ABI breaking changes

None.

Rollback safety impact

n/a

Expected complexity level and risk

3

Retries must read the same row without skipping it, and must release temporary read locks before requesting eviction.

Testing

Manual.

Updated the keynote benchmark to use a 4MiB cache and updated transfer to read and compare a 2MiB string.

Loading the string forces a blob fault that needs 2 MiB of resident memory. The cache already contains account pages, leaving insufficient space.

So before this change:

  1. The indexed lookup finds the probe row, whose blob has been evicted to disk.
  2. Loading the blob needs a 2 MiB reservation.
  3. The blob store tries evicting other blobs, but there are none it can evict to make enough room.
  4. The accounts table has evictable pages occupying that same memory budget, but the blob store cannot evict those pages.
  5. The read returns MemoryLimitExceeded, failing the transfer before any account updates.

After this change:

  1. The same read initially encounters the same allocation failure.
  2. Our read-retry handler asks the committed state to evict across tables.
  3. It evicts account pages, freeing enough memory.
  4. It retries the same lookup. The blob now fits, its contents are verified, and the transfer proceeds.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@joshua-spacetime
Database-wide eviction for (some) reads
2cb5d57
@joshua-spacetime
joshua-spacetime requested a review from kim November 16, 2026 19:11
@joshua-spacetime
joshua-spacetime merged commit c660db7 into kim/tiered-storage-integration Nov 16, 2026
66 of 71 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kim
kim deleted the joshua/eviction-for-reads branch November 17, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kim kim Awaiting requested review from kim

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@joshua-spacetime
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.