Option to pause writes to SQLite DB on plugin?
Hi all,
First off, I just want to say I'm a huge fan of DH. It's a fantastic mod — really great work.
TL;DR: I'm trying to back up my server's MC data folder (ideally including the generated LODs) without needing to shut down the server.
I've looked through the plugin's code on GitHub to check for command-line options and found the ability to pause LOD auto-generation. However, I didn't find any way to pause all writes to the database entirely.
Am I correct in assuming that such a feature doesn’t currently exist?
For context:
I'm running a PaperMC server with the DH plugin, and I’ve configured Borg to perform nightly backups. The problem is that because the plugin appears to continuously write to the database (possibly due to LOD data being streamed from clients?), the backup sometimes fails while players are connected.
Any suggestions or clarification would be much appreciated. Thanks again for all your work!
Solution:Jump to solution
You can do
/dhs pause
and /dhs unpause
to toggle generation on/off globally12 Replies
If there's no way to pause writes to the DB, I can also change my backup to exclude it
clients don't send LOD data to the server, and such a feature probably will never be added as it could be very easily exploited
As for help with your issue you will need to wait for Jckf (plugin dev) to see this
Though I don't think what you want is possible
Ah, yeah that makes sense. Good decision not to allow client LODs to be sent to the server (I was secretly hoping that was a misunderstanding on my part)
Thanks for your reply!
Spent some more time looking over the code. I think that database writes are only triggered when a new LOD is generated, so if I set
distant_generation_enabled
to false in the config.yml and disable pregen, then send a reload command, that might do the trick. I'd have to test it out thoughDistant generation though is only generation outside of vanilla RD
Inside the vanilla RD LODs can still be generated, at least they do in the mod version
Also LOD updates when players place or destroy blocks
hmmm i wasn't aware of that
You are correct that this feature doesn't exist. Maybe I could add a simple pause command
Pausing the database to allow an online backup of the server... I didn't even consider that.
Being here I see more and more differences in how modded and plugin servers differ in how they are run and what features they need
GitLab
Commands to pause/unpause all generation. (d736b7a5) · Commits · ...
Add support for Distant Horizons to your Bukkit server.
Solution
You can do
/dhs pause
and /dhs unpause
to toggle generation on/off globallyRequest for existing LODs will still be fulfilled by reading the database, but no new LODs will be generated and no existing LOD will be updated
This should effectively result in a consistent database state during backups
Try to avoid leaving it paused for too long, since requests will accumulate during that time.
(Each player can have up to
full_data_request_concurrency_limit
+ login_data_sync_rc_limit
requests pending)Übermensch @Jckf (GMT+2)
Sorry I haven't checked back in a while, been traveling for work. Thanks a bunch for doing this!