Skip to content

Add main-thread incremental snapshots (snapshot-mode forkless) - #62

Merged
GoDeskio merged 1 commit into
unstablefrom
cursor/forkless-snapshot-afeb
Nov 5, 2026
Merged

GoDeskio merged 1 commit into
unstablefrom
cursor/forkless-snapshot-afeb

Conversation

@GoDeskio

Copy link
Copy Markdown
Owner

Summary

  • Adds snapshot-mode forkless, a main-thread RDB writer that saves a slice of keys per event-loop tick.
  • Before a not-yet-saved key is overwritten or deleted, its pre-image is written into the snapshot, so the file matches the keyspace at BGSAVE start without fork().
  • The temp file is renamed onto the dump only after the footer and fsync. A crash mid-snapshot leaves the previous dump in place.
  • This path does not set cur_bgsave_type to the existing background-thread forkless saver, so the two implementations do not claim the same save.

Tests

  • ./runtest --single unit/forkless-snapshot: consistency against DEBUG DIGEST, memory under 1.2x the dataset, latency while a snapshot is open, crash mid-snapshot, and a cluster primary.
  • Full suite from this branch: make test — 5879 passed, 0 failed.

Default remains snapshot-mode fork.

Open in Web Open in Cursor 

Rebased onto unstable; kept CRDT hooks from #61 alongside forkless snapshot.
@GoDeskio
GoDeskio force-pushed the cursor/forkless-snapshot-afeb branch from a7c3309 to 085445f Compare November 5, 2026 10:49
@GoDeskio
GoDeskio merged commit 85aa7ae into unstable Nov 5, 2026
59 of 95 checks passed
GoDeskio added a commit that referenced this pull request Nov 5, 2026
Rebased onto unstable after forkless snapshot (#62); kept CRDT, hybrid flash, and forkless hooks.
GoDeskio added a commit that referenced this pull request Nov 5, 2026
Rebased onto unstable after forkless snapshot (#62); kept CRDT, hybrid flash, and forkless hooks.

Co-authored-by: GoDesk <GoDeskio@users.noreply.github.com>
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