Temporary permissions are not deleted from the database
Closed this issue ยท 13 comments
If you give lp /user user group.deluxe settemp 30d it will never be deleted from database (at least those who were not on the server until perm expire)
How to unset all expiried perms automatically??
LuckPerms-Bukkit-4.0.126
Storage MySQL
Why should I store this data? Unlikely if one percent of these players will return, SO for what purposes do I store megabytes of blank information?
Can u add option to clean DB automatically?
I highly doubt it will account for megabytes worth of data, you'd need to have hundreds of thousands of temporary records sitting there.
Yes, it would be possible to prune the really old stuff.
Perhaps have it as a separate command
lp/lpb cleanup
for example.
This will cater/cover those that are using shared/webhosting based MySQL or have restrictions based on their MySQL access.
If you want there are many plugins that can execute commands on queue. Hell even if your using shell scripts via screen/tmux you can cron job it.
@wConstruct why the ๐ ?
Seems like a valid solution to your issue, hm?
Because in the WIKI description is written a completely different:
Temporary permissions are audited once every 3 seconds, to check if they have expired. This check happens regardless of the sync interval setting. This means that you can safely set temporary permissions to expire after a matter of seconds, and they will be removed on-time.
Yes, that's accurate.
However, only permissions for online players and groups are checked.
A lot of the storage systems are not relational - it's not cheap to scan all records and remove the expired ones.
The relative "cost" of using more disk space outweighs the "cost" of spending CPU and I/O time on cleaning up old entries.
Confused from this solution!
/lp group listmembers - also outputs expired group members and I do not understand why there are not negative values
1514560807 shows me expires in 1 month 8 days 19 hours
I've changed my mind about this - it's not straightforward to implement for non-SQL data types, and I don't think it's worth only adding it for the SQL ones.
You should be able to purge old data yourself using this query:
DELETE FROM luckperms_user_permissions WHERE expiry < UNIX_TIMESTAMP()
I still stand by this:
I highly doubt it will account for megabytes worth of data, you'd need to have hundreds of thousands of temporary records sitting there.
On one of the servers I run, we have 400k permission records - still only a few megabytes. Adding a specific command to prune temporary records isn't necessary imo.
You should be able to purge old data yourself using this query:
Perhaps have a separate wiki page @lucko with warning (think firefox page when you try about:config
) with that mysql query - so next some someone asks it can easily be pointed towards with a "here there be dragons" type warning ๐