Bug #73966 NDB_RESTORE CORES ON BUILT-IN PRIMARY KEY + STAGING BLOB CONVERSIONS ON SPARC
Submitted: 18 Sep 2014 10:37 Modified: 21 Nov 2014 12:24
Reporter: Priyanka Sangam Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:7.1 OS:Any
Assigned to: CPU Architecture:Any

[18 Sep 2014 10:37] Priyanka Sangam
Description:
ndb_restore fails with a segfault when a table contains both of the following:
1) a primary key column requiring a built-in conversion, e.g int -> smallint
2) a blob column requiring a staging conversion, e.g. text -> longtext

The data is successfully loaded into the staging table. While moving the staging table to the target table, a blob value is read from the staging table. This blob read fails with an unhandled error, resulting in a core.

Current function is require_failed
   41     abort();
current thread: t@1
  [1] _lwp_kill(0x0, 0xdfff500, 0x0, 0x6, 0x0, 0x0), at 0xf61ea5c0 
  [2] raise(0x6, 0xffffffef, 0xffffffec, 0xffbf9600, 0x5, 0x6), at 0xf6193340 
  [3] abort(0x0, 0xf628e1ec, 0x6, 0x1, 0xf628fa80, 0x0), at 0xf616acec 
=>[4] require_failed(exitcode = 0, printer = (nil), expr = 0x4ba776 "(code != 0)", file = 0x4ba782 "/home/psangam/install/73/storage/ndb/tools/ndb_lib_move_data.cpp", line = 1050), line 41 in "require.c"
  [5] Ndb_move_data::set_error_code(this = 0xffbf9d78, code = 0, fmt = 0x4ba7c3 "%s", ...), line 1050 in "ndb_lib_move_data.cpp"
  [6] Ndb_move_data::set_error_code(this = 0xffbf9d78, ndberror = STRUCT), line 1061 in "ndb_lib_move_data.cpp"
  [7] Ndb_move_data::copy_blob_to_blob(this = 0xffbf9d78, attr1 = STRUCT, attr2 = STRUCT), line 729 in "ndb_lib_move_data.cpp"
  [8] Ndb_move_data::copy_attr(this = 0xffbf9d78, attr1 = STRUCT, attr2 = STRUCT), line 787 in "ndb_lib_move_data.cpp"
  [9] Ndb_move_data::move_row(this = 0xffbf9d78), line 822 in "ndb_lib_move_data.cpp"
  [10] Ndb_move_data::move_batch(this = 0xffbf9d78), line 862 in "ndb_lib_move_data.cpp"
  [11] Ndb_move_data::move_data(this = 0xffbf9d78, ndb = 0x8a7820), line 909 in "ndb_lib_move_data.cpp"
  [12] BackupRestore::finalize_staging(this = 0x849368, tableS = CLASS), line 1156 in "consumer_restore.cpp"
  [13] main(argc = 1, argv = 0x8709e4), line 1665 in "restore_main.cpp"

How to repeat:
Run ndb_restore_conv_more on Solaris Sparc
[21 Nov 2014 12:24] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

  Documented fix as follows in the NDB 7.1.34, 7.2.19, and 7.3.8 changelogs:

    ndb_restore failed while restoring a table which contained both
    a built-in conversion on the primary key and a staging
    conversion on a TEXT column.

    During staging, a BLOB table is created with a primary key
    column of the target type. However, a conversion function was
    not provided to convert the primary key values before loading
    them into the staging blob table, which resulted in corrupted
    primary key values in the staging BLOB table. While moving data
    from the staging table to the target table, the BLOB read failed
    because it could not find the primary key in the BLOB table.

    Now all BLOB tables are checked to see whether there are
    conversions on primary keys of their main tables. This check is
    done after all the main tables are processed, so that conversion
    functions and parameters have already been set for the main
    tables. Any conversion functions and parameters used for the
    primary key in the main table are now duplicated in the BLOB
    table.

  Closed.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html