Changeset 1202

Show
Ignore:
Timestamp:
02/25/10 17:03:46 (2 years ago)
Author:
Gary
Message:

unxsVZ boot-cluster/boot-slave.sh debug changes added, BASH bug being fixed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tools/mysql-server/boot-cluster/boot-slave.sh

    r1201 r1202  
    6262 
    6363        #SQL "change master to" parsed data on local slave MySQL server. 
     64        fLog "cBinLog=$cBinLog cPosition=$cPosition"; 
    6465        echo "CHANGE MASTER TO MASTER_LOG_FILE='$cBinLog',MASTER_LOG_POS=$cPosition" | mysql -p$1 > /dev/null 2>&1; 
    6566        if [ $? != 0 ];then 
     
    7475                exit 6; 
    7576        fi 
     77        sleep 2; 
    7678 
    7779        #check status. if slave did not catch up in max iTimeoutSecs send warning email, exit error. 
     
    8183                exit 7; 
    8284        fi 
    83         #echo $iSecondsBehindMaster; 
     85        if [ "$iSecondsBehindMaster" == "NULL" ];then 
     86                fLog "local slave status NULL"; 
     87                exit 7; 
     88        fi 
     89        fLog "iSecondsBehindMaster=$iSecondsBehindMaster"; 
    8490        iCounter=0; 
    85         while [ $iCounter -lt $iTimeoutSecs ] && [ $iSecondsBehindMaster -gt "0" ];do 
     91        while [ $iCounter -lt "$iTimeoutSecs" ] && [ $iSecondsBehindMaster -gt "0" ];do 
    8692                let iCounter=iCounter+1; 
    8793                eval `echo "SHOW SLAVE STATUS\G" | mysql -p$1 | grep Seconds_Behind_Master | awk '{printf"iSecondsBehindMaster=%s\n",$2}'`; 
     
    9096                        exit 8; 
    9197                fi 
     98                if [ "$iSecondsBehindMaster" == "NULL" ];then 
     99                        fLog "local slave status NULL"; 
     100                        exit 9; 
     101                fi 
    92102                #double the timeout for long catch-up 
    93103                sleep 2; 
     
    95105        if [ $iCounter -eq "$iTimeoutSecs" ];then 
    96106                fLog "local slave catch-up timeout"; 
    97                 exit 9; 
     107                exit 10; 
    98108        fi 
    99109