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
Add Env Var to disable WAL journaling #11464
base: master
Are you sure you want to change the base?
Conversation
SQLite WAL journaling is not compatible with all filesystems/VFS extensions, causing the database being locked up in certain conditions. Add an env var to disable WAL journaling for better compatibility. Signed-off-by: gnattu <gnattuoc@me.com>
Why not make the option a string so users can set any journalmode they want? |
Because of too many potential user errors? |
I agree with making it an option. On supported systems this can improve DB performance right? So it can be beneficial in those cases. |
Also do we know exactly which filesysts have the issue? We can adjust packaging defaults if we know that. |
You cannot predict this, the user can literally use any filesystem they want. |
Will enabling pooling fix it? |
I'm not very sure because I don't have the exact environment of the users. Probably this needs to be an extra option to let the user choose. |
Signed-off-by: gnattu <gnattuoc@me.com>
Any easy way to try this out? |
I compiled a tarball for the docker image: https://github.com/gnattu/jellyfin/releases/tag/env-disable-wal Sorry but this is probably the easiest way I can prepare for you. |
Wouldn't it be better if |
Attempted to test this with a known Database is Locked file system use case, but the below compose seems to create a database still using WAL -
|
That'd explain why this didn't fix my issue lol |
I'm very interested to see if this does in fact improve the situation. Because from what I can tell, for use cases that work in 10.8, but not 10.9, the problem is the switch to MS.SQL from SQL.pretty - it seems MS has a performance hit compared to SQL.pretty on some FS setups that results in the database is locked issues (example NFSv3 storage with nolocks parameter - #11387.) Now the MS.SQL change needs to happen, if the plan is to open up other database backends - but that isn't available yet, so I don't know if this was required to do before that. If this WAL to TRUNCATE doesn't pan out, then I'll fork Jelly and reverse the changes from the below PR for a test. |
After testing I can confirm that Jellyfin does set the
|
I've was unable to produce a state with this package (fresh install) that doesn't end with the creation of the WAL file. Is it possible Jellyfin is making multiple connections to the database? It would seem that if any connection sets to WAL then all will see WAL unless they specifically change for their connection. https://www.sqlite.org/wal.html - Section 3.3
|
If I understand it right the persistency is stored into the database itself and the connection will be created in WAL on default. It should not affect the rest of the connection after marking it with TRUNCATE though. |
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
Changes
SQLite WAL journaling is not compatible with all filesystems/VFS extensions, causing the database being locked up in certain conditions.
It's worth noting that database lockup is just one potential issue that can arise from compatibility issues with certain filesystems. In some cases, the use of WAL can even lead to the database being saved in a non-consistent state, resulting in database corruption.
Add an env var to let the user to choose the Journal mode for better compatibility.
For example, when the default WAL is causing problems:
Issues