Bug #120558 Redo log archiving started by dead connection cannot be disabled later
Submitted: 27 May 11:21 Modified: 27 May 11:41
Reporter: Przemyslaw Malkowski Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.4.8 OS:Any
Assigned to: CPU Architecture:Any
Tags: innodb_redo_log_archive_start

[27 May 11:21] Przemyslaw Malkowski
Description:
When redo log archiving is started by a thread, which crashes or gets killed during backup, there is no way to stop/restart archiving later, as by design, only the owner can stop it:

mysql > select innodb_redo_log_archive_stop();
ERROR 3851 (HY000): Redo log archiving has not been started by this session

Setting an empty innodb_redo_log_archive_dirs also does not help in stopping active archiving. The only way is to restart.

How to repeat:
Start redo archiving:

mysql > set global innodb_redo_log_archive_dirs='backup1:/msb_8_4_8/tmp';
Query OK, 0 rows affected (0.00 sec)

mysql > select innodb_redo_log_archive_start('backup1', '1779879597979');
+-----------------------------------------------------------+
| innodb_redo_log_archive_start('backup1', '1779879597979') |
+-----------------------------------------------------------+
|                                                         0 |
+-----------------------------------------------------------+
1 row in set (0.02 sec)

Then kill this client's session:

mysql > kill 8;
Query OK, 0 rows affected (0.00 sec)

From now on, the owner thread is gone, and no way to start/stop archiving:

mysql > select innodb_redo_log_archive_start('backup1', '1779879597979');
ERROR 3848 (HY000): Redo log archiving has been started on '/msb_8_4_8/tmp/1779879597979/archive.00008412-0000-0000-0000-000000008412.000001.log' - Call innodb_redo_log_archive_stop() first

mysql > select innodb_redo_log_archive_stop();
ERROR 3851 (HY000): Redo log archiving has not been started by this session

Suggested fix:
A super user should have the ability to stop archiving when the original owner's thread is no longer there.
[27 May 11:41] Przemyslaw Malkowski
Let me add that the behavior described in the documentation:
https://dev.mysql.com/doc/refman/8.4/en/innodb-redo-log.html

Does not seem to work, quoting:
" If the session is terminated before the redo log archiving is explicitly deactivated, the server deactivates redo log archiving implicitly and removes the redo log archive file."