diff options
| author | Sujatha <sujatha.sivakumar@mariadb.com> | 2021-03-30 18:32:43 +0530 |
|---|---|---|
| committer | Sujatha <sujatha.sivakumar@mariadb.com> | 2021-03-30 18:32:43 +0530 |
| commit | aef2f50f0f01cabdf6bd528e881684de0f5918a1 (patch) | |
| tree | 122143b1582386f52ffbe60d7a94e98332226b1d /mysql-test/main/flush2.test | |
| parent | 75db05c5992e5a13ab0836120f46e241fc6de618 (diff) | |
| download | mariadb-git-bb-10.6-MDEV_19371.tar.gz | |
MDEV-19371: Implement binlog_expire_logs_seconds for purging of binary logsbb-10.6-MDEV_19371
Backporting upstream changes.
commit a7e1ef858ee82493dd8ad9a76bc9c22fe3b8c05b
Author: Neha Kumari <neha.n.kumari@oracle.com>
Date: Thu Mar 2 12:30:08 2017 +0530
WL#9237: Add a new variable binlog_expire_logs_seconds
This worklog adds a system variable binlog_expire_logs_seconds in
addition to the existing expire_logs_days variable.
The ultimate requirement is that the user can set expire periods
smaller than one day by providing another extra variable.
The new variable binlog_expire_logs_seconds, will be set in those cases
where the expire period is not a integer multiple of days
like 1 day 2 hours and 32 minute.
@ sql/binlog.cc
The purge time now also considers the value of
binlog_expire_logs_seconds.
@ sql/mysqld.h
Declared the new variable binlog_expire_logs_seconds
@ sql/mysqld.cc
The purge time now also considers the value of
binlog_expire_logs_seconds.
@ sql/sys_vars.cc
Added the description for binlog_expire_logs_seconds, and
modified the description for expire_logs_days.
Added test case to test the new variable:
- binlog_expire_logs_seconds: Ensure that when any of the two expire
variable, expire_logs_days or binlog_expire_logs_seconds is set
the purge happens on server restart and in cases where a force
rotation of binlog happens.
Extended the existing test cases:
- expire_logs_days_basic: Added code to test the system variable
binlog_expire_logs_seconds.
commit 9d591e29af1654b99a670d975ad8b9c95b011747
Author: Neha Kumari <neha.n.kumari@oracle.com>
Date: Fri Feb 2 09:12:08 2018 +0530
Bug#27252658 :CHANGE DEFAULT VALUE OF BINLOG_EXPIRE_LOGS_SECONDS
Problem:
At present the default value of binlog_expire_logs_seconds is 0, so in future
when expire_logs_days is removed the default expiration time will be set to
'0', which will make the logs to be not purged at all, where in expectation
they should have been purged after 30 days.
Fix:
To avoid the above scenario these are the three combinations regarding when
to consider the default value of what.
1) If user provides values for both options, both variables are set
accordingly and 'binlog_expire_logs_seconds' takes effect.
2) If user provides a value for only one of the options, that particular
variable is set accordingly, and the other variable defaults to 0.
3) If user does not provide a value for any of the options, then
'binlog_expire_logs_seconds' defaults to 30 * 24 * 60 * 60 and 'expire_logs_days' to 0.
This patch also changes the default value of expire_logs_days to 0.
BUG#27699608: WARNING FOR CONFLICTING EXPIRE-LOGS-[DAYS|SECONDS] SUPPRESSED WITH SKIP-LOG-BIN
Problem:
1. When --expire_logs_days and --binlog-expire-logs-seconds are set
to conflicting values, and the binary log is disabled, the warning
for the conflicting values was not issued and the values were not
corrected.
2. There was no warning when using either of these options when the
binary log is disabled. This differs from other options that are
void when the binary log is disabled, such as --binlog-format and
--log-slave-updates
Fix:
1. Check the conflicting values of these options even when the binary
log is disabled.
2. Generate a warning if any of these options is used when the binary
log is disabled.
Diffstat (limited to 'mysql-test/main/flush2.test')
| -rw-r--r-- | mysql-test/main/flush2.test | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mysql-test/main/flush2.test b/mysql-test/main/flush2.test index 6c06eea0f98..211e37bcbf0 100644 --- a/mysql-test/main/flush2.test +++ b/mysql-test/main/flush2.test @@ -3,6 +3,9 @@ # --source include/not_embedded.inc +--disable_query_log +call mtr.add_suppression("You need to use --log-bin to make --binlog-expire-logs-seconds work."); +--enable_query_log set @save_expire_logs_days=@@global.expire_logs_days; |
