-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
WIP: Refactor server database #6263
Draft
Krzmbrzl
wants to merge
259
commits into
mumble-voip:master
Choose a base branch
from
Krzmbrzl:refac-database
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Krzmbrzl
force-pushed
the
refac-database
branch
5 times, most recently
from
January 1, 2024 13:39
a26dd78
to
28acdc8
Compare
Krzmbrzl
force-pushed
the
refac-database
branch
from
January 2, 2024 18:32
80c18a6
to
554762f
Compare
Krzmbrzl
force-pushed
the
refac-database
branch
2 times, most recently
from
March 7, 2024 20:00
2a149e9
to
825b6b1
Compare
Krzmbrzl
force-pushed
the
refac-database
branch
3 times, most recently
from
April 6, 2024 15:09
a0b5044
to
0cff06a
Compare
Krzmbrzl
force-pushed
the
refac-database
branch
2 times, most recently
from
May 20, 2024 06:54
3584ad3
to
62ac5fc
Compare
Krzmbrzl
force-pushed
the
refac-database
branch
9 times, most recently
from
June 6, 2024 17:37
8c00f1f
to
811cfa6
Compare
Krzmbrzl
force-pushed
the
refac-database
branch
2 times, most recently
from
June 23, 2024 14:43
de96b46
to
5c928be
Compare
Each supported backend can be excluded from the build separately
The dumped JSON format may not be 100% DB backend independent but it should be somewhat close to it. Implements mumble-voip#4980 Implements mumble-voip#2960 (must be done manually though)
Mumble treats usernames case-insensitively. However, in the server, there is a cache that maps usernames to IDs of registered users. We do lazy loading so when a given name is not yet in the cache, we check the database for a match and if that returns something, we insert the result into the cache. However, the DB does case-insensitive lookups whereas the cache used to be case-sensitive. Therefore, different casings of the same username could end up in the cache (all pointing to the same user ID). If that user got unregistered, only one of the possible ways of writing their name gets removed from the cache, leaving the other entries (which are now stale) untouched. This can cause problems when another user now wants to register with a name that corresponds to one of those stale cache entries. The server will think that the given username is already taken, ensuring leading to a rejection of the registration request. A server restart purges the stale entries from the cache. This commit ensures that the cache is now also operating in a case-insensitive manner such that we shouldn't ever create any duplicate entries in there in the first place. Fixes mumble-voip#6383
Krzmbrzl
force-pushed
the
refac-database
branch
from
August 20, 2024 17:47
576b7fe
to
74d873d
Compare
The expected behavior is to return an empty string as the name. However, the current code will run into a database error that will shut the server down.
Krzmbrzl
force-pushed
the
refac-database
branch
from
August 24, 2024 12:55
9534a87
to
31fb910
Compare
Krzmbrzl
force-pushed
the
refac-database
branch
from
August 24, 2024 13:01
31fb910
to
942a4a4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR completely rewrites the database handling on the server side. In so doing it cleans up and unifies the mess of the current implementation and adds proper unit testing support - in particular for data migration paths, which should provide an overall more reliable experience for users as the tests more or less guarantee that the data migration will work as intended. Additionally, since unit tests are run against all supported backends (SQLite, MySQL, PostgreSQL), all should work equally fine (at least from a functionality point of view).
As a bonus, the dependence on Qt for the database handling is completely removed. Instead, the new framework is built on SOCI.
Fixes #4980 (data can now be exported to and imported from JSON)
Fixes #4717 (all database backends are now unit-tested for dealing with unicode characters)
Fixes #3795 (all operations on the database are now encapsulated in transactions)
Fixes #3666
Fixes #3588 (we are using a completely new backend and new code - hopefully this fixes the issue)
Fixes #3254 (again: transactions should prevent database corruption from happening - unless there is a bug in the code)
Fixes #2960 (backups can now be done by explicitly exporting data to JSON - it's up to the user though. No automatic backup implemented)
Fixes #6283
Fixes #6383
Fixes #3796 (we don't hardcode timeouts, so this was likely a Qt thing - new backend, new hope :D )
Fixes #6332
Checks