From: Date: October 11 2005 3:01pm Subject: bk commit into 5.0 tree (guilhem:1.2031) BUG#2122 List-Archive: http://lists.mysql.com/internals/30915 X-Bug: 2122 Message-Id: <200510111301.j9BD1S1q027165@gbichot3.local> Below is the list of changes that have just been committed into a local 5.0 repository of guilhem. When guilhem does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2031 05/10/11 15:01:24 guilhem@stripped +1 -0 To help people avoid BUG#2122 "changing hostname confuses master or slave" until it's fixed, we now issue a warning (at slave's server startup only) when a relay log is named using the implicit hostname-relay-bin naming. Like we already do for binlogs. sql/slave.cc 1.260 05/10/11 15:01:20 guilhem@stripped +18 -1 To help people avoid BUG#2122 "changing hostname confuses master or slave" until it's fixed, we now issue a warning (at slave's server startup only) when a relay log is named using the implicit hostname-relay-bin naming. Like I had already added a similar startup warning when a binlog is named using the implicit hostname-bin naming. name_warning_sent is so that at most one warning per startup is sent. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: guilhem # Host: gbichot3.local # Root: /home/mysql_src/mysql-5.0 --- 1.259/sql/slave.cc 2005-10-08 16:39:40 +02:00 +++ 1.260/sql/slave.cc 2005-10-11 15:01:20 +02:00 @@ -1722,9 +1722,26 @@ { char buf[FN_REFLEN]; const char *ln; + static bool name_warning_sent= 0; ln= rli->relay_log.generate_name(opt_relay_logname, "-relay-bin", 1, buf); - + /* We send the warning only at startup, not after every RESET SLAVE */ + if (!opt_relay_logname && !opt_relaylog_index_name && !name_warning_sent) + { + /* + User didn't give us info to name the relay log index file. + Picking `hostname`-relay-bin.index like we do, causes replication to + fail if this slave's hostname is changed later. So, we would like to + instead require a name. But as we don't want to break many existing + setups, we only give warning, not error. + */ + sql_print_warning("Neither --relay-log nor --relay-log-index were used;" + " so replication " + "may break when this MySQL server acts as a " + "slave and has his hostname changed!! Please " + "use '--relay-log=%s' to avoid this problem.", ln); + name_warning_sent= 1; + } /* note, that if open() fails, we'll still have index file open but a destructor will take care of that