2006-12-22 13:57:33 +01:00
|
|
|
# Check that server has come out ot readonly mode
|
2007-06-18 15:36:10 +02:00
|
|
|
#
|
|
|
|
# wait for server to connect properly to cluster
|
|
|
|
#
|
2007-06-19 11:25:19 +02:00
|
|
|
set @saved_log = @@sql_log_bin;
|
|
|
|
set sql_log_bin = 0;
|
2007-06-19 11:38:07 +02:00
|
|
|
--error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_KEY_NOT_FOUND
|
2007-06-18 15:36:10 +02:00
|
|
|
delete from mysql.ndb_apply_status where server_id=0;
|
2006-12-22 13:57:33 +01:00
|
|
|
let $mysql_errno= 1;
|
2007-06-18 15:36:10 +02:00
|
|
|
let $counter= 600;
|
2006-12-22 13:57:33 +01:00
|
|
|
while ($mysql_errno)
|
|
|
|
{
|
2007-06-18 15:36:10 +02:00
|
|
|
# Table is readonly until the mysqld has connected properly
|
2007-06-18 17:57:16 +02:00
|
|
|
--error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG
|
2007-06-18 15:36:10 +02:00
|
|
|
replace into mysql.ndb_apply_status values(0,0,"",0,0);
|
|
|
|
if ($mysql_errno)
|
2006-12-22 13:57:33 +01:00
|
|
|
{
|
2007-06-18 15:36:10 +02:00
|
|
|
if (!$counter)
|
|
|
|
{
|
|
|
|
die("Failed while waiting for mysqld to come out of readonly mode");
|
|
|
|
}
|
|
|
|
dec $counter;
|
|
|
|
--sleep 0.1
|
2006-12-22 13:57:33 +01:00
|
|
|
}
|
|
|
|
}
|
2007-06-18 15:36:10 +02:00
|
|
|
delete from mysql.ndb_apply_status where server_id=0;
|
2007-06-19 11:25:19 +02:00
|
|
|
set sql_log_bin = @saved_log;
|
2007-06-18 15:36:10 +02:00
|
|
|
#
|
|
|
|
# connected
|
|
|
|
#
|