Bug #66985 Ndb_restore to non-cluster database
Submitted: 27 Sep 2012 10:18 Modified: 27 Sep 2012 22:14
Reporter: Joffrey MICHAIE Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:Any OS:Any
Assigned to: CPU Architecture:Any
Tags: cluster ndb_restore print_data blob varchar innodb

[27 Sep 2012 10:18] Joffrey MICHAIE
Description:
Hi,

It is more and more common to deploy ndbcluster to innodb replication (for reporting, local read purposes by example)

To setup replication, you need to take a consistent backup of the cluster, and import the data on the InnoDB node, then start replication.

The only way to do this without locking the cluster is to use the ndb> START BACKUP  command.

Then, there is the possibility to use ndb_restore --print-data, to create "csv style" dump files, that can easily (with some scripting) be imported in InnoDB node.

The problem is that column data is truncated to first 255 characters. So, for many workload, this is not working, and one needs to lock the entire cluster to perform a mysql dump

How to repeat:

mysql> CREATE DATABASE IF NOT EXISTS blobdata;
mysql> USE blobdata;
mysql > CREATE TABLE blob_table (a serial, b blob) engine=ndbcluster;
mysql > INSERT INTO blob_table SELECT NULL,REPEAT('A',100000);

ndb_mgm> START BACKUP

Go to backup directory on data nodes :
(Assuming node id are 1,2, and backup id is 1)
$ ndb_restore -b 1 -n 1 --include-tables=blobdata.blob_table --print-data --append --tab=/tmp/

Look at content of /tmp/blob_table.txt

column b is truncated and cannot be restored to InnODB

Suggested fix:
Add an option to make ndb_restore able to restore to importable data in InnoDB
Add an option like --hex of mysqldump, to be able to restore binary data in InnoDB
(..)
[27 Sep 2012 22:14] Joffrey MICHAIE
Sorry, duplicate of http://bugs.mysql.com/bug.php?id=52696

Could be kept as a feature request