WL#2688: Enable --log-bin by default, make 1 be default of server_id, make START SLAVE report initial errors
Affects: Server-7.1 — Status: Un-Assigned — Priority: Medium
SUMMARY ------- 1. Enable --log-bin by default 2. Set server id to 1 by defult 3. START SLAVE to report same server id error directly 4. Update manual with new behaviour MOTIVATION ---------- Requests from Monty. 1. The root idea is: enable --log-bin by default in MySQL 5.1 (Guilhem's reasons: is safer for the users and better for the reputation of MySQL). 2. Consequence: master will in most cases print: 050703 17:18:26 [Warning] You have enabled the binary log, but you haven't set server-id to a non-zero value: we force server id to 1; updates will be logged to the binary log, but connections from slaves will not be accepted. To avoid this message, we should set server-id to 1 by default in 5.1, instead of 0. 3. Consequence: a master and slave, if they didn't set server-id, will both have 1, which replication forbids: slave I/O thread will print to the error log: "The slave I/O thread stops because master and slave have equal \ MySQL server ids; these ids must be different for replication \ to work (or the --replicate-same-server-id option must be used \ on slave but this does not always make sense; \ please check the manual before using it).". Given that this error is going to be more likely, and given that people don't look at error logs, it would be better if "START SLAVE" printed it (instead of only error log). This requires a change in START SLAVE: currently START SLAVE starts the two threads (in the sense of pthread_create()) and returns. Here we would want START SLAVE to wait a little bit (10 seconds) after starting the threads and before returning; if during these 10 secs the two threads set a variable to say "I'm successfully receiving master's binlog" for the I/O thread, and "I'm successfully reading relay log" for the SQL thread, then START SLAVE should return immediately. If not, it should time out after 10 seconds and issue a message to the client, either saying "problem, one of the two slave threads failed, check your error log", or even better printing the message which was returned by the failing thread ("same server_ids" in our example). This is for "ease of use". 4. Manual should then be updated with the new behaviour "Starting from MySQL 5.1.0, etc". Couting 2*8 hours for code, 8 hours for doc and warning support/training/consulting and fixing our support-files/ sample files.
Copyright (c) 2000, 2016, Oracle Corporation and/or its affiliates. All rights reserved.