Bug #29574 API Test for 29501 with undo file = (5*1024) cause Ndbd FS inconsistency (lgman)
Submitted: 5 Jul 2007 13:30 Modified: 14 Mar 2009 16:06
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:5.1.19 (beta) OS:Linux
Assigned to: Jonas Oreland CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[5 Jul 2007 13:30] Jonathan Miller
Description:
Setting the udf too low causes a restarting node to fail with

Time: Thursday 5 July 2007 - 08:19:27
Status: Ndbd file system error, restart node initial
Message: Read underflow (Ndbd file system inconsistency error, please report a bug)
Error: 2816
Error data: LGMAN: File system read failed. OS errno: 1000
Error object: LGMAN (Line: 1856) 0x0000000e
Program: /usr/local/mysql/libexec/ndbd
Pid: 24810
Trace: /usr/local/run/ndb_3_trace.log.1
Version: Version 5.1.19 (beta)

lgman 2816:
Uint32 tmp = (consumer.m_current_page.m_ptr_i + sz - 2) % sz;

How to repeat:
int
runBug29501(NDBT_Context* ctx, NDBT_Step* step) {
  NdbRestarter res;
  NdbDictionary::LogfileGroup lg;
  lg.setName("DEFAULT-LG");
  lg.setUndoBufferSize(8*1024*1024);

  if (res.getNumDbNodes() < 2)
    return NDBT_OK;

  Ndb* pNdb = GETNDB(step);
  NdbDictionary::Dictionary* pDict = pNdb->getDictionary();

  int node = res.getRandomNotMasterNodeId(rand());
  res.restartOneDbNode(node, true, true, false);

  if(pDict->createLogfileGroup(lg) != 0){
    g_err << "Failed to create logfilegroup:"
        << endl << pDict->getNdbError() << endl;
    return NDBT_FAILED;
  }

  NdbDictionary::Undofile uf;
  uf.setPath("undofile01.dat");
  uf.setSize(5*1024);
  uf.setLogfileGroup("DEFAULT-LG");

  if(pDict->createUndofile(uf) != 0){
    g_err << "Failed to create undofile:"
        << endl << pDict->getNdbError() << endl;
    return NDBT_FAILED;
  }

  res.waitNodesNoStart(&node, 1);
  res.startNodes(&node, 1);

  if (res.waitClusterStarted()){
  	g_err << "Node restart failed"
  	<< endl << pDict->getNdbError() << endl;
      return NDBT_FAILED;
  }

  if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lg.getName())) != 0){
  	g_err << "Drop of LFG Failed"
  	<< endl << pDict->getNdbError() << endl;
    return NDBT_FAILED;
  }

  return NDBT_OK;
}

./testDict -v -n Bug29501 T1
[5 Jul 2007 13:33] Jonathan Miller
cluster log

Attachment: ndb_1_cluster.log (text/x-log), 29.32 KiB.

[5 Jul 2007 13:33] Jonathan Miller
config file

Attachment: config.ini (application/octet-stream, text), 827 bytes.

[5 Jul 2007 13:33] Jonathan Miller
error log

Attachment: ndb_3_error.log (text/x-log), 568 bytes.

[5 Jul 2007 13:33] Jonathan Miller
trace file

Attachment: ndb_3_trace.tar.gz (application/x-gzip, text), 47.66 KiB.

[13 Mar 2009 7:51] 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/69094

2867 Jonas Oreland	2009-03-13
      ndb - bug#29574 - enfore min-limit on undofiles
[13 Mar 2009 8:16] Bugs System
Pushed into 5.1.32-ndb-6.2.18 (revid:jonas@mysql.com-20090313075121-17lwkop9g7qgocri) (version source revid:jonas@mysql.com-20090313075121-17lwkop9g7qgocri) (merge vers: 5.1.32-ndb-6.2.18) (pib:6)
[13 Mar 2009 8:17] Bugs System
Pushed into 5.1.32-ndb-6.3.24 (revid:jonas@mysql.com-20090313075725-906mori1wx0q8hc1) (version source revid:jonas@mysql.com-20090313075725-906mori1wx0q8hc1) (merge vers: 5.1.32-ndb-6.3.24) (pib:6)
[13 Mar 2009 8:18] Bugs System
Pushed into 5.1.32-ndb-7.0.4 (revid:jonas@mysql.com-20090313081433-xri9mdj8hb2dd6pt) (version source revid:jonas@mysql.com-20090313081433-xri9mdj8hb2dd6pt) (merge vers: 5.1.32-ndb-7.0.4) (pib:6)
[14 Mar 2009 16:06] Jon Stephens
Documented bugfix in the NDB-6.2.18, 6.3.24, and 7.0.4 changelogs as follows:

        When a log file group had an undo log file whose size was too
        small, restarting data nodes failed with Read underflow errors.

        As a result of this fix, the minimum allowed INTIAL_SIZE for an
        undo log file is now 1M (1 megabyte).

Also noted new minimum in "CREATE LOGFILE GROUP Syntax" and "ALTER LOGFILE GROUP Syntax" sections of the Manual.