Skip to content
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

Start of work on dqlite revamp #535

Merged
merged 4 commits into from
Oct 17, 2023
Merged

Conversation

cole-miller
Copy link
Contributor

This is the first chunk of work on the new design for data storage/VFS on the dqlite side. It's exclusively scaffolding to set up the new DB thread and prepare to pass things to it.

The next step is to work out how clients on the main thread will cause databases to be opened on the main thread -- we can probably re-use the DB registry code here. Likewise for preparing statements. This will involve writing a proper main loop for the DB thread. (I think it makes sense to keep the "old way" code around, working in parallel, while the "new way" code is being developed.) After that the main thread should be able to pass (parsed versions of) client requests to the DB thread -- maybe just EXEC or EXEC_SQL to start, if that's easier. That will set things up to start working on the new VFS.

Signed-off-by: Cole Miller cole.miller@canonical.com

Signed-off-by: Cole Miller <cole.miller@canonical.com>
Rationale: we want client request parsing to happen on the main thread,
and we want everything beginning with sqlite3_prepare_v2 to happen on
the DB thread (since the DB will have the database open with the
appropriate VFS).

There is an unresolved issue that the parsed statement parameters borrow
from the gateway's request buffer, so we need to ensure that the DB
thread finishes its work before that buffer ends its lifetime.

Signed-off-by: Cole Miller <cole.miller@canonical.com>
Signed-off-by: Cole Miller <cole.miller@canonical.com>
Signed-off-by: Cole Miller <cole.miller@canonical.com>
@MathieuBordere MathieuBordere merged commit b437252 into canonical:revamp Oct 17, 2023
1 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants