Store world save variables at characters db#2825
Conversation
|
World states is already a term that exists, and it's something that's sent to client. We should not have confusing naming like this, because it implies that those are the same world states blizzard sends if you name the table like this, and that is not what it contains. Variables is our own custom indexes and values, not using blizzard's ids for stuff. |
|
or another permutation of these words? |
|
maybe world_persistent_variables? |
|
Oh yes, you're right, there are querys on |
|
I don't think it makes sense to change only |
|
Did not experience any issues with that change, but I agree that it makes sense to move the other tables as well, together with the variables. Will add some more changes when I have time. |
9e01003 to
bdf1813
Compare
bdf1813 to
a2e44cd
Compare
We are focusing on non-admin-command induced changes to the DB. The current war effort stage is stored in But (what you probably mean,) @schell244 Here are some sql snippets you can try to verify your changes. USE world; -- whatever your db name is
-- Creates `root_readonly` user with pw `root` which only has read access to all tables
CREATE USER 'root_readonly'@'%' IDENTIFIED BY 'root';
GRANT SELECT ON *.* TO 'root_readonly'@'%';
FLUSH PRIVILEGES;
-- Grad write permissions to game_event
GRANT INSERT, UPDATE, DELETE ON game_event TO 'root_readonly'@'%';
FLUSH PRIVILEGES;
-- Revoke write permission to game_event
REVOKE INSERT, UPDATE, DELETE ON game_event FROM 'root_readonly'@'%';
FLUSH PRIVILEGES; |
|
Why move only Considering:
I think this move should be done sooner rather than later. *: And yes, my stance still is that migration files should never be edited since that requires users to both actively track the repo for such changes AND manually intervene whenever they happen (unless they want to accept not getting those edits), when just creating a new migration that fixes whatever was wrong with the old one achieves the same end result without requiring manual intervention. (Side note: for vmangos-deploy I am in the process of automating my world DB correction system so I don't have to manually specify the edit commits anymore, and I will add the capture and re-application of those tables' data too since I had forgotten about that completely until now, which is how I found this PR) |
|
I don't know what are you guys talking about. Game events are not character data. They belong in world db. |
naming-wise sure, but architecturaly it makes sense to move it to char db, and have the world db become read only which can reduce ram usage, make upgrades and development easier, maybe even speed up server boot etc. |
Sorry for the delay - I’ve been a bit short on time lately, but I have this on my list. |
|
Btw I also believe that the We need to create an alternative |
I doubt on reduced ram usage and speed up boot. |
there is many ways to do this, eg. if you use separate mysql servers for world and everythung else, you can tune it for read workload and reduce useless caching (most of it is read only once, during boot). This can even go to the point where you just load the data and turn off the mysql instance dedicated to the world, but that would require more core changes. |
🍰 Pullrequest
Store world persistent variables in characters db.
This enables applying a fresh world db without losing any saved variables.
Refactored storage from a linear vector to an unordered_map for O(1) lookup, replaced the DELETE+INSERT transaction with a single REPLACE INTO, and removed the unused _InsertVariable and LoadVariable functions.
How2Test
world_persistent_variablesin the characters dbTodo / Checklist