Bug #100913 | Enterprise backup did failed to use Redolog archive feature | ||
---|---|---|---|
Submitted: | 22 Sep 2020 12:56 | Modified: | 10 Jan 2021 19:15 |
Reporter: | Marco Tusa | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Enterprise Backup | Severity: | S2 (Serious) |
Version: | 8.0.21 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Backup, Enterprise, redolog |
[22 Sep 2020 12:56]
Marco Tusa
[22 Sep 2020 12:57]
Marco Tusa
Forgot to add. Was following the documentation here: https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html#innodb-redo-log-archiving https://dev.mysql.com/doc/mysql-enterprise-backup/8.0/en/backup-incremental-options.html
[23 Sep 2020 6:42]
Ingo Strüwing
This is likely a bug in mysqlbackup. It creates the directory with 0777. So it allows world access. That should be fixed. If that is indeed the problem, you could work around this by setting umask with a 7 at the end. Can you please verify, if that fixes the problem? Regarding the suspect, that mysqlbackup does not create the directory, I recommend to add --trace=3 to the mysqlbackup command line. The log is way more detailed then, and the creation of the directory should be logged. When mysqlbackup cannot start the redo logging, it removes the directory, so that it doesn't leave it behind. That is the likely reason, that you don't find it afterwards. --trace=3 should also log that deletion.
[23 Sep 2020 11:13]
Marco Tusa
Thank you Ingo! Yes I confirm that the issue was on the permission and with umask on the mountpoint I was able to run it and got: [root@master3 archive]# ll 16008594410996540/ total 284 -r--------. 1 mysql mysql 290816 Sep 23 2020 archive.42911622-fc08-11ea-8b18-08002734ed50.000001.log I will still keep as Feature request that when there is an already running process dumping the redolog changes, mysqlbackup should use that instead asking to perform a STOP.
[23 Sep 2020 12:33]
MySQL Verification Team
Thank you for the report and feedback. I'm not seeing the exact error but do observed that MEB fails to create the target directory. rm -rf 100913/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/100913 --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/100913 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/100913/log.err --mysqlx=0 --log-error-verbosity=3 --secure-file-priv="" --performance-schema=ON 2>&1 & umask 0022 mkdir -p /export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive/ - bin/mysql -uroot -S /tmp/mysql_ushastry.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 8.0.21-commercial MySQL Enterprise Server - Commercial Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SET GLOBAL innodb_redo_log_archive_dirs='full:/export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive/;'; Query OK, 0 rows affected (0.00 sec) mysql> show global variables like 'innodb_redo_log_archive_dirs'; +------------------------------+-------------------------------------------------------------------------------+ | Variable_name | Value | +------------------------------+-------------------------------------------------------------------------------+ | innodb_redo_log_archive_dirs | full:/export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive/; | +------------------------------+-------------------------------------------------------------------------------+ 1 row in set (0.00 sec) With --trace=3 - bin/mysqlbackup --trace=3 --show-progress=stdout --user=root --socket=/tmp/mysql_ushastry.sock --process-threads=4 --port=3333 --backup-dir=/tmp/mysql_backup/meb/1 backup > file.txt 2>&1 - 200923 14:22:34 MAIN TRACE_1: Executing MySQL query 'SELECT @@GLOBAL.innodb_redo_log_archive_dirs' 200923 14:22:34 MAIN TRACE_3: query result requested: 1, stored: 1 200923 14:22:34 MAIN TRACE_3: mysql_conn_query returns 0 (0 == success) 200923 14:22:34 MAIN TRACE_2: Global server system variable 'innodb_redo_log_archive_dirs' is 'full:/export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive/;'. 200923 14:22:34 MAIN TRACE_2: [MKDIR] /export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive/16008637540602760 200923 14:22:34 MAIN TRACE_2: Directory '/' does already exist. 200923 14:22:34 MAIN TRACE_2: Directory '/export' does already exist. 200923 14:22:34 MAIN TRACE_2: Directory '/export/umesh' does already exist. 200923 14:22:34 MAIN TRACE_2: Directory '/export/umesh/server' does already exist. 200923 14:22:34 MAIN TRACE_2: Directory '/export/umesh/server/binaries' does already exist. 200923 14:22:34 MAIN TRACE_2: Directory '/export/umesh/server/binaries/GABuilds' does already exist. 200923 14:22:34 MAIN TRACE_2: Directory '/export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21' does already exist. 200923 14:22:34 MAIN TRACE_2: Directory '/export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive' does already exist. 200923 14:22:34 MAIN TRACE_3: Created path '/export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive/16008637540602760' 200923 14:22:34 MAIN TRACE_1: Executing MySQL query 'DO innodb_redo_log_archive_start('full','16008637540602760');' - ls -l archive/ total 0 - manually mysql> DO innodb_redo_log_archive_start('full','16008638940647671'); ERROR 3844 (HY000): Redo log archive directory '/export/umesh/server/binaries/GABuilds/mysql-commercial-8.0.21/archive/16008638940647671' does not exist or is not a directory mysql> \q
[23 Sep 2020 14:11]
Ingo Strüwing
Hi Marco, so your feature request is to allow multiple sessions to run archive logging in parallel? When we designed the redo log archiving feature, we had some thoughts about this. However it looked too difficult for a first implementation. We identified two possible options to implement it. A) [This is probably, what you suggest.] Start redo log archiving when the first session requests it. Count the sessions, that request to start archiving while it is going on already. Decrement the counter when a session requests to stop redo log archiving. When the counter reaches zero, stop redo log archiving. That way we have just one redo log archive file. The redo log blocks need to be written twice only (to the ib_logfile* and to the archive file). The downside is, that the file could grow very large, if many sessions request archiving overlapping. This could be mitigated by hole punching, if we remember, which segment of the log belongs to which session. Also we need extra algorithms to determine, when the file can be deleted altogether. B) Allow each session to have its own redo log archive file. The ownership of the file remains with the client. It can still delete its file when no longer needed. The downside is, that the redo log blocks have to be written multiple times, which could cause a slow-down of the server if many session run that in parallel. In summary I would appreciate, if you could file a separate feature request, explaining as detailed as possible, how you imagine, that it should work. Regards Ingo
[23 Sep 2020 14:19]
Marco Tusa
Ingo, actually you capture my idea with A). But I will discuss internally also to collect more feedback and will confirm, which can be the best option for us. Thank you again.
[7 Oct 2020 14:24]
Marco Tusa
Ingo, as I was supposing we all think that the A) solution with a single file, is preferable.
[7 Oct 2020 14:35]
Ingo Strüwing
Ok, fine. Can you please file a separate bug report and mark it as S4 (feature request)? The directory permission problem will be fixed in MEB and should be available in a release next year.
[10 Jan 2021 19:15]
Daniel So
Posted by developer: Added the following entry to the MySQL Enterprise Backup 8.0.23 changelog: "On a Windows platform, when the value of the server's system variable innodb_redo_log_archive_dirs was an absolute path name without a label, a backup operation for the server failed with the error message that the archive directory was accessible to all OS users. This was due to mysqlbackup misinterpreting the path name in the situation. With this fix, the path name is now properly interpreted, and if the archive does not exist, a proper error is thrown."
[13 Jan 2021 2:12]
Daniel So
Posted by developer: Corrected the changelog entry to the following: "A backup using redo log archiving failed, because mysqlbackup created a subdirectory under the redo log archiving directory (specified in innodb_redo_log_archive_dirs) that was accessible to all OS users, and that was not allowed. With this fix, a subdirectory with the proper permission is created under the situation."