Bug #43181 Max # of user-defined partitions for NDBCLUSTER not documented
Submitted: 25 Feb 2009 11:30 Modified: 4 Mar 2009 18:27
Reporter: Francesco Maisano Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: Jon Stephens CPU Architecture:Any
Tags: number, over 8, partition, partitions

[25 Feb 2009 11:30] Francesco Maisano
Description:
Hi, 
i am working with mysql cluster and i need to create a table with more than 8 partitions but during creation I get the following error:

ERROR 1005 (HY000): Can't create table 'test.t2' (errno: 140)

mysql> show warnings;
+-------+------+----------------------------------------------+
| Level | Code | Message                                      |
+-------+------+----------------------------------------------+
| Error | 1296 | Got error 1224 'Too many fragments' from NDB | 
| Error | 1005 | Can't create table 'test.t2' (errno: 140)    | 
+-------+------+----------------------------------------------+

I can not understand what could be the problem, I need your help.
Best Regards
Francesco Maisano

How to repeat:
CREATE TABLE test.t2 (   
c1 INT NOT NULL,   
c2 TEXT NOT NULL, 
c3 INT NOT NULL,   
c4 FLOAT,   
c5 VARCHAR(255),   
c6 TIMESTAMP,   
PRIMARY KEY(c1,c3)) 
TABLESPACE TEST_PARTITION STORAGE DISK ENGINE=NDB PARTITION BY KEY(c3) PARTITIONS 24;
[25 Feb 2009 12:19] Francesco Maisano
Tablespace is created:
CREATE TABLESPACE TEST_PARTITION ADD DATAFILE 'TEST_PARTITION.MySQL' USE LOGFILE GROUP LOGFILE1 ENGINE=NDBCLUSTER;

and logfile

CREATE LOGFILE GROUP LOGFILE1 ADD UNDOFILE 'LOGFILE1.LOG' ENGINE=ndbcluster;
[25 Feb 2009 13:27] Hartmut Holzgraefe
Looks as if there is an undocumented limitation with cluster tables
that allows for only up to four times the number of nodes as max.
number of partitions ...
[25 Feb 2009 13:29] Hartmut Holzgraefe
This is not disk data specific btw., the limit exists on simple memory based ndb tables, too ...
[25 Feb 2009 13:35] Francesco Maisano
Since I am carrying out such tests in an environment composed of a single node, how can we explain the fact that can create up to 8 partitions?

	
Indeed in this way I do not have problems

CREATE TABLE test.t2 (   
c1 INT NOT NULL,   
c2 TEXT NOT NULL, 
c3 INT NOT NULL,   
c4 FLOAT,   
c5 VARCHAR(255),   
c6 TIMESTAMP,   
PRIMARY KEY(c1,c3)) 
TABLESPACE TEST_PARTITION STORAGE DISK ENGINE=NDB PARTITION BY KEY(c3) PARTITIONS 8;
[26 Feb 2009 10:16] Hartmut Holzgraefe
The limit actually seems to be 8 partitions per node group, not 4 per node.
As i ran all my tests with NoOfReplicas=2 while your single node setup
has NoOfReplicas=1 i didn't spot that in my tests ...
[4 Mar 2009 18:27] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Updated Synopsis to reflect actual nature of issue (docs problem, not software problem).