Commit Graph

10612 Commits

Author SHA1 Message Date
MrJeremyFisher
9518c14d90 1.20.6 2024-06-18 11:53:29 -04:00
okx-code
6bc1705f3c Merge pull request #546 from CivMC/removefixpearlglitch
Cleanup config
2024-06-09 01:27:11 +01:00
okx-code
00b767f7fa remove from config too 2024-06-09 01:26:48 +01:00
okx-code
0635a587f7 Merge pull request #545 from CivMC/removefixpearlglitch
Remove pearl glitch fix
2024-06-09 01:25:59 +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
9adcebab99 Merge pull request #537 from CivMC/testrb
Actually map the trees to the saplings.
2024-05-14 12:25:02 +02:00
RedDevel2
5a26e97b6b Restore growth times 2024-05-14 12:23:00 +02:00
RedDevel2
0093b6bece Need to check my work better smh 2024-05-14 12:21:37 +02: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
8dce417735 - 2024-05-14 11:37:48 +02:00
RedDevel2
9118607767 Merge pull request #528 from CivMC/Movejar
Move jar to correct folder
2024-05-14 10:52:07 +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
RedDevel2
a97b81e91b Merge pull request #531 from CivMC/fixportals
Fix pearled players going through portals
2024-05-14 09:42:53 +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
RedDevel2
9b11393c1a Merge pull request #489 from MrJeremyFisher/patch-1
Superfriend snitch fix
2024-05-13 15:21:48 +02:00
RedDevel2
8a45ad00a6 Move jar to correct folder 2024-05-13 15:12:51 +02:00
RedDevel2
de19474450 Merge pull request #526 from CivMC/Emotes
Fix Emotes
2024-05-13 10:08:42 +02:00
RedDevel2
dae82be236 Merge pull request #511 from CivMC/RedDevel2-patch-1
Fix Mangrove/cherry saplings
2024-05-13 01:49:06 +02:00
RedDevel2
9ef6865fe4 Merge pull request #525 from CivMC/main
Update branch
2024-05-13 01:15:24 +02:00
AngrySoundTech
6ed936669f Merge pull request #524 from CivMC/feature/missing-plugins
Add CastleGates and Donum
2024-05-12 19:10:48 -04:00
RedDevel2
afabd337d0 Update test variable 2024-05-13 01:08:47 +02: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
0fbf8100a6 Merge pull request #497 from CivMC/feature/always-build-plugins
Build plugins from source for ansible deployments
2024-05-12 14:04:18 -04:00
AngrySoundTech
9cbcd2649e Remove civdocker version 2024-05-12 13:20:31 -04:00
AngrySoundTech
23e28e188e Fix gradle action name 2024-05-12 13:18:06 -04:00
AngrySoundTech
b43b094092 relative files directory 2024-05-12 13:15:17 -04:00
AngrySoundTech
00e66efc78 Update actions gradle 2024-05-12 13:13:26 -04:00
AngrySoundTech
31ac58aadf Fix copy source 2024-05-12 13:04:57 -04:00
AngrySoundTech
8eec5384d5 Merge branch 'main' into feature/always-build-plugins 2024-05-12 12:41:56 -04:00
RedDevel2
eedeb1036a Add config file 2024-05-12 16:51:37 +02:00
RedDevel2
43ca2c79e7 update variable 2024-05-12 16:39:56 +02:00
RedDevel2
7262b19821 Fix emotes 2024-05-12 16:39:23 +02:00
RedDevel2
3b1e698a94 Fix Mangrove/cherry saplings
This fixes Mangrove and Cherry saplings being seen as Warped and crimson fungus after restart.
2024-05-12 15:58:29 +02:00
RedDevel2
b0e0c34cdd Merge pull request #506 from CivMC/tabfix
fix bonemeal
2024-05-11 03:23:04 +02:00
okx-code
7b267ca2d3 update settings.yml 2024-05-11 02:15:11 +01:00
okx-code
067e828bb6 update torchflower 2024-05-11 01:57:02 +01:00
okx-code
67cb8c2c2d Merge remote-tracking branch 'origin/main' into tabfix 2024-05-11 01:46:31 +01:00
okx-code
2864589bd6 fix bonemeal 2024-05-11 01:44:23 +01:00
okx-code
62f08c5850 Merge pull request #505 from CivMC/tabfix
add netherite upgrade
2024-05-11 01:13:25 +01:00
okx-code
f38234dc5b Merge branch 'main' into tabfix 2024-05-11 01:10:42 +01:00
okx-code
6b635d79fc Update settings.yml 2024-05-11 01:10:06 +01:00
okx-code
9844be0cc7 fix name 2024-05-11 00:59:58 +01:00