[MDEV-29156] mysql.proc is corrupt - has encoding utf8mb4 expecting utf8mb3 Created: 2022-07-22 Updated: 2022-09-14 Resolved: 2022-09-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Affects Version/s: | 10.6.7 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Jeff Dyke | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | character-set, upgrade | ||
| Environment: |
Ubuntu 20.04, EC2 Instance. |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
I have set all default character sets to utf8mb4, for quite a few years. When trying to upgrade from 10.6 to 10.7, or even when use mariadb-backup to backup and restore to a new server, I get the following errors at start up, or running mariadb-upgrade
I can alter this table and then dump it with mysqldump and i'll see the character set correctly as utf8mb3. But if i restart the server it goes back to utf8mb4. Also if i run mysql-upgrade on a new upgraded 10.6->10.7 it will do the same thing, if i dump it right before proc shows all character sets as utf8mb3, after it will show utf8mb4, just like a restart and the upgrade fails. I have removed the default character set from the server configuration, but that behaves the same way. I noticed in Index.xml of charsets, there is only a utf8mb3, not sure if that is important, but saw a note on another issue. I'm guessing it may have something to do with https://jira.mariadb.org/browse/MDEV-26863, as that is the only thing i can find that comes close to this issue. I have gotten around this on a single server restores/rebuilds, i'll update this with that detail, but on the production and staging clusters its an upgrade blocker. I'm hoping i'm in some odd state and that someone can simply help me get out of it. But also thought it may be a bug from the utf8->utf8mb3 change. as these tables have been utf8mb4 for years from setting the default character set on the server and client, rather than just utf8. Thanks for all you do. |
| Comments |
| Comment by Elena Stepanova [ 2022-07-25 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Do you mean that you have it set in the config files, or that you also converted all tables (including system tables) into utf8mb4? Can you paste your mysql.proc definition from 10.6, before any attempts to upgrade?
ALTER from what to what? Can you provide the ALTER command and the resulting dump (schema only, no data)?
Do you mean that you see a table as utf8mb3, you don't do anything to the table or the data, restart the server, don't run any mysql_upgrade or other tools, and see the table as utf8mb4? If so, can you enable general log in your config file, perform this exercise and attach the resulting general log? Please also attach the output of
from the MariaDB server
from the system? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-07-25 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the detailed questions. I wanted to cull this down to one item, as i'm starting to think more and more there was a botched upgrade, and i'm paying the price a couple upgrades later. I will try to answer all your questions as i go. Replica/Backup Server SettingsI made a backup from the cluster using mariadb-backup the proc table is defined as
The global variables around character sets
The output of dpkg is in dbreplica_dpkg.out
New Instance for backup restoreI have then created a new ec2 instance and installed mariadb 10.6. Not surprising, but including the same outputs.
mysql.proc schema on this server is identical to the above.
Post Upgrademysql.proc after a mariadb-backup.
Other answers after upgrade, in case they changed.
salt dpkg -l | grep -Ei 'mysql|mariadb|percona' mariadb_post_reload_dpkg.out So here the errors, from the first post, appear on each restart in error.log. Trying the alter and restart
Proc Schema after alter
Restarting mariadb-server, and the proc schema
An interesting thing about this schema, is that modified is still set to the altered definition, but character sets have changed. I realize this is kind of apples to oranges, but may be a hint. Perhaps i should do some digging in information schema? To finish where i started, this seems like an upgrade gone wrong before this one. Thanks again for any input! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-07-25 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Wanted to follow up on the information_schema comment. All columns in proc from the COLUMNS table that require a character set are set to uft8mb3 Also i thought it would helpful, to demystify the backup and restore process. Even thought its pretty basic. Backup
Restore
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-08-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Syncing newly created db04 via mysqldump to clusterToday i was hoping i could get around this on the cluster nodes, by creating a new mariadb 10.6.8 server running ubuntu, and using
And setting the permissions properly. After this i have a new node that was sync'd to the cluster, and the following looks fine
and with a proc table with the following db4_proc_after_sst_and_restart.sql SST to db05 using rsync, with db04 as doner.Both machines were set to wsrep_sst_method=rsync, the donor was the newly created db04 So it stays correct with a mysqldump sst, but using that as a donor node still converts it it into utfmb4 with wsrep_sst_method=rsync. Any help is appreciated, i really just want to get past this. Thanks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-08-05 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wanted to share the outputs asked for earlierdb04 (populated with wsrep_sst_method=mysqldump)Character sets
Dpkg output
sudo dpkg -l | grep -Ei 'mysql|mariadb|percona' > db04_dpkg.txt db05 (synced from donor db04 with wsrep_sst_method=rsync)Character sets
h.3 Dpkg
sudo dpkg -l | grep -Ei 'mysql|mariadb|percona' > db05_dpkg.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-08-19 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Is there ANYONE that can give me some feed back, or ask some questions about what may retain on disc before restarts when my utf8_mb3 gets magically changed to utf8_mb4 and then fails an upgrade. I thank the first response, and think i have supplied ample updates. Just a point in a direction. I'm not asking for much. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-08-23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I wasn't able to repeat it so far. Could you please attach your proc table? Files proc.frm, proc.MAI, proc.MAD? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-08-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hello Sergei. Thanks for the response. Here are proc files, the proc table has been altered, so you will see the schema showing utf8mb3. proc.frm Happy to provide anything else. Thanks again. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-08-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I still cannot repeat it. But if you ALTER the table to the correct definition and on restart it goes back to the wrong one, it means that something happens when you restart the server. Debian is known to running mysql_upgrade every time MariaDB is started. See /etc/mysql/debian-start Two thoughts: you can run mysql_upgrade manually using the commanf from debian-start, perhaps its output will reveal something useful. Or you can simply set MYUPGRADE to, for example, /bin/true and see if it'll make any difference to the charset behavior of the mysql.proc table. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-09-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
ok. So in the end, while i did think it would have something to do with /etc/mysql/debian-start it never had a configuration where it was told to use any other character set than the one that is set for normal tables utf8mb4 utf8mb3 are still for system_table_charsets. But why would we have a latin1 charset in 10.6 on a table that wanted to be utf8mb3. I was able to add the new repository to ubuntu 22.04, after disabling /etc/mysql/debian-start and upgrade correctly. There has to be an easier way, no? I have yet to move to a cluster, hoping it goes the same, will update here. Also 22.04 sees the deprecation of apt-key and apt-key add-repository so the majority of online help sites will still require that you fix this if you don't know whats sup. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-09-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
In order for the above to work. You have to (i'm not done testing)
I'll update this in a bit b/c i'm not sure this is the exact order and it may differ per instance. I have yet to make it to the galera cluster. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jeff Dyke [ 2022-09-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have been able to work around this, thank you for the comment on /etc/mysql/debian-start, though i would not have wanted to go there b/c it just masks the error. In order to get by the error i either commented out #ExecStartPost=/etc/mysql/debian-start in /etc/systemd/system/multi-user.target.wants/mariadb.service. I have seen this still crop up on galera nodes. Want to ignore, but want to know more. I need to/should do a full debug on the script that is sourced in /etc/mysql/debian-start but i don't see how it could revert to a different character set. I can live with a win, but fearful it could come up again. These scripts were never changed on install. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-09-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It seems to be I'll wait for you to confirm that you have old_mode='' and then will close this issue as a duplicate. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-09-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
got a reply per email
|