Skip to content
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

Failed to start MySQL: Failed to initialize pool: Unknown system variable 'transaction_isolation' [MariaDB 11 breaks MySQL compatibilty] #3091

Closed
jacklollz2 opened this issue Jun 26, 2023 · 7 comments · Fixed by #3122
Labels
Bug Issues that contain unintended behavior Incompatibility Issues about incompatibility with other software New Feature Issues that are about new features

Comments

@jacklollz2
Copy link

Describe the issue

Plan Failed to initialize pool at launch.

Exceptions & Other Logs

[19:15:39 ERROR]: [Plan] ----------------------------------------
[19:15:39 ERROR]: [Plan] Error: Failed to start MySQL: Failed to initialize pool: Unknown system variable 'transaction_isolation'
[19:15:39 ERROR]: [Plan] ----------------------------------------
[19:15:39 ERROR]: [Plan] Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /plan reload

Plugin versions

5.5 DEV build 2411

Additional information

MariaDB v11
OpenJDK 64-Bit Server VM Temurin-19.0.2+7 (build 19.0.2+7, mixed mode)
Oracle Linux 8

@jacklollz2 jacklollz2 added the Bug Issues that contain unintended behavior label Jun 26, 2023
@AuroraLS3
Copy link
Collaborator

I think MariaDB 11 breaks compatibility with MySQL

@jacklollz2
Copy link
Author

I think MariaDB 11 breaks compatibility with MySQL

MariaDB is faster than MySQL anyway, I want proper support for it.
LuckPerms does a great job with MariaDB support.

@AuroraLS3 AuroraLS3 added New Feature Issues that are about new features Incompatibility Issues about incompatibility with other software labels Jun 27, 2023
@AuroraLS3 AuroraLS3 changed the title Failed to start MySQL: Failed to initialize pool: Unknown system variable 'transaction_isolation' Failed to start MySQL: Failed to initialize pool: Unknown system variable 'transaction_isolation' [MariaDB 11 breaks MySQL compatibilty] Jul 1, 2023
@AuroraLS3
Copy link
Collaborator

I tried updating to MariaDB 11 on my local machine and it completely nuked itself so fixing this will take a while.

@AuroraLS3
Copy link
Collaborator

AuroraLS3 commented Jul 17, 2023

Debugging the exception, MySQL driver uses version string to determine which transaction_isolation variable to use:
image
Unfortunately MariaDB now uses tx_isolation in version 11 and 11 > 8 so the MySQL Driver is incompatible with the MariaDB version. This exception occurs when the driver is trying to read system variables from the database

@AuroraLS3
Copy link
Collaborator

I got the driver working, but MariaDB 11.0.2 inserts wrong data in a batch statement

INSERT INTO plan_world_times (
session_id,
world_id,
user_id,
server_id,
survival_time,
creative_time,
adventure_time,
spectator_time
) VALUES ( 
(SELECT plan_sessions.id FROM plan_sessions WHERE plan_sessions.user_id=(SELECT plan_users.id FROM plan_users WHERE plan_users.uuid=? LIMIT 1) AND plan_sessions.server_id=(SELECT plan_servers.id FROM plan_servers WHERE plan_servers.uuid=? LIMIT 1) AND session_start=? AND session_end=? LIMIT 1),
(SELECT plan_worlds.id FROM plan_worlds WHERE world_name=? AND plan_worlds.server_uuid=? LIMIT 1),
(SELECT plan_users.id FROM plan_users WHERE plan_users.uuid=? LIMIT 1),
(SELECT plan_servers.id FROM plan_servers WHERE plan_servers.uuid=? LIMIT 1),
?, ?, ?, ?)

It inserts same world_id for 2 different worlds which then fails just about every session related test.
image

@AuroraLS3
Copy link
Collaborator

MariaDB 11 seems to not be production ready. I recommend sticking with LTS version 10.11.4

@AuroraLS3
Copy link
Collaborator

11.1.1 seems to work fine with unit tests.

AuroraLS3 added a commit that referenced this issue Jul 20, 2023
* Fix MariaDB 11 driver issue
* Update some more logging messages
* Throw DBInitException if using MariaDB 11.0.2
* Fix mariadb container health check
* Use 11.1-rc for mariadb image

Affects issues:
- Fixed #3091 for MariaDB 11.1.1 or newer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that contain unintended behavior Incompatibility Issues about incompatibility with other software New Feature Issues that are about new features
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants