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

LP:955089 - Failure to open a CSV table will give Out-of-memory message even if the problem is not related to memory

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.36, 10.0.9
    • Fix Version/s: 10.0, 5.5
    • Component/s: None

      Description

      One can get out-of-memory errors when the server fails to open a CSV table. That is, an error like this:

      120314 15:10:06 [ERROR] Failed to write to mysql.general_log: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space

      can be caused by:

      • stopping the server
      • removing the general_log.CSV file (but leaving general_log.CSM and general_log.frm files intact)
      • starting the server back
      • running some query.

      The error message is rather misleading.

      One can think that missing CSV file is a very much edge-case. However, the whole point of using CSV storage engine is to allow the user to mess with the server's data files, so I could argue that missing table.CSV file is a more frequent scenario than, say, a missing table.MYI file.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            psergey Sergei Petrunia added a comment -

            Re: Failure to open a CSV table will give Out-of-memory message even if the problem is not related to memory
            The "Out of memory" error is caused by his code in storage/csv/ha_tina.cc:

            int ha_tina::open(const char *name, int mode, uint open_options)
            {
            DBUG_ENTER("ha_tina::open");

            if (!(share= get_share(name, table)))
            DBUG_RETURN(HA_ERR_OUT_OF_MEM);

            ^^^ That is, all errors that occur when opening a table are reported back as "Out of memory".

            Show
            psergey Sergei Petrunia added a comment - Re: Failure to open a CSV table will give Out-of-memory message even if the problem is not related to memory The "Out of memory" error is caused by his code in storage/csv/ha_tina.cc: int ha_tina::open(const char *name, int mode, uint open_options) { DBUG_ENTER("ha_tina::open"); if (!(share= get_share(name, table))) DBUG_RETURN(HA_ERR_OUT_OF_MEM); ^^^ That is, all errors that occur when opening a table are reported back as "Out of memory".
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 955089

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 955089
            Hide
            elenst Elena Stepanova added a comment - - edited

            MTR test case. Run as ./mysql-test-run.pl mdev593 --mysqld=--log-output=TABLE

            let $datadir = `SELECT @@datadir`;
            
            --enable_reconnect
            --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
            wait
            EOF
            --shutdown_server 60
            
            --remove_file $datadir/mysql/general_log.CSV
            
            --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
            restart
            EOF
            
            --source include/wait_until_connected_again.inc
            
            SELECT @@log_output;
            

            Also reproducible on MySQL 5.1-5.7.

            Show
            elenst Elena Stepanova added a comment - - edited MTR test case. Run as ./mysql-test-run.pl mdev593 --mysqld=--log-output=TABLE let $datadir = ` SELECT @@datadir`; --enable_reconnect --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect wait EOF --shutdown_server 60 --remove_file $datadir/mysql/general_log.CSV --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart EOF --source include/wait_until_connected_again.inc SELECT @@log_output; Also reproducible on MySQL 5.1-5.7.

              People

              • Assignee:
                Unassigned
                Reporter:
                psergey Sergei Petrunia
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: