-
Notifications
You must be signed in to change notification settings - Fork 22
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
Repair UUIDs duplicates (storage 3.1 upgrade) #143
Conversation
Else it can't be ran with mtt
Triggers luacheck because the blank value is unused. Just give it nil value.
Due to uncompatibility with LuaJIT
did i read this correctly: the "repair" code runs on every startup, right? and: are you sure this is needed, uuid collisions should be borderline impossible :/ |
Could you @Athozus or @Bastrabun reveal what is the issue with current RNG or implementation? And if there's issues with RNG on Your Land could it be that RNG is compromised by one of the mods? It is true that it is easy to trash math.random, if that's the issue then better solution would be to use Minetest's own RNG API like PcgRandom which you could, if you feel paranoid, initialize with SecureRandom. |
If it is to fix duplicates caused by now fixed bug then you could just automatically run it once and then increment database version to v3.1 or v4 depending on which number you like most / if you want to use some versioning scheme that differentiates breaking changes from bug fixes and feature additions. |
v3.1 is a good way to do it, indeed. |
Applied your suggestions 👍 |
|
I guess it is issue with action runner, not mail mod. @BuckarooBanzay might have idea. |
had that somewhere else yesterday too, seems like a github issue, just ignore it :) @Bastrabun could please elaborate on the uuid/rng-issue, i'm curious how something like this would happen 🤔 |
I ran it, it was fixed, thanks ! |
The risk is ridiculous compared to the performance lost, even for several millions of messages.
Applied you suggestions in latest commit c052e59. Sounds ready to merge (I requested a review anyway). So now it focuses only on The risk was of 1 over 1630.12 = 1,6.1037. Minetest servers can be very popular, but 😁 |
Btw, it was not an error from RNG, it was due to the bug fixed in #137, which use the selected message id into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks sane-ish, didn't have time to test though :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestions for migrate.lua, don't really care if these get applied or not.
util/uuid.lua however should be just reverted to master branch as it has not been changed other than whitespace.
Drop uuid.lua from changeset and fine for me then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, didn't test however.
Note that it is still upgrading to |
This is a proposal for the most important hotfix of this release. What does it do ?
migrate.lua
, it checks for non-duplicates, and if there are, it gives new ID to all messages that are not the same (mail.are_message_sames()
). Of course, because it iterates through all messages, after fixing message1, it checks message2, so if there is a message3 also concerned by the duplicate, it is fixed in the message2 loop.I tested it with 10 000 messages, it runs quite good (no performance loss). If you want to test it, you can use the
/mail_spam
command written in #103.Of course, performance can still be improved, but that's not really a mess here.
I ping @Bastrabun because he was the first who noticed the issue on Your Land.
Fix #122, #126.