Commit 2a07ed96 authored by unknown's avatar unknown
Browse files

increase save_master_pos timeout to 30 seconds for higher test predictability

    better replicaiton test cleanup to ensure better test predictability
+ some ndb test cleanup


client/mysqltest.c:
  increase save_master_pos timeout to 30 seconds for higher test predictability
mysql-test/extra/rpl_tests/rpl_ddl.test:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/extra/rpl_tests/rpl_row_UUID.test:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/r/rpl_ndb_dd_advance.result:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/r/rpl_ndb_sync.result:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/t/disabled.def:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/t/rpl_ndb_bank.test:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/t/rpl_ndb_basic.test:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/t/rpl_ndb_dd_advance.test:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/t/rpl_ndb_dd_basic.test:
  better replicaiton test cleanup to ensure better test predictability
mysql-test/t/rpl_ndb_sync.test:
  better replicaiton test cleanup to ensure better test predictability
parent a2beafcb
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -1596,9 +1596,9 @@ int do_sync_with_master2(long offset)
      It may be that the slave SQL thread has not started yet, though START
      SLAVE has been issued ?
    */
    if (tries++ == 3)
    if (tries++ == 30)
      die("could not sync with master ('%s' returned NULL)", query_buf);
    sleep(1); /* So at most we will wait 3 seconds and make 4 tries */
    sleep(1); /* So at most we will wait 30 seconds and make 31 tries */
    mysql_free_result(res);
    goto wait_for_position;
  }
@@ -1664,14 +1664,14 @@ int do_save_master_pos()
    {
      ulonglong epoch=0, tmp_epoch= 0;
      int count= 0;

      do
      int do_continue= 1;
      while (do_continue)
      {
        const char binlog[]= "binlog";
        const char latest_trans_epoch[]=
          "latest_trans_epoch=";
        const char latest_applied_binlog_epoch[]=
          "latest_applied_binlog_epoch=";
        const char latest_handled_binlog_epoch[]=
          "latest_handled_binlog_epoch=";
        if (count)
          sleep(1);
        if (mysql_query(mysql, query= "show engine ndb status"))
@@ -1701,26 +1701,32 @@ int do_save_master_pos()
                    start_lineno, latest_trans_epoch, query);
            }
            /* latest_applied_binlog_epoch */
            while (*status && strncmp(status, latest_applied_binlog_epoch,
                                      sizeof(latest_applied_binlog_epoch)-1))
            while (*status && strncmp(status, latest_handled_binlog_epoch,
                                      sizeof(latest_handled_binlog_epoch)-1))
              status++;
            if (*status)
            {
              status+= sizeof(latest_applied_binlog_epoch)-1;
              status+= sizeof(latest_handled_binlog_epoch)-1;
              tmp_epoch= strtoull(status, (char**) 0, 10);
            }
            else
              die("line %u: result does not contain '%s' in '%s'",
                  start_lineno, latest_applied_binlog_epoch, query);
                  start_lineno, latest_handled_binlog_epoch, query);
            break;
          }
        }
        mysql_free_result(res);
        if (!row)
          die("line %u: result does not contain '%s' in '%s'",
              start_lineno, binlog, query);
        count++;
      } while (tmp_epoch < epoch && count <= 3);
        if (tmp_epoch >= epoch)
          do_continue= 0;
        else if (count > 30)
        {
          break;
        }
        mysql_free_result(res);
      }
    }
  }
#endif
+1 −0
Original line number Diff line number Diff line
@@ -507,4 +507,5 @@ DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
--enable_warnings

-- source include/master-slave-end.inc
+1 −0
Original line number Diff line number Diff line
@@ -80,3 +80,4 @@ DROP TABLE test.t2;
# be removed at next testsuite run.

# End of 5.0 test case
-- source include/master-slave-end.inc
+0 −3
Original line number Diff line number Diff line
@@ -370,13 +370,10 @@ COUNT(*)
10000
***** Add some more records to master *********
***** Finsh the slave sync process *******
* 1. *
@the_epoch:=MAX(epoch)
<the_epoch>
* 2. *
@the_pos:=Position	@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
<the_pos>	master-bin.000001
* 3. *
* 4. *
* 5. *
START SLAVE;
+5 −5
Original line number Diff line number Diff line
@@ -25,13 +25,13 @@ hex(c2) hex(c3) c1
0	1	BCDEF
1	0	CD
0	0	DEFGHIJKL
CREATE TEMPORARY TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT)ENGINE=HEAP;
DELETE FROM cluster.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM cluster.backup_info;
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
<the_backup_id>
DROP TABLE cluster.backup_info;
DROP TABLE test.backup_info;
UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
hex(c1)	hex(c2)	c3
Loading