Administrator reports: Add a LBM to detect nether blo ... #5507
Labels
No Label
1. kind/balancing
1. kind/breaking
1. kind/bug
1. kind/construction
1. kind/documentation
1. kind/enhancement
1. kind/griefing
1. kind/invalid
1. kind/meme
1. kind/node limit
1. kind/other
1. kind/protocol
2. prio/controversial
2. prio/critical
2. prio/elevated
2. prio/good first issue
2. prio/interesting
2. prio/low
3. source/art
3. source/client
3. source/engine
3. source/ingame
3. source/integration
3. source/lag
3. source/license
3. source/mod upstream
3. source/unknown
3. source/website
4. step/approved
4. step/at work
4. step/blocked
4. step/discussion
4. step/help wanted
4. step/needs confirmation
4. step/partially fixed
4. step/question
4. step/ready to deploy
4. step/ready to QA test
4. step/want approval
5. result/cannot reproduce
5. result/duplicate
5. result/fixed
5. result/maybe
5. result/wontfix
ugh/petz
ugh/QA main
ugh/QA NOK
ugh/QA OK
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#5507
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Administrator reports a bug:
Player position:
Player look:
Player information:
Player meta:
Log identifier
Profiler save:
Status:
Teleport command:
Compass command:
This may be prone to lot of false alarms if someone uses nether blocks in construction of underground base (like nether basalt, favored for its explosion-proof qualities) and then visits it often.
If it is supposed to catch existing blocks, wouldn't a one-off script/program to scan current blocks in a database perform a better job?
This LBM is meant to catch wrongly generated nether only and is meant to run on each mapblock only once.
There may be false positives, but those are easy to detect.
I wish we had a way to look into the database direct and perform operations in the background or even on the testserver, where the generated area is present as well, but currently there is no such thing. If you know how to make such a script, go ahead, we'd be pretty happy :)
Especailly if it can also detect entities as well.
The database is on psotgres and around 175Gb in a backup state, so it will take a LOT of tiem to run through the whole of it.
i've got an old (1 year?) copy of the database that's more than new enough to have all the relevant blocks in it, and a script to process the database and extract the nodenames, which i could adjust to identify mapblocks with nether nodes in them below -25000. however, if i remember right, it takes over a week to run, and my laptop doesn't understand batteries anymore, so that's a problem...
I have a dev system on a nice and fast machine. Could you teach me to use the script or is that rocket science?
True, you can have once-per-each-block ABM, but areas far away may still elude detection for long time.
I can use my java program as a base and rip some unnecessary functionality from it (like counting inventory in drawers within given areas, etc ...) and add some mode that will hunt for blocks with defined nodes. Connection is now hardcoded to sqlite file, but adding Postgresql drivers is fairly simple.
Processing 4.2M blocks (2.3 GB of raw compressed blocks) took it 95 seconds .... so I'm guessing the 175G world should be scannable within approx 2 hours (assuming fast enough network between the machine running the tool and the database server). Possibly faster if I add some multi-threading support. Some optimizations (like not examining blocks above ground) may make it even faster. If 2 hours is less than LOT, then that could be viable.
At the moment it does not support entities, but I may need to add that in the future to deal with remnants of petz infestation on my private server ... so in future maybe :)
let me adapt it to find nether nodes and then send it your way. it's not too hard to use.
this should work. tested against a small sqlite database locally.
usage:
first, make sure you're running this against a database that's been fully updated to the 5.7.0 format - the code doesn't know how to read the older format.
then, make sure you've got progressbar2, psycopg2, and pyzstd in your python environment (use pip or whatever your favorite tool is).
then run:
this will produce a file called "output" which contains a list of pairs of coordinates - the first are the "block position", and the second are the coordinates of the "small" corner of the block.
yeah, i think i was remembering the wrong step in the process taking over a week. that was updating the whole database to the 5.7.0 map format. whatever minetest is doing seems fairly inefficient.
I will probably also have to update the MT database first. I can't do that on a live and running server, right?
Since this is a tool every MT admin of a major server may need at one time or another, maybe make it a repo and publish it?
Due to the map size (175GB of blocks) and usual block compression ratio, converting from old format to new one means decompressing approximately 5 terabytes of data (that is fast) and re-compressing it (that is not that fast and is probably why it has taken a week to do). The compression cannot be made significantly faster, although the block converting can be easily parallelized. More computers/cpu cores -> less time.
During "recompresssing" I have a lot of those:
the script i sent you is based off the script that i publish w/ my moreblocks fork, to generate a whitelist of used nodes in order to reduce node count.
but i agree that some admin's needs might be served by the script. but i'm not sure how to publish it. maybe the minetest forums? i hate the forums, every page there takes 30 seconds to load for me, and the search results are miserable. but some people do use it...
This is the recompress feature:
61db32beee/src/main.cpp (L1234)
Even on my numbercruncher and an older database of most likely 160GB, it would run ~30 hours and it needs the server stopped at that time.
Suggestion by two smart people on discord: Make a mechanic to run through all emerged mapblocks, drag them into memory and store them again.
Other option is to cut the database in pieces, migrate them separately and then restore them back
We could also pester MT devs about it, but I doubt there's much chance
The issue is not timecritical per se, but the longer we wait, the larger the database grows. Currently we're at 185GB each export and 414 856 973 mapblocks stored.
github/gitlab or something like that?
could be some lua code running on server adding some garbage entity to a block and immediately removing it again. This will trigger writing "modified" blocks to disk. As server is already running 5.7, part of the blocks would be already converted, I guess?
Block version is first byte of the block, so should be fairly easy and fast to extract from the running server and see what block has what version.
Would be hard to do with regard to synchronization (block modified by both people on server and the recompress)
Make a change in MT branch and if it will not get adopted in mainline in the end ... well, not your problem :)
More info on the recompress problem:
This way it will only touch the "wrong" version ones, not recompress everything.
Here's the iterator:
61db32beee/src/database/database-postgresql.cpp (L300)
We need to test what exactly happens there and which order they take, then we can maybe cheat it and manually start and stop it for smaller parts.
Yes, the order may change upon restores. That's why we can try on the testserver dump to see how long it may take and then guess towards the live dump after we migrated to the new machine.
i hope to get my server w/ my copy of the map back online soon, i can probably run the script myself then and post the results here.
Here's a rust project to read the world: https://github.com/UgnilJoZ/rust-minetestworld
I added it to your-land/administration#140
35483 mapblocks matched the criteria. processing took approximately 2 hours 50 minutes.
now someone has to go visit all of those...
probably the next step should be to apply some sort of clustering algorithm
EDIT: oh wait, nether basalt spawns at the bottom of the world now doesn't it. hm.
The bottom of the world has bedrock, nether basalt is only obtainable from the nether.
35k? Wow, that's a lot.
whoops, that's what i meant. bedrock. i should probably run the analysis again while ignoring bedrock.
Or just exclude the bottom:
grep -v ', -1932, ' <output.txt |wc -l
23962
i did that but didn't trust it.
attached is the result of ignoring bedrock nodes explicitly. 24008 matches. probably around 50% of those are false positives. i still think i need to run some clustering algorithms on the results to generate a more analyzable result