Skip to content

Conversation

sivukhin
Copy link
Contributor

@sivukhin sivukhin commented Aug 27, 2025

This PR makes plenty of changes to the sync engine among which the main ones are:

  1. Now, we have only single database file which we use to directly execute pull and push requests (so we don't have draft / synced databases)
  2. Last-write-win strategy were fixed a little bit - because before this PR insert-insert conflict wasn't resolved automatically
  3. Now sync engine can apply arbitrary transform function to the logical changes
  4. Sync-engine-aware checkpoint was implemented. Now, database created by sync-engine has explicit checkpoint() method which under the hood will use additional file to save frames needed for revert operation during pull
  5. Pull operation were separated into 2 phases internally: wait for changes & apply changes
    • The problem is that pull operation itself (e.g. apply) right now require exclusive lock to the sync engine and if user wants to pull & push independently this will be problematic (as pull will lock the db and push will never succeed)
  6. Added support for V1 pull protocol
  7. Exposed simple stats() method which return amount of pending cdc operations and current wal size

@sivukhin sivukhin requested a review from penberg as a code owner August 27, 2025 11:31
@penberg penberg merged commit e6ae7f9 into tursodatabase:main Aug 27, 2025
54 of 57 checks passed
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