Bug #40429 Ignore tables when restoring using ndb_restore
Submitted: 30 Oct 2008 12:11 Modified: 15 Feb 2009 20:39
Reporter: Geert Vanderkelen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:mysql-5.1.29-ndb-6.3 OS:Any
Assigned to: Frazer Clement CPU Architecture:Any
Tags: Backup, ndb_restore

[30 Oct 2008 12:11] Geert Vanderkelen
Description:
Currently it is possible to restore only certain tables from a backup, for example, if we want to restore only tables t1 and t2 from backup from the test database:
 shell> ndb_restore  <other options> -r test t1 t2

If you have 100 tables, and you need to only ignore one, you have the option to mention all the 99 tables on the command inline, but this is bit clumsy. Nicer would be something that actually ignores tables, something like this:

 shell> ndb_restore <other options> -r --ignore-tables test t3 t4

This will ignore the tables t3 and t4 and only restoring t1 and t2 for example.

How to repeat:
(feature request)

Suggested fix:
Attached is a patch implementing the option.
[7 Dec 2008 21:30] Geert Vanderkelen
--include-[databases|tables] and --exclude-databases|tables]

Attachment: bug40429_20081207.patch (application/octet-stream, text), 7.93 KiB.

[8 Dec 2008 4:20] Stewart Smith
I'd have the following comments/suggestions:
- use a hash instead of list for storing in ndb_restore. that way it'll work if somebody specifies a *lot* of tables/databases to include/exclude
- add --exclude-tables-in-file (and include) with file being one line per table/db
- test with unicode names (e.g. 'create table ☃' and what this is represented as in NDB)
[30 Jan 2009 11:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/64606

2820 Frazer Clement	2009-01-30
      Bug#40429 Ignore tables when restoring using ndb_restore
      
      New options added to ndb_restore to include or exclude tables and databases 
      when restoring into the database.
      
      MTR testcases added to capture behaviour.
      
      BaseString methods given missing constness properties.
      
      Original patch was by Geert Vanderkelen.
[30 Jan 2009 15:01] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/64661

2820 Frazer Clement	2009-01-30
      Bug#40429 Ignore tables when restoring using ndb_restore
      
      New options added to ndb_restore to include or exclude tables and databases
      when restoring into the database.
      
      MTR testcases added to capture behaviour.
      
      BaseString methods given missing constness properties.
      
      Original patch was by Geert Vanderkelen.
[30 Jan 2009 15:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/64665

2825 Frazer Clement	2009-01-30
      Bug#40429 Ignore tables when restoring using ndb_restore
      
      New options added to ndb_restore to include or exclude tables and databases
      when restoring into the database.
      
      MTR testcases added to capture behaviour.
      
      BaseString methods given missing constness properties.
      
      Original patch was by Geert Vanderkelen.
[30 Jan 2009 15:40] Bugs System
Pushed into 5.1.31-ndb-6.3.22 (revid:frazer@mysql.com-20090130150846-fxxklxobz2pakx9b) (version source revid:frazer@mysql.com-20090130150846-fxxklxobz2pakx9b) (merge vers: 5.1.31-ndb-6.3.22) (pib:6)
[30 Jan 2009 15:41] Bugs System
Pushed into 5.1.31-ndb-6.4.3 (revid:frazer@mysql.com-20090130153505-727dyd1ogp56f9bk) (version source revid:frazer@mysql.com-20090130153505-727dyd1ogp56f9bk) (merge vers: 5.1.31-ndb-6.4.3) (pib:6)
[15 Feb 2009 20:39] Jon Stephens
Documented feature enhancement in the NDB-6.3.22 and 6.4.3 changelogs as follows:

        New options are introduced for ndb_restore for determining 
        which tables or databases should be restored:

            ·  --include-tables and --include-databases can be used to
            restore specific tables or databases.

            ·  --exclude-tables and --exclude-databases can be used to
            exclude the specific tables or databases from being
            restored.

        For more information about these options, see "ndb_restore — 
        Restore a MySQL Cluster Backup".

Added information about the new options to http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-restore.html.