-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
LevelDB player data storage #5467
Conversation
This does NOT convert older stored data - just allows storing data in LevelDB. This changes the default format used by new servers, but existing servers will continue to use the old datfile storage system for now.
No migrator? |
See follow-up section. |
Main problem with this PR is that it's not possible to delete a specific player's data. The |
this is restricted to console to match the access level previously needed to delete player.dat files.
Closing this as I don't think it's worth the migration effort. Between key ordering, and storing values in the same place as keys (requiring rewriting of values on DB sort), LevelDB is really poorly suited to any form of blob data storage, as we've seen with the performance issues of large worlds. Considering that player data total size could easily reach multiple GB on highly active servers, this change would likely cause paying a large compaction performance hit. Again, this would be for data ordering which we don't even want anyway. It may still be worth keeping a LevelDB in the playerdata to allow mapping player identifiers to the files their data are stored in, e.g. LevelDB containing maps of:
This would allow solving some old issues with player data identification. However, putting the data in LevelDB directly is likely to cause performance degradation for large servers. An alternative like RocksDB's BlobDB would be much better suited to a task like this. |
Introduction
This PR implements a LevelDB player data storage provider.
Relevant issues
I previously wrote about this in #4077, including its advantages and disadvantages.
Changes
API changes
No public APIs were changed by this PR. However, a new class
LevelDBPlayerDataProvider
has been added to thepocketmine\player
namespace.Behavioural changes
player.default-data-format
is added topocketmine.yml
, with optionsleveldb
anddatfile
.leveldb
is now used by default for new servers. Servers with existing data will continue to automatically use the olddatfile
storage provider unless they delete theirpocketmine.yml
or add the newplayer.default-data-format
option to theirpocketmine.yml
.Backwards compatibility
No backwards compatibility issues currently known.
Follow-up
Convert data from the
datfile
storage system toleveldb
. This would require some kind of format detection to enable this.Tests
Tested locally using both
datfile
andleveldb
configuration options. Everything seems to work as expected.