Bug #21436 NDB API: altering table to temporary (no logging) mode crashes all data nodes.
Submitted: 3 Aug 2006 20:00 Modified: 4 Aug 2006 11:30
Reporter: Anatoly Pidruchny (Candidate Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.1.11 OS:Any (all)
Assigned to: Assigned Account CPU Architecture:Any

[3 Aug 2006 20:00] Anatoly Pidruchny
Description:
I am trying to alter a regular NDB table into a temporary mode using the DataDictionary::Table::setLogging(false), then DataDictionary::alterTable(table) calls. Doing this crashes all data nodes.

How to repeat:
Please see the attached program and some of the logs. The program expects two arguments: database name and table name. Run the program and pass the database name and table name of any existing non-temporary table. This is the output from the program:

$ ./ndb_alter_table test_db_1 mytablename
NDB library initialized
Environmental variable NDB_CONNECT_STRING is not defined. Using default connect-string "localhost:1186"
Connected to the management server
Cluster is ready
Connected to the test_db_1 database
Turning logging off for the table mytablename
Error in ndb_alter_table.cpp, line: 99, code: 4009, msg: Cluster Failure.

Suggested fix:
The ability to have temporary tables is a great great feature in NDB. As I understand, the support of temporary tables, in NDB sense, is the support of the diskless feature on per-table basis. It is there and it works. The problem is that it is not advertised, almost not documented, and it is very hard to use, because you have to write your own programs using NDB API to create a temporary table. I think the feature should be properly advertised, described in the documentation, and a tool allowing altering or creating a temporary table should be included in MySQL distributions, or may be SQL syntax should be extended to allow creating these "diskless" tables. The test program was an attempt to write a tool that would allow altering a regular table into a temporary table.

For your information, my other tool that creates a new temporary table seems to work fine.
[3 Aug 2006 20:01] Anatoly Pidruchny
Modified Category to Cluster.
[3 Aug 2006 20:02] Anatoly Pidruchny
Test program

Attachment: ndb_alter_table.cpp (application/octet-stream, text), 3.22 KiB.

[3 Aug 2006 20:02] Anatoly Pidruchny
Cluster log file

Attachment: ndb_1_cluster.log (application/octet-stream, text), 4.25 KiB.

[3 Aug 2006 20:02] Anatoly Pidruchny
Data node error log

Attachment: ndb_2_error.log (application/octet-stream, text), 568 bytes.

[3 Aug 2006 20:03] Anatoly Pidruchny
Data node output log

Attachment: ndb_2_out.log (application/octet-stream, text), 644 bytes.

[4 Aug 2006 7:54] Jonas Oreland
Hi,

As i wrote somewhere else (on forum?)

The operation to alter a table from logging to no logging is not supported in 
  ndb kernel...it adding that feature is probably not going to happen anytime
  soon...

But I completly agree that it would be excelent to be able to create such tables
  from mysql...(and then "mysql" alter table would also work 
    (i.e not online, but copy))

And as I also wrote,
  the fact that it crashes is though a bug...
  but I think that we actually "officially" dont support ddl using ndbapi

The reason for that the "no logging"-table option has not been added to mysqld
  is that it's frm format is quite complicated.

I however once wrote a patch that read an environment variable and added nologging to mysqld's create table if it was set...

/Jonas
[4 Aug 2006 11:30] Jonas Oreland
Hi,

Just spoke with a guy with more mysql-internals knowledge than me..
He said that he might come up with a patch that makes it possible to
  do this in a month or so...

So there is hope :-)

Closing to as "To be fixed later"
[13 Mar 2014 13:35] Omer Barnir
This bug is not scheduled to be fixed at this time.