-
Notifications
You must be signed in to change notification settings - Fork 902
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
litestream
recommendation may lead to crashes?
#4860
Comments
Hm, ok. I was actually wondering how it was doing replication, and someone said they'd be using the wal, and not locking the DB. If, despite following the document regarding setup (enabling wal mode), it crashes we should remove that recommendation altogether. |
I strongly suspect #4857 root cause is Note that we now have a 5-second timer on |
Anyway, to clarify: The advantage of using the WAL file is that |
Closes: ElementsProject#4860 ChangeLog-Added: With `sqlite3` db backend we now use a 60-second busy timer, to allow backup processes like `litestream` to operate safely.
Closes: #4860 ChangeLog-Added: With `sqlite3` db backend we now use a 60-second busy timer, to allow backup processes like `litestream` to operate safely.
In
BACKUP.md
we have a recommendation to uselitestream
. However, I snuck a look at the officiallitestream
online docs:In filesystem terms, that "read transaction" is an advisory shared lock on the database file. When the SQLITE instance running inside
lightningd
wants to write to the database file (and we write all the time, you should see the blinkenlights on the SSD on my Pi), however, it demands an advisory exclusive lock.SQLITE will auto-retry the advisory lock for some time (I believe we actually explicitly set this timeout somewhere...? need to dig). However after a while it will quit with "database is locked" and then
lightningd
kills itself.Note that in
BACKUP.md
we recommend against usingsqlite3
.dump
orVACUUM INTO
(the last paragraph). Litestream is actually similar to an efficient.dump
(it only copies (part of) the WAL file instead of dumping the entire database), but this is a difference in quantity and not quality: the backup process read-locks the file, and we write-lock very often, and on slow HDDs or high-load systems the timeout on the write-lock retry can be reached. If we disrecommendsqlite3
.dump
I think we should disrecommend againstlitestream
as well (or if the quantity is fairly low enough, maybe put up warnings at the very least, and movelitestream
to after the "copy the file" section).The text was updated successfully, but these errors were encountered: