Commit Graph

8039 Commits

Author SHA1 Message Date
MrJeremyFisher
9518c14d90 1.20.6 2024-06-18 11:53:29 -04:00
okx-code
00b767f7fa remove from config too 2024-06-09 01:26:48 +01:00
okx-code
2510355600 Remove pearl glitch fix
This is a remnant of pre-2017 civ, and has been fixed by Mojang in recent versions
2024-06-09 00:56:53 +01:00
RedDevel2
33f7173796 Merge pull request #538 from CivMC/snitchcrash
Fix some snitches crashing the server
2024-05-16 12:36:41 +02:00
RedDevel2
3be54519e6 Merge pull request #488 from MrJeremyFisher/fmc-fix
Fix Command Created Factory IO
2024-05-16 12:10:22 +02:00
okx-code
558f661833 Fix some snitches crashing the server
The problem with snitches crashing the server is that the MariaDB query planner decides that it is going to be smart, and actually do a query from the (very small) ja_snitch_actions table, and then join the (humongous) ja_snitch_entries table.

To do this, it has the genius idea of filtering the ja_snitch_entries table by the type_id column. This column represents the type of snitch entry, be it entering the snitch, breaking a block, placing a block, etc. Naturally, MariaDB thinks that it can reduce the 10M+ row database to just 1000 rows with this filter. But it turns out that there are LOTS of entries for each type_id, so it actually get about 600K columns, and has to linearly search through them.

Only a handful of snitches have been found to crash the server this way. I don't know how the MariaDB query planner works, nor do I want to, but I can speculate that only very heavily trafficked snitches would crash the server in this way, or perhaps those that show an unusual distribution of entry types.

Here is the MariaDB ANALYZE output for when the query planner thinks it's really smart:

```
+------+-------------+-------+-------+-----------------------------+---------+---------+------------------+------+-----------+----------+------------+-------------+
| id   | select_type | table | type  | possible_keys               | key     | key_len | ref              | rows | r_rows    | filtered | r_filtered | Extra       |
+------+-------------+-------+-------+-----------------------------+---------+---------+------------------+------+-----------+----------+------------+-------------+
|    1 | SIMPLE      | jsa   | range | PRIMARY                     | PRIMARY | 4       | NULL             | 17   | 1.00      |   100.00 |     100.00 | Using where |
|    1 | SIMPLE      | jse   | ref   | type_id,snitch_action_index | type_id | 5       | jukealert.jsa.id | 1241 | 671443.00 |     0.51 |       0.00 | Using where |
+------+-------------+-------+-------+-----------------------------+---------+---------+------------------+------+-----------+----------+------------+-------------+
```

As you can see, the query planner thinks it will get 1241 rows, but it actually gets 600K. Big miscalculation.

In contrast, here is a normal snitch:

```
| id   | select_type | table | type   | possible_keys               | key                 | key_len | ref                   | rows  | r_rows | filtered | r_filtered | Extra       |
+------+-------------+-------+--------+-----------------------------+---------------------+---------+-----------------------+-------+--------+----------+------------+-------------+
|    1 | SIMPLE      | jse   | ref    | type_id,snitch_action_index | snitch_action_index | 5       | const                 | 54054 | 10.00  |    50.00 |     100.00 | Using where |
|    1 | SIMPLE      | jsa   | eq_ref | PRIMARY                     | PRIMARY             | 4       | jukealert.jse.type_id | 1     | 1.00   |   100.00 |     100.00 |             |
+------+-------------+-------+--------+-----------------------------+---------------------+---------+-----------------------+-------+--------+----------+------------+-------------+
```

Interesting, the query planner drastically over-estimates the amount of rows it will scan. It thinks it will need to comb through 50K logs, but it actually ends up looking through 11.

Perhaps an alternative solution could be trying to update the data analysis the query planner gets - it may be severely inaccurate. However, this fix should be sufficient as STRAIGHT_JOIN forces the join to be done in a specific order (big table joins small table), instead of the wrong order (small table joins big table), which is ALWAYS wrong.

Database query planner bugs are just the best aren't they?
2024-05-14 23:27:32 +01:00
RedDevel2
8afe7ccb77 again 2024-05-14 12:05:13 +02:00
RedDevel2
0dc796d2be Bloody trees 2024-05-14 11:59:27 +02:00
RedDevel2
5eed3a5f53 Merge pull request #535 from CivMC/fixbeds
Revert "Discard entities before adding NPCs"
2024-05-14 09:46:01 +02:00
okx-code
90c9e2f464 Revert "Discard entities before adding NPCs"
This reverts commit 5d2151f1cd.
2024-05-14 02:18:41 +01:00
okx-code
a8114481d0 Fix pearled players going through portals
That was being based on PlayerPortalEvent, which is no longer being called. The fix is to manually call the event.
2024-05-13 23:09:56 +01:00
AngrySoundTech
3b203b12c5 Add Castlegates to the monorepo 2024-05-12 18:16:49 -04:00
AngrySoundTech
6d785413f4 Merge remote-tracking branch 'cg/master' into feature/missing-plugins 2024-05-12 18:09:05 -04:00
AngrySoundTech
d7f6690a6a Add Donum to monorepo 2024-05-12 17:49:39 -04:00
AngrySoundTech
d6af0c8e1d Merge remote-tracking branch 'd/master' 2024-05-12 17:31:25 -04:00
AngrySoundTech
8eec5384d5 Merge branch 'main' into feature/always-build-plugins 2024-05-12 12:41:56 -04:00
okx-code
09b236a1bf update jukealert 2024-05-10 20:02:24 +01:00
okx-code
c64d50e63a update namecolors and civchat and protocollib 2024-05-10 19:21:45 +01:00
okx-code
19cf8b4157 update kirabukkitgateway 2024-05-10 18:56:31 +01:00
AngrySoundTech
0c07571c16 Create ansible gradle project to copy reobf artifacts into ansible for deployment 2024-05-09 18:07:02 -04:00
okx-code
484f59d4a2 Merge main 2024-05-09 00:52:02 +01:00
okx-code
642574265e Revert "Merge pull request #394 from MrJeremyFisher/maybe-fix-factory-overflow"
This reverts commit 504317513e, reversing
changes made to c9bcc3c3c2.
2024-05-09 00:46:29 +01:00
MrJeremyFisher
e4758d4930 Fix command-created factory IO 2024-05-02 09:55:42 -04:00
RedDevel2
5f63cec70e Merge pull request #350 from MrJeremyFisher/nllim
Add `/nllim` (Name Layer List Invited Members)
2024-05-01 23:16:25 +02:00
RedDevel2
a7815e5b7b Merge pull request #347 from MrJeremyFisher/pot-glitch-fix
Don't heal dead entities with health potions
2024-05-01 23:16:17 +02:00
RedDevel2
6b6fa21d8d Merge pull request #383 from drekamor/main
Proper /nldg confirmation
2024-05-01 23:15:55 +02:00
RedDevel2
85fc356749 Merge pull request #386 from CivMC/fix-portals
Fix portal hack not triggering
2024-05-01 23:15:28 +02:00
RedDevel2
4d8bfeea4a Merge pull request #391 from CivMC/fix-chunk-meta
Fix chunk meta not saving
2024-05-01 23:15:18 +02:00
RedDevel2
5472b41937 Merge pull request #404 from Protonull/ignorelist-command
Refactor /ignorelist command
2024-05-01 23:15:09 +02:00
RedDevel2
504317513e Merge pull request #394 from MrJeremyFisher/maybe-fix-factory-overflow
Fix Factory Overflow
2024-05-01 23:15:01 +02:00
okx-code
8de69af7a0 Update AntiDerailment NMS 2024-04-23 20:48:12 +01:00
okx-code
79edc91825 Update FakePlayer 2024-04-23 20:46:29 +01:00
okx-code
f83f7bb0c0 Merge branch 'main' into mc/1.20
# Conflicts:
#	plugins/citadel-paper/src/main/java/vg/civcraft/mc/citadel/listener/BlockListener.java
#	plugins/simpleadminhacks-paper/src/main/java/com/programmerdan/minecraft/simpleadminhacks/hacks/SaplingHack.java
2024-04-23 20:31:08 +01:00
drekamor
b56931ec85 Merge branch 'CivMC:main' into main 2024-04-17 17:44:24 +01:00
Alexander
695a0f426a Refactor /ignorelist command 2024-04-16 06:54:46 +01:00
Alexander
b0323123e6 Yeet canvas 2024-04-05 00:06:57 +01:00
MrJeremyFisher
0bcef3a2f4 Requested changes 2024-04-01 15:17:54 -04:00
MrJeremyFisher
dc156c21ff Fix incorrect fullness checks 2024-04-01 14:55:10 -04:00
okx-code
26e5acb93b Fix chunk meta 2024-03-26 15:38:14 +00:00
okx-code
9375bb2979 ertyeghzsehyen edgz 2024-03-26 01:35:57 +00:00
okx-code
a1c906a43c bump versions 2024-03-25 21:31:45 +00:00
okx-code
300fee3771 Merge pull request #387 from CivMC/meta-log
Add logging for ChunkMeta
2024-03-25 21:30:19 +00:00
okx-code
42c9829153 add world 2024-03-25 21:30:05 +00:00
okx-code
bd37d9a375 Fix logs 2024-03-25 21:27:08 +00:00
okx-code
ace42ef2c8 fix messages 2024-03-23 20:36:59 +00:00
okx-code
a57ab8e417 address review 2024-03-23 20:35:22 +00:00
okx-code
5546d812bb Merge pull request #385 from CivMC/hash-set
Replace HashSet with OpenObjectHashSet
2024-03-23 20:20:16 +00:00
okx-code
3e36e65a8a fix prefix 2024-03-23 15:57:31 +00:00
okx-code
8c8e1cdab5 delay teleport 2024-03-23 01:59:33 +00:00
okx-code
f73589fdb4 Fix portal hack not triggering
If you are falling really fast, you will be falling multiple blocks per second, and could possibly pass straight through an end portal. This fix changes the hack to use an event triggered earlier to detect if a player passes through an end portal.
2024-03-23 01:42:38 +00:00