Bug #116055 MY-004085 and MY-014054 message is bit wrong
Submitted: 11 Sep 2024 5:54 Modified: 11 Sep 2024 6:32
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:8.0.39, 8.4.2, 9.0.1 OS:CentOS (7.9)
Assigned to: CPU Architecture:x86
Tags: Could not purge binary logs since another session is executing LOCK INSTANCE FOR, ER_LOG_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK

[11 Sep 2024 5:54] Tsubasa Tanaka
Description:
Error message of MY-014054 describes,

---
MySQL error code MY-014054 (ER_LOG_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK): Could not purge binary logs since another session is executing LOCK INSTANCE FOR BACKUP. Wait for that session to release the lock.
---

But actually, not only "another session", even if executing LOCK INSTANCE FOR BACKUP by current thread itself, this error will occur.

How to repeat:
mysql> LOCK INSTANCE FOR BACKUP;
Query OK, 0 rows affected (0.00 sec)

mysql> PURGE BINARY LOGS BEFORE NOW();
ERROR 4085 (HY000): Could not purge binary logs since another session is executing LOCK INSTANCE FOR BACKUP. Wait for that session to release the lock.

Suggested fix:
Fix error message

> Could not purge binary logs since another session is executing LOCK INSTANCE FOR BACKUP.

to

> Could not purge binary logs since executing LOCK INSTANCE FOR BACKUP. Wait for 
 release the lock.
[11 Sep 2024 6:22] MySQL Verification Team
Hello tanaka-San,

Thank you for the report and feedback.

regards,
Umesh
[11 Sep 2024 6:32] Tsubasa Tanaka
Fix Synopsis, this report had mixed 2 error messages.

Both MY-004085 (ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK) and MY-014054 (ER_LOG_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK) are affected.

---

$ perror ER_LOG_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK
MySQL error code MY-014054 (ER_LOG_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK): Could not purge binary logs since another session is executing LOCK INSTANCE FOR BACKUP. Wait for that session to release the lock.

$ perror ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK
MySQL error code MY-004085 (ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK): Could not purge binary logs since another session is executing LOCK INSTANCE FOR BACKUP. Wait for that session to release the lock.