3

I'm using the official MariaDB mariadb:10.4.6-bionic image and I have a problem: my tables corrupt themselves. This had happened at least four times this month:

  • on two different dev machines using docker-compose
  • on the staging machine using docker swarm

Everytime the symptom is that a table exists in the information schema but it can't be read or altered at all. Any operation leads to a 'Table does not exists in engine' error.

The container logs contain this error at startup:

[ERROR] InnoDB: Table sfdb.specialist contains unrecognizable instant ALTER metadata

I've checked the server system variables with

SHOW VARIABLES;

And alter_algorithm has the value DEFAULT which means (if I understand the documentation correctly) that it should not use the INSTANT algorithm, only INPLACE and COPY. https://mariadb.com/kb/en/library/server-system-variables/#alter_algorithm

Trying to dig into the MariaDB codebase led me to this check: https://github.com/MariaDB/server/blob/cccfa9dcfe2c161779824c01a84edfa64fc4378a/storage/innobase/btr/btr0cur.cc#L465

But I do not have enough knowledge of the inner workings of MariaDB to understand what is going on.

What am I doing wrong? Should I set some flag or configuration to have a stable database in docker?

  • Hi Nicolas! While I can't reproduce my exact error I think I got the samen errors like you, using MariaDB in Docker. Did you get this issues again, lately? I really can't loose my data again... If this is not stable enough I should move from Docker I guess... I will try your answer below (alter_algorithm) first... – Bob Feb 15 '20 at 09:44
  • Hi Bob, I moved on to another project. But the problem didn't reappear during four month. So it's safe to assume this configuration fix it. – Nicolas Reynis Feb 16 '20 at 16:55
  • Thanks for your reply Nicolas! I've tried the alter_algorithm option for now, and I make a backup of my DB every 5 minutes... Got to do something :P – Bob Feb 21 '20 at 06:12

1 Answers1

1

Someone suggested me, on mariadb's jira to force the setting alter_algorithm to COPY.

https://jira.mariadb.org/browse/MDEV-20198?focusedCommentId=133693&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-133693

So far the problem hasn't reappeared.