New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force sync on exit regardless how long replication was running #436
Comments
hifi
added a commit
to beeper/litestream
that referenced
this issue
Oct 4, 2022
Workaround for benbjohnson#436
hifi
added a commit
to beeper/litestream
that referenced
this issue
Apr 26, 2023
Workaround for benbjohnson#436
hifi
added a commit
to beeper/litestream
that referenced
this issue
Apr 26, 2023
Workaround for benbjohnson#436
hifi
added a commit
to beeper/litestream
that referenced
this issue
May 1, 2023
Workaround for benbjohnson#436
hifi
added a commit
to beeper/litestream
that referenced
this issue
May 7, 2023
Workaround for benbjohnson#436
athoscouto
pushed a commit
to chiselstrike/litestream
that referenced
this issue
May 30, 2023
Workaround for benbjohnson#436
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sync on exit isn't very robust on v0.3.9 or current main. If the replication is signaled immediately or the exec command terminates very quickly it's possible the database connection is never initialized and will never perform the final sync since it wasn't yet open. This is mainly possible because the connection is lazily initialized during the db
Sync()
call making the opening a bit racy and the close handler avoiding final sync if the database wasn't open.This is easily reproducible by a command line like this:
To make it succeed you can use a process that hangs around a little longer depending on replication target initialization speed:
We're using this to force a one off sync where we'd like the Litestream exit code to be non-zero if there's any issues with the replication target so we can hold off any operations that depend on successful replication outside normal operation.
The text was updated successfully, but these errors were encountered: