-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
I/O error on XFS #230
Comments
I wanna be helpful here, but I have to be honest: we don't have a lot to go on here. The problem with SQLite is that the API, by design, converts errors into an error code that gives us very little information about what's going on. Code 778 just means a write failed, little else. There's a provision in the API to remember the last OS error… but it's ignored by SQLite. Then there's a form of debug logging, but (1) I dunno if GoToSocial has a way to enable it (through configuration) and (2) I haven't done my part for IO errors, so although more logging would always be helpful in a situation like this, it might not catch the specific error causing this. The way I would go about this, if I had a reproducer, would be to add some hard coded logging in the source code and try to figure out more that way. But, at a minimum that involves building from source. In the future, this is something I whish I could spend the time improving, has it has bitten me sometimes already. For today, I'm interested, but I'm not sure how we could arrange a debugging session. You send me a reproducer (I don't really want your sensitive data)? I send you modified source code? Can we make the test case smaller, @tsmethurst a binary that just does the migrations? I'm sorry if that's not very helpful. |
In principle, it's not even hard to know where the error is coming from, it pretty much has to be from this line: Lines 180 to 181 in 93049c2
As it's the only line in the entire source that generates that error. The problem is that the Go The easy hack is to just to add a log there, rebuild, try again, see what pops. The long and hard is to again reconsider how I could surface the information in a way the application decides what happens. We want observability when needed, but not needless log spam. This is the kind of stuff where this driver is probably still too immature. 🫣 |
All migrations are run on launch, including for brand new instances :) so you should be able to replicate this pretty easily! If you push something on a branch I'm happy to pull it into gts and build it for @pfactum to try out. |
Branch issue230 should be enough to log that error (and potentially others), without spamming the logs with transient conditions.
|
For the future, the correct course of action, I guess, is that you call Right now, you'd only get internal SQLite error logs (not VFS and OS errors), because I haven't really done my job at the VFS level. At a time, I implemented SQLite developers simply gave up on the idea of surfacing this through the normal error path, which would produce informative error messages at the place they reach the caller, And that's just the SQLite way… I'm kinda tied here. Footnotes
|
Alright! I've built a binary with that branch of go-sqlite3 :) You can download the binary from here @pfactum: https://minio.s3.superseriousbusiness.org/browser/gotosocial-snapshots/xfs_poking%2Fgotosocial Could you run it against your db backup on one of your xfs filesystems, grep for |
Interesting:
Why all of a sudden:
? |
If so, I think the issue is not with XFS or anything like that, it's just that my local machine with Btrfs has got much more RAM to handle the migration with writes like this into |
This is already something I need to fix, and which is on my to-do: review all error codes (again), because this one should be singled out as |
This is hardly unexpected in a migration. SQLite likely (even if not at explicit request of GoToSocial) creates a temporary table or index to facilitate the process. In the default configuration of For more, start reading from here: As noted in the above page, apps can change the directory used for temporaries with a PRAGMA. I'll look into supporting the |
So, just for the record, I've managed to complete the migration on a production host by temporarily setting Since this is not an FS issue, you may want to repurpose this report for more accurate VFS error reporting and/or for Thank you. |
(@tsmethurst asked me to file this bugreport here.)
Hello.
I'm upgrading my GoToSocial instance from v0.17.4 to v0.18.0. During the SQLite DB migration process the following error occurs:
This happens with
db-sqlite-journal-mode
set toWAL
(it's a default value in GtS) and on XFS filesystem.If I set
db-sqlite-journal-mode
toOFF
, the migration succeeds on XFS filesystem.If I keep
db-sqlite-journal-mode
set toWAL
, but use Btrfs filesystem, the migration succeeds too.Playing with
db-sqlite-synchronous
values didn't make any difference.I didn't have this issue during previous migrations on GtS v0.17.x and earlier.
I assume GtS had
go-sqlite3
updated in v0.18.0. I do not have any other details, but as I've got a reliable reproducer, I can collect any additional info as needed.Thank you.
The text was updated successfully, but these errors were encountered: