[MDEV-19703] Dead lock at CREATE USER Created: 2019-06-06 Updated: 2021-04-05 Resolved: 2021-04-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Locking |
| Affects Version/s: | 10.1.37 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | BRULE Herman Jacques Roger | Assignee: | Sergei Golubchik |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Environment: |
AArch64, Odroid C2, Debian 9 |
||
| Description |
|
Hi, When I do: CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'b692RzMDSKjTg7AypUMEbhlx' I dead lock some time:
Cheers, |
| Comments |
| Comment by Sergey Vojtovich [ 2019-06-06 ] | ||||
|
Feels like it may relate to | ||||
| Comment by BRULE Herman Jacques Roger [ 2019-06-06 ] | ||||
|
But here is create user... nobody create user with this version? | ||||
| Comment by Sergey Vojtovich [ 2019-06-06 ] | ||||
|
I can imagine many installations had to create user. But I doubt anybody is running `mysql_upgrade` concurrently. | ||||
| Comment by BRULE Herman Jacques Roger [ 2019-06-06 ] | ||||
|
My unique query started is CREATE user, no more query. | ||||
| Comment by Oleksandr Byelkin [ 2020-07-10 ] | ||||
|
Why it is "critical"? IMHO it is out of normal use pattern to update privilege tables directly and via commands. | ||||
| Comment by BRULE Herman Jacques Roger [ 2020-07-10 ] | ||||
|
Hi, any creation account (by phpmyadmin or cli) was failed. I don't see any reason about change into commands or via php in this part. | ||||
| Comment by Sergei Golubchik [ 2020-07-11 ] | ||||
|
Debian starts mysql_upgrade in background. You have two mysql_upgrade's running concurrenty, while even one is already too many. The ideal fix would be not to run mysql_upgrade in background at all. At least we'd better figure out how did you manage to make two running at the same time. otto, any ideas? May be phpmyadmin starts a second mysql_upgrade? | ||||
| Comment by BRULE Herman Jacques Roger [ 2020-07-11 ] | ||||
|
Hi, No mysql_upgrade in background I think because it's on freshly started VM (start few second ago). Cheers, | ||||
| Comment by Sergei Golubchik [ 2020-07-11 ] | ||||
|
yes, both
and
are queries that mysql_upgrade runs. See https://github.com/MariaDB/server/blob/10.1/scripts/mysql_system_tables_fix.sql#L379 and you have both these queries running at the same time, so you must have mysql_fix_privilege_tables.sql (the sql script that mysql_upgrade uses) running, in two copies at the same time. | ||||
| Comment by Otto Kekäläinen [ 2021-04-04 ] | ||||
|
> The ideal fix would be not to run mysql_upgrade in background at all. At least we'd better figure out how did you manage to make two running at the same time. Otto Kekäläinen, any ideas? No idea. It is called from debian-start:
This in turn is called from either the init script (apparently not the systemd script). I don't fully grasp why the mariadb-upgrade must be triggered by external scripts, why does not mariadbd automatically check the data and update its data structures by itself? Without this understanding I don't think I should touch the mariadb-upgrade scripts or what calls them. |