Commit 8a68821f authored by unknown's avatar unknown
Browse files

Bug #18679 rpl_ndb_dd_advance.test fails randomly

parent 34edcac8
Loading
Loading
Loading
Loading
+90 −39
Original line number Diff line number Diff line
@@ -1625,16 +1625,25 @@ int do_save_master_pos()

    if (have_ndbcluster)
    {
      ulonglong epoch=0, tmp_epoch= 0;
      ulonglong start_epoch= 0, applied_epoch= 0,
	latest_epoch=0, latest_trans_epoch=0, 
	latest_handled_binlog_epoch= 0, latest_received_binlog_epoch= 0,
	latest_applied_binlog_epoch= 0;
      int count= 0;
      int do_continue= 1;
      while (do_continue)
      {
        const char binlog[]= "binlog";
        const char latest_trans_epoch[]=
	const char latest_epoch_str[]=
          "latest_epoch=";
        const char latest_trans_epoch_str[]=
          "latest_trans_epoch=";
        const char latest_handled_binlog_epoch[]=
	const char latest_received_binlog_epoch_str[]=
	  "latest_received_binlog_epoch";
        const char latest_handled_binlog_epoch_str[]=
          "latest_handled_binlog_epoch=";
        const char latest_applied_binlog_epoch_str[]=
          "latest_applied_binlog_epoch=";
        if (count)
          sleep(1);
        if (mysql_query(mysql, query= "show engine ndb status"))
@@ -1648,41 +1657,83 @@ int do_save_master_pos()
          if (strcmp(row[1], binlog) == 0)
          {
            const char *status= row[2];
            /* latest_trans_epoch */
            if (count == 0)

	    // latest_epoch
	    while (*status && strncmp(status, latest_epoch_str,
				      sizeof(latest_epoch_str)-1))
	      status++;
	    if (*status)
            {
              while (*status && strncmp(status, latest_trans_epoch,
                                        sizeof(latest_trans_epoch)-1))
	      status+= sizeof(latest_epoch_str)-1;
	      latest_epoch= strtoull(status, (char**) 0, 10);
	    }
	    else
	      die("line %u: result does not contain '%s' in '%s'",
		  start_lineno, latest_epoch_str, query);
	    // latest_trans_epoch
	    while (*status && strncmp(status, latest_trans_epoch_str,
				      sizeof(latest_trans_epoch_str)-1))
	      status++;
	    if (*status)
	    {
                status+= sizeof(latest_trans_epoch)-1;
                epoch= strtoull(status, (char**) 0, 10);
	      status+= sizeof(latest_trans_epoch_str)-1;
	      latest_trans_epoch= strtoull(status, (char**) 0, 10);
	    }
	    else
	      die("line %u: result does not contain '%s' in '%s'",
                    start_lineno, latest_trans_epoch, query);
		  start_lineno, latest_trans_epoch_str, query);
	    /* latest_received_binlog_epoch */
	    while (*status && 
		   strncmp(status, latest_received_binlog_epoch_str,
			   sizeof(latest_received_binlog_epoch_str)-1))
	      status++;
	    if (*status)
	    {
	      status+= sizeof(latest_received_binlog_epoch_str)-1;
	      latest_received_binlog_epoch= strtoull(status, (char**) 0, 10);
	    }
	    else
	      die("line %u: result does not contain '%s' in '%s'",
		  start_lineno, latest_received_binlog_epoch_str, query);
	    /* latest_handled_binlog */
	    while (*status && 
		   strncmp(status, latest_handled_binlog_epoch_str,
			   sizeof(latest_handled_binlog_epoch_str)-1))
	      status++;
	    if (*status)
	    {
	      status+= sizeof(latest_handled_binlog_epoch_str)-1;
	      latest_handled_binlog_epoch= strtoull(status, (char**) 0, 10);
	    }
	    else
	      die("line %u: result does not contain '%s' in '%s'",
		  start_lineno, latest_handled_binlog_epoch_str, query);
	    /* latest_applied_binlog_epoch */
            while (*status && strncmp(status, latest_handled_binlog_epoch,
                                      sizeof(latest_handled_binlog_epoch)-1))
	    while (*status && 
		   strncmp(status, latest_applied_binlog_epoch_str,
			   sizeof(latest_applied_binlog_epoch_str)-1))
	      status++;
	    if (*status)
	    {
              status+= sizeof(latest_handled_binlog_epoch)-1;
              tmp_epoch= strtoull(status, (char**) 0, 10);
	      status+= sizeof(latest_applied_binlog_epoch_str)-1;
	      latest_applied_binlog_epoch= strtoull(status, (char**) 0, 10);
	    }
	    else
	      die("line %u: result does not contain '%s' in '%s'",
                  start_lineno, latest_handled_binlog_epoch, query);
		  start_lineno, latest_applied_binlog_epoch_str, query);
	    if (count == 0)
	      start_epoch= latest_trans_epoch;
	    break;
	  }
	}
	if (!row)
	  die("line %u: result does not contain '%s' in '%s'",
	      start_lineno, binlog, query);
	if (latest_applied_binlog_epoch > applied_epoch)
	  count= 0;
	applied_epoch= latest_applied_binlog_epoch;
	count++;
        if (tmp_epoch >= epoch)
	if (latest_handled_binlog_epoch >= start_epoch)
          do_continue= 0;
        else if (count > 30)
	{
+0 −1
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ rpl_sp_effects : BUG#19862 2006-06-15 mkindahl
#rpl_row_basic_7ndb       : BUG#21298 2006-07-27 msvensson
#rpl_truncate_7ndb        : BUG#21298 2006-07-27 msvensson
crash_commit_before      : 2006-08-02 msvensson
rpl_ndb_dd_advance       : BUG#18679 2006-07-28 jimw (Test fails randomly)
func_group               : BUG#21924 2006-08-30 reggie
func_in                  : BUG#21925 2006-08-30 reggie
ndb_binlog_discover      : bug#21806 2006-08-24