-
Notifications
You must be signed in to change notification settings - Fork 6
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
Database Not Being Checkpointed? #31
Comments
might help: 2c8df3e I ran a simple test where I repeatedly insert an unlimited number of rows into |
Per 2c8df3e#commitcomment-99243585 https://stackoverflow.com/questions/16547263/clarification-regarding-journal-size-limit-in-sqlite I now believe that the issue is that a transaction is very long-lived. I think it's almost certainly |
Now that the scanner transaction is closed every second, there should be no more SQL transactions that remain open for the entire duration of a backup. This should hopefully allow the WAL to be truncated, as the |
I'm not sure if it's related, but I got the "somehow something isn't being synchronized" panic on the first run with 305f560. |
oof, sorry again, try with 490a805 bug seems to have been introduced accidentally here: ca6b0b0#diff-7b8b15093cd777455c713b59054b2fa528b1879a817e1e3a927a89f241dba45aL264-R207 this should fix the race condition that I vaguely remember trying to fix in that commit, by computing |
Looking good now |
This might have introduced a race condition. Just got the following panic with 67825d5.
|
Hm, strange! I've just taken a quick look and I have no idea how that could happen, fascinating. Do you have the rest of the log perhaps? For example did it print I guess this could be caused if |
Sorry, I don't have the rest of the log. I'll keep an eye out for it again. While looking into this, I think I found a bug in |
I think that is unlikely because the ticker only sends a tick on the channel once a second. Committing then reopening an empty transaction that hasn't written anything will certainly take less than that I think? |
nevertheless here you go 65c4006 |
Ah, so maybe just one extra time through the cycle. First commit could be slow so that next time through |
Yeah. And on top of which, the scanner that uses this tx is doing so read-only, so even the first commit should be fast since there isn't any data to commit. Although maybe the idea might be that it is slow because it is the last tx standing that's pinning the WAL journal, and when it commits SQLite will now take the time to integrate the WAL into the main db file. Better safe than sorry though I'll leave that last commit in. |
It looks like the SQLite database isn't getting checkpointed during a run of
gb backup
.The WAL is growing to many times the ultimate size of the database, and the database isn't getting checkpointed until the backup completes. During a long backup, the WAL grew for my database grew to 45GB; the database ended up being about 5GB.
The text was updated successfully, but these errors were encountered: