Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-20699

mysqldump of routines causes MariaDB to get killed by oom-killer

    XMLWordPrintable

Details

    Description

      Hi guys,

      we have a problem creating a full dump of our database using mysqldump.

      Since we upgraded from MariaDB 10.1.25 to MariaDB 10.3.17 two weeks ago, creating a full dump including all schemas (total of 3), triggers, events and routines causes the server get killed by oom-killer.

      TL;DR:
      It's the stored procedures that cause the server to go crazy and consume vast amounts of memory till it gets killed. Specifically the SHOW CREATE PROCEDURE command seems responsible for this behavior (tested also by running in MySQL Workbench with the same result).

      Details:
      After some stupid trial-and-error, I found out that it's dumping the stored procedures (422 in total, about 30 to 40 KB).
      Dumping all the tables including events and triggers without the routines is fine and the output file is about 3 GB in size. But as soon as I try to dump the routines only, the server gets kill after only a few seconds.
      For test purposes, I ran mysqldump on one of our slaves (MariaDB 10.3.17), dumping routines only and it crashed.
      Then I tried to run the same command on our test system with an older version of MariaDB (10.1.25), but with the same data, events, triggers and routines as the slave. It crashed.
      Out of pure desperation, I even dropped all routines and re-imported them manually. But as soon as I try to dump the routines only, the server crashes.

      Before the upgrade, everything worked fine on the slave and the (older) test system. Is it possible that some internal structure or table of MariaDB got somehow corrupted? And if so, how can I fix this?

      I also wanted to know what's going on inside MariaDB on our test system and so I started it using valgrind. I viewed the output file using massif-visualizer and it looks to me like MariaDB allocates huge amounts of memory for every stored procedure and never frees it again. But I'm completely new to valgrind, so I have no idea how to interpret the results correctly. If it helps, I can attach the massif's output file here (447 KB).

      Here's the mysqldump command I'm using:
      mysqldump --user=foobar --password --triggers --events --routines --result-file=/path/to/file --databases one two three

      And even with this command it crashes:
      mysqldump --user=foobar --password --routines --no-data --no-create-info --result-file=/path/to/file --databases one two three

      Any help or idea is welcome!

      Regards,
      matze

      Attachments

        1. massif-20190928
          447 kB
        2. Memory measurement.zip
          758 kB
        3. screenshot-1.png
          screenshot-1.png
          12 kB
        4. server.cnf
          0.3 kB
        5. umdh.zip
          55 kB

        Issue Links

          Activity

            People

              wlad Vladislav Vaintroub
              matze Matthias
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.