| Server IP : 88.99.149.37 / Your IP : 216.73.216.141 Web Server : nginx/1.31.2 System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64 User : muralimurth ( 1015) PHP Version : 8.4.23 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/local/mysql/mysql-test/include/ |
Upload File : |
# include/wait_for_purge.inc
#
# SUMMARY
#
# Repeatedly attempt to purge binlogs up to a specific point, until
# SHOW BINARY LOGS shows it has succeeded.
# This can be useful to avoid races where slaves are stopped but the
# corresponding binlog dump thread on the master has not yet terminated.
# Async binlog checkpoints can also delay purge.
#
# Note that it may be necessary to inject at least one event in the binlog
# after stopping slaves, or master may not detect stop of slave for a long
# time (or forever), depending on details of test case, if replication
# heartbeat is enabled, etc.
#
# USAGE:
#
# --let $purge_binlogs_to=master-bin.000003
# --source include/wait_for_purge.inc
#
# SIDE EFFECTS:
#
# Disables --query_log while running, enables it afterwards.
--echo include/wait_for_purge.inc "$purge_binlogs_to"
let $_wait_count= 300;
let $_done= 0;
--disable_query_log
while ($_wait_count)
{
dec $_wait_count;
eval PURGE BINARY LOGS TO "$purge_binlogs_to";
let $_cur_binlog= query_get_value(SHOW BINARY LOGS, Log_name, 1);
if (`SELECT "$_cur_binlog" = "$purge_binlogs_to"`)
{
let $_done= 1;
let $_wait_count= 0;
}
if ($_wait_count)
{
real_sleep 0.1;
}
}
if (!$_done)
{
SHOW FULL PROCESSLIST;
eval SHOW BINARY LOGS;
--die ERROR: failed while waiting for binlog purge to $purge_binlogs_to
}
--enable_query_log