Skip to content

Ensure all objects are installed into local storage when restoring from a snapshot - #6543

Merged
kim merged 1 commit into
kim/tiered-storage-integrationfrom
kim/snapshot-restore
Nov 12, 2026
Merged

kim merged 1 commit into
kim/tiered-storage-integrationfrom
kim/snapshot-restore

Conversation

@kim

@kim kim commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

This works by first installing all objects as resident, and then evicting until the low watermark is reached.

Not yet optimal, as we could use hardlinks instead of flushing.

The guarantee that a catalog entry that has a permit was written by the same storage instance allows to skip redundant writes.

API and ABI breaking changes

N/A

Rollback safety impact

N/A

Expected complexity level and risk

2

Testing

Existing

@kim
kim force-pushed the kim/snapshot-restore branch from 57a24fe to 58d9cb4 Compare November 10, 2026 15:16
@kim

kim commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

I meant to check at the end of restore_from_snapshot if, after trimming, the memory budget is met. So, this is not ready yet.

This would, however, make it possible for a database to crash-loop if the budget is smaller than what was allowed before the database restarted.

@kim

kim commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

if, after trimming, the memory budget is met.

Instead of crashing, we could also let the database come up. It will be queryable, but the eviction triggered by a write is likely going to throw a budget error -- which will be observable by the client. This is potentially better UX, and won't waste cycles repeatedly restarting the database.

What do you think @joshua-spacetime?

@kim
kim force-pushed the kim/snapshot-restore branch from 58d9cb4 to 5de6862 Compare November 11, 2026 09:55
@joshua-spacetime

Copy link
Copy Markdown
Collaborator

Instead of crashing, we could also let the database come up.

I'm in favor of this. It would also give users an opportunity to delete data right?

@joshua-spacetime

Copy link
Copy Markdown
Collaborator

It would also give users an opportunity to delete data right?

Well maybe not if it can't allocate a temporary page for the deletes.

@joshua-spacetime
joshua-spacetime changed the base branch from kim/local-disk-eviction to kim/tiered-storage-integration November 11, 2026 20:02
a snapshot.

This works by first installing all objects as resident, and then
evicting until the low watermark is reached.

Not yet optimal, as we could use hardlinks instead of flushing.

The guarantee that a catalog entry that has a permit was written by the
same storage instance allows to skip redundant writes.
@kim
kim merged commit 88b9570 into kim/tiered-storage-integration Nov 12, 2026
66 of 69 checks passed
@kim
kim deleted the kim/snapshot-restore branch November 12, 2026 07:17
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.

2 participants