Server IP : 104.21.38.3 / Your IP : 162.158.108.78 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/binlog/t/ |
Upload File : |
# ==== Purpose ==== # # The purpose of this test is to ensure that GTID_PURGED variable is # properly set when binlogs need to be purged by means of # `expire_logs_days` usage during server startup process. # # ==== Requirements ==== # # R1. When `expire_logs_days` has been expired upon server # restart, binary logs should be purged and GTID_PURGED should be updated # accordingly. # # ==== Implementation ==== # # TC1. Restart the server with simulated `expire_logs_days` expiration # --------------------------------------------------------------------------- # 1. Create a table. # 2. Stop the server. # 3. Start the server with `--expire-logs-days` sinthetically set to # expire. # 4. Ensure GTID_PURGED is set at the correct value. # 5. Ensure that we have only one binary log file. # # TC2. Restart the server with simulated `expire_logs_days` # expiration and after flush # ---------------------------------------------------------------- # 1. Create a table. # 2. Flush the logs. # 3. Insert a row. # 4. Stop the server. # 5. Start the server with `--expire-logs-days` sinthetically set to # expire. # 6. Ensure GTID_PURGED is set at the correct value. # 7. Ensure that we have only one binary log file. # # ==== References ==== # # BUG#32008512 ASSERTION `LOST_GTIDS->IS_EMPTY()' FAILED WHEN MYSQLD # STARTED # BUG#32134875 PURGE BINLOG IN INSTANCE STARTUP CAUSE PREVIOUS_GTIDS WRONG # IN NEW BINLOG FILE # --source include/have_binlog_format_row.inc --source include/have_gtid.inc --source include/have_debug.inc --let $saved_debug = `SELECT @@debug` # TC1. Restart the server with simulated `expire_logs_days` expiration # --------------------------------------------------------------------------- --let $debug_point = "+d,expire_logs_always_at_start" RESET MASTER; # 1. Create a table. CREATE TABLE t (a INT); # 2. Stop the server. --source include/stop_mysqld.inc # 3. Start the server with `--expire-logs-days` sinthetically set to # expire. --let $restart_parameters = restart: --debug=$debug_point --expire-logs-days=1 --source include/start_mysqld.inc --let $server_uuid = `SELECT @@server_uuid` # 4. Ensure GTID_PURGED is set at the correct value. --let $assert_text = GTID_PURGED is consistent --let $assert_cond = "[SELECT @@gtid_purged]" = "$server_uuid:1" --source include/assert.inc # 5. Ensure that we have only one binary log file. --let $statement = SHOW BINARY LOGS --let $column = Log_name --source include/get_row_count.inc --let $assert_text = We have 1 binlog file --let $assert_cond = $row_count = 1 --source include/assert.inc DROP TABLE t; # TC2. Restart the server with simulated `expire_logs_days` # expiration and after flush # ---------------------------------------------------------------- --let $debug_point = "+d,expire_logs_always_at_start" RESET MASTER; # 1. Create a table. CREATE TABLE t (a INT); # 2. Flush the logs. FLUSH LOGS; # 3. Insert a row INSERT INTO t VALUES (1), (2), (3); # 4. Stop the server. --source include/stop_mysqld.inc # 5. Start the server with `--expire-logs-days` sinthetically set to # expire. --let $restart_parameters = restart: --debug=$debug_point --expire-logs-days=1 --source include/start_mysqld.inc --let $server_uuid = `SELECT @@server_uuid` # 7. Ensure GTID_PURGED is set at the correct value. --let $assert_text = GTID_PURGED is consistent --let $assert_cond = "[SELECT @@gtid_purged]" = "$server_uuid:1-2" --source include/assert.inc # 8. Ensure that we have only one binary log file. --let $statement = SHOW BINARY LOGS --let $column = Log_name --source include/get_row_count.inc --let $assert_text = We have 1 binlog file --let $assert_cond = $row_count = 1 --source include/assert.inc DROP TABLE t; SET GLOBAL debug = "-d,expire_logs_always_at_start";