Bug #100612 SQL thread prints wrong command in the error log
Submitted: 23 Aug 2020 11:28 Modified: 24 Aug 2020 4:48
Reporter: Venkatesh Prasad Venugopal (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.6,5.7,8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[23 Aug 2020 11:28] Venkatesh Prasad Venugopal
If there is any error while processing the relay log events, SQL thread sometimes prints the below message to the error log and exits.

2020-08-23T11:17:44.627902Z 14580 [ERROR] [MY-010586] [Repl] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'master-bin.000001' position 4381321

However the command mentioned in the message is wrong. It should be "START SLAVE"
 and not "SLAVE START".

How to repeat:
5.6: https://github.com/mysql/mysql-server/blob/5.6/sql/rpl_slave.cc#L6411-L6418

5.7: https://github.com/mysql/mysql-server/blob/5.7/sql/rpl_slave.cc#L7554-L7561

8.0: https://github.com/mysql/mysql-server/blob/8.0/share/messages_to_error_log.txt#L1814-L1818

Suggested fix:
Print the correct SQL command(START SLAVE).
[23 Aug 2020 11:30] Venkatesh Prasad Venugopal
Suggested patch on 5.6 and 5.7:

=== BEGIN ===
diff --git a/sql/rpl_slave.cc b/sql/rpl_slave.cc
index fe4720fa1e8..5cd0d66ba6d 100644
--- a/sql/rpl_slave.cc
+++ b/sql/rpl_slave.cc
@@ -7689,11 +7689,11 @@ extern "C" void *handle_slave_sql(void *arg)
         if (udf_error)
           error_string= "Error loading user-defined library, slave SQL "
             "thread aborted. Install the missing library, and restart the"
-            " slave SQL thread with \"SLAVE START\".";
+            " slave SQL thread with \"START SLAVE\".";
           error_string= "Error running query, slave SQL thread aborted."
             " Fix the problem, and restart the slave SQL thread with "
-            "\"SLAVE START\".";
+            "\"START SLAVE\".";
       goto err;
=== END ===
[23 Aug 2020 11:32] Venkatesh Prasad Venugopal
Contributed patch for 5.6

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: MySQL_Bug100612.diff (text/x-patch), 747 bytes.

[24 Aug 2020 4:48] MySQL Verification Team
Hello Venu,

Thank you for the report and contribution.