Bug #53106 Weird behavior with undo_buffer_size to large for SharedGlobalMemory
Submitted: 23 Apr 2010 11:07 Modified: 7 Mar 2011 13:01
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Linux
Assigned to: Maitrayi Sabaratnam CPU Architecture:Any
Tags: all?, mysql-cluster-7.0.13

[23 Apr 2010 11:07] Hartmut Holzgraefe
Description:
a) gives error code 751 'Out of file records' which is not pointing out the actual problem at all

b) by first creating and dropping a default size log group, and only then tying a too large undo buffer one can work around the error message, log group creating succeeds but table space creating on top of it fails

How to repeat:
mysql> CREATE LOGFILE GROUP lg1 
          ADD UNDOFILE 'undo1' 
          UNDO_BUFFER_SIZE 32M 
          ENGINE = NDBCLUSTER;
ERROR 1528 (HY000): Failed to create UNDOFILE

mysql> SHOW WARNINGS;
+-------+------+----------------------------------------------+
| Level | Code | Message                                      |
+-------+------+----------------------------------------------+
| Error | 1296 | Got error 751 'Out of file records' from NDB |
| Error | 1528 | Failed to create UNDOFILE                    |
+-------+------+----------------------------------------------+
2 rows in set (0.00 sec)

mysql> CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undo1' engine = NDBCLUSTER;
Query OK, 0 rows affected (6.91 sec)

mysql> drop logfile group lg1 engine=ndbcluster;
Query OK, 0 rows affected (0.27 sec)

mysql> CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undo1' undo_buffer_size 32M engine = NDBCLUSTER;
Query OK, 0 rows affected (7.09 sec)

mysql> CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE LOGFILE GROUP lg1 ENGINE NDB;
ERROR 1528 (HY000): Failed to create TABLESPACE
mysql> show warnings;
+-------+------+----------------------------------------------------+
| Level | Code | Message                                            |
+-------+------+----------------------------------------------------+
| Error | 1296 | Got error 1503 'Out of filegroup records' from NDB |
| Error | 1528 | Failed to create TABLESPACE                        |
+-------+------+----------------------------------------------------+
2 rows in set (0.00 sec)

Suggested fix:
- always enforce limits set by SharedGlobalMemory

- provide error message hinting towards the actual problem

- document SharedGlobalMemory/UNDO_BUFFER_SIZE depentency on "CREATE LOGFILE GROUP Syntax" and maybe "MySQL Cluster Disk Data Objects" manual sections, right now the Syntax page only says that the buffer size can be up to 600M, does not mention the need to raise SharedGlobalMemory along with it though
[6 Aug 2010 9:37] Hartmut Holzgraefe
See also Bug #55515 that runs into this one due to incompatible default settings ...
[2 Mar 2011 13:03] Maitrayi Sabaratnam
Fixed and merged into 6.3 and above.
[7 Mar 2011 13:01] Jon Stephens
Documented fix as follows in the NDB 6.3.43, 7.0.23, and 7.1.12 changelogs:

        Limits imposed by the size of SharedGlobalMemory were not always
        enforced consistently with regard to Disk Data undo buffers and
        log files. This could sometimes cause a CREATE LOGFILE GROUP or
        ALTER LOGFILE GROUP statement to fail for no apparent reason.

Also added notes/info to SharedGlobalMemory/InitialLogFileGroup/{CREATE|ALTER} LOGFILE GROUP documentation as suggested by Support.

Closed.
[7 Mar 2011 13:04] Jon Stephens
A little too quick on the Submit button, forgot to append the following to the text of the changelog entry as committed:

      ..., or cause the log file group specified by InitialLogFileGroup 
      not to be created when starting the cluster.