-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
[experiment] add alternative wasm sqlite3 implementation available via build-tag #2863
[experiment] add alternative wasm sqlite3 implementation available via build-tag #2863
Conversation
I would suggest that we keep the retry on busy handling, as it is still applicable to us: https://www.sqlite.org/wal.html#sometimes_queries_return_sqlite_busy_in_wal_mode Also, we do let clients choose whether to use wal mode or not, and if they don't use wal mode for whatever reason, the busy handler will be much more necessary. |
We should probably change that honestly. Letting clients chose the mode isn't really necessary, unless there's some evidence of WAL performing worse for people. But I suspect the evidence goes in the other direction, and it limits the amount of things we have to think about when someone reports a database performance issue. Since we have the transpile or the WASM build we can rely on WAL always being available no matter the SQLite version any distro ships. |
Agreed. Also doing it now will be especially easier since we still have the "alpha" tag, where changes like this are more to be expected. |
a533b55
to
4a5d7b1
Compare
I took a quick look at the tests, a lot of the failures are in typeutils and the only difference seems to be the resulting url starting with http vs https. Probably just a config setting? The rest is just "database is closed" which seems to cause goroutine blockage/runtime hangs. |
c987d50
to
cc5cb79
Compare
Only thing that fails now is the envparsing test: --- /tmp/tmp.IALNpE
+++ /tmp/tmp.JgNPAF
@@ -74,13 +74,13 @@
"db-tls-mode": "disable",
"db-type": "sqlite",
"db-user": "sex-haver",
- "dry-run": false,
+ "dry-run": true,
"email": "",
"host": "example.com",
"http-client": {
- "allow-ips": null,
- "block-ips": null,
- "timeout": 0,
+ "allow-ips": [],
+ "block-ips": [],
+ "timeout": 10000000000,
"tls-insecure-skip-verify": false
},
"instance-deliver-to-shared-inboxes": false, I'm guessing it needs a rebase and that should be it. |
0f486eb
to
147a1fd
Compare
t'was actually a package init function in testrig i added messing with it. a little confusing and hard to narrow down but caught it in the end :) |
All the tests pass omgomgomg 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Giving @tsmethurst some time to review it next week but LGTM shipit all the things.
This mostly looks good to me, but I would still recommend we keep the retry on busy handler, as even if we at some point force admins to always use WAL mode, it's still important to implement retry on busy, as there are cases where it will be hit. From the SQLite docs:
|
Sorry to interject, but AFAIK, those cases are still covered by AFAIK, the only situation where SQLite returns So if you use |
Indeed. We're currently setting Previously we added the retryBusy handler in our own code (as well as setting a fairly generous busy_timeout duration) as we were having issues with an older version of modernc.org/sqlite still returning quite a few SQLITE_BUSY errors. This doesn't seem to happen anymore fortunately, (I wonder if their busy handler was perhaps misbehaving previously). |
Aha OK thanks for clarifying @ncruces and @NyaaaWhatsUpDoc :) |
…a build-tag (superseriousbusiness#2863) This allows for building GoToSocial with [SQLite transpiled to WASM](https://github.com/ncruces/go-sqlite3) and accessed through [Wazero](https://wazero.io/).
…a build-tag (superseriousbusiness#2863) This allows for building GoToSocial with [SQLite transpiled to WASM](https://github.com/ncruces/go-sqlite3) and accessed through [Wazero](https://wazero.io/).
Description
wasmsqlite3
build tagsame needs to be done for postgres eventuallyChecklist
go fmt ./...
andgolangci-lint run
.