403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.242.43
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/mysql-test/suite/ndb_rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/ndb_rpl/t/wait_schema_logging.inc
# suite/t/rpl_ndb/wait_schema_logging.inc
#
# SUMMARY
#   Waits until schema op performed on $source_server is
#   being logged by $dest_server
#   Assumes that source_server and dest_server are connected
#   to the same cluster
#   Assumes that $dest_server has binlogging enabled.
#
###############################################################
# Include file to wait for schema logging setup, where schema
# changes made on $source_server are logged on $dest_server
###############################################################

connection $dest_server;

#--echo Waiting for schema event logging to be active between $source_server and $dest_server
#--echo - First check that $dest_server has binary logging enabled

let $binlog= query_get_value(show variables like 'log_bin', Value, 1);
if (`SELECT "$binlog" != "ON"`)
{
  show variables like 'server_id';
  show variables like 'log_bin';
  --die ERROR: Binlogging not activated
}

--disable_query_log
RESET MASTER;
--enable_query_log

# Following code 'inspired' by include/wait_for_binlog_event.inc

--let $wait_binlog_event=drop table

let $_loop_count= 10;
let $_event= ;
let $_event_pos= 1;

while (`SELECT INSTR("$_event","$wait_binlog_event") = 0`)
{
  #--echo loop_count is $_loop_count;
  dec $_loop_count;
  if (!$_loop_count)
  {
    SHOW BINLOG EVENTS;
    --die ERROR: failed while waiting local cluster schema event logging to start
  }

  connection $source_server;
  --disable_query_log
  create table wait_schema_logging (a int primary key) engine=ndb;
  drop table wait_schema_logging;
  --enable_query_log
  connection $dest_server;

  let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
  #--echo Event is : $_event
  while (`SELECT ("$_event" != "No such row") and (INSTR("$_event", "$wait_binlog_event") = 0)`)
  {
    inc $_event_pos;
    let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
    #--echo Event did not match- next event is $_event;
  }
}

# Since we're attached to the same cluster, if we've seen the event
# then synchronous binlogging of changes is on (i.e. synchronous with
# the original schema change)
# Therefore it should now be safe to reset the master on the destination
# server as no more binlog changes are in-flight.
connection $dest_server;

--disable_query_log
RESET MASTER;
--enable_query_log

#--echo - Schema event logging is active

Youez - 2016 - github.com/yon3zu
LinuXploit