I believe that I have reproducible test case for you. After long investigation I realized that I may have made few mistakes during previous investigations. But the bug is still here a I am able to easy reproduce it using the following steps. The bug is reproducible using persistent connections and mysql_change_user() API call, I used PHP for that.
Create table, for example:
CREATE TABLE `test` (
|
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_czech_ci NOT NULL,
|
PRIMARY KEY (`ID`)
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
Now on Node A, run the following PHP code:
<?php
|
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
|
|
function alter_table($len) {
|
$mysqli = new mysqli("p:localhost", "root", "", "test");
|
$mysqli->query("ALTER TABLE `test` CHANGE `name` `name` VARCHAR($len) CHARACTER SET utf8mb4 COLLATE utf8mb4_cze
|
ch_ci NOT NULL;");
|
$mysqli->close();
|
}
|
|
alter_table(110);
|
alter_table(120);
|
On node A, check table structure:
MariaDB [test]> SHOW COLUMNS FROM test;
|
+-------+------------------+------+-----+---------+----------------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+------------------+------+-----+---------+----------------+
|
| ID | int(10) unsigned | NO | PRI | NULL | auto_increment |
|
| name | varchar(120) | NO | | NULL | |
|
+-------+------------------+------+-----+---------+----------------+
|
2 rows in set (0.001 sec)
|
Do the same thing on Node B:
MariaDB [test]> show columns from test;
|
+-------+------------------+------+-----+---------+----------------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+------------------+------+-----+---------+----------------+
|
| ID | int(10) unsigned | NO | PRI | NULL | auto_increment |
|
| name | varchar(110) | NO | | NULL | |
|
+-------+------------------+------+-----+---------+----------------+
|
2 rows in set (0.002 sec)
|
As you can see, the second ALTER TABLE command has not propagated to other nodes!
And now use the same PHP script, but remove persistent connection ("p:" prefix in host) and everything works!
Let me explain what and why I did. After a lot of research I figured out that I can 100% reproduce the error using persistent connection. I don't know why. When PHP disconnects and connects persistent connection, it uses mysql_change_user() API call, which should clean up session.
I am using PHP because there is no option to call mysql_change_user() API in mysql client on command line. So I used PHP for this simple test case. No warnings are returned.
It looks like user session is in some strange state after mysql_change_user() which results that DDL is not propagated in Galera cluster. But surprisingly DML works good.
And I repeat again - when I downgrade back to 10.5.8, the problem disappears. So it does not look like there is something wrong in PHP in this test case, but in MariaDB server.
CANNOT reproduce:
CREATE TABLE `test` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`data` varchar(128) DEFAULT NULL,
`ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`blabla` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7274387 DEFAULT CHARSET=latin1
alter table test add column pro tinyint unsigned;
alter table test modify pro enum('unknown','ok','warning','slow','response_tim');
Query OK, 2086152 rows affected (1 min 11.856 sec)
Records: 2086152 Duplicates: 0 Warnings: 0
Would be nice to have more details?