summaryrefslogtreecommitdiff
path: root/sql/slave.h
Commit message (Collapse)AuthorAgeFilesLines
* many warnings (practically safe but annoying) correctedserg@serg.mylan2006-01-031-1/+1
|
* Merge mysql.com:/home/mysql_src/mysql-4.1guilhem@mysql.com2005-10-121-0/+11
|\ | | | | | | | | into mysql.com:/home/mysql_src/mysql-5.0; a very bad automerge (issues with non-ascii chars), plus some hard conflicts I'll fix by hand in a next cset
| * Fix for BUG#13023: "SQL Thread is up but doesn't move forward". Details in ↵guilhem@mysql.com2005-10-121-0/+11
| | | | | | | | | | | | | | | | | | | | slave.cc; in short we now record whenever the slave I/O thread ignores a master's event because of its server id, and use this info in the slave SQL thread to advance Exec_master_log_pos. Because if we do not, this variable stays at the position of the last executed event, i.e. the last *non-ignored* executed one, which may not be the last of the master's binlog (and so the slave *looks* behind the master though it's data-wise it's not).
* | pthread_handler_decl() changed to be ctags-friendlyserg@serg.mylan2005-10-081-2/+2
| | | | | | | | (and contain extern "C" when necessary)
* | Fixed several boolean type options used in my_long_options[].jani@ua141d10.elisa.omakaista.fi2005-10-041-1/+2
| | | | | | | | | | | | | | Some options were declared as 'bool', but since those are being handled in my_getopt.c, bool can be machine dependent. To make sure it works in all circumstances, the type should be my_bool for C (not C++) programs.
* | merge from 4.1gbichot@quadita2.mysql.com2005-03-241-1/+8
|\ \ | |/
| * "After Monty's review" changes to the fix for BUG#8325 "Deadlock in ↵gbichot@quadita2.mysql.com2005-03-231-1/+8
| | | | | | | | | | | | | | | | | | replication thread stops replication": s/sleep/safe_sleep (thread safe); sleep 0/1/2/3/4/5/5/5 (get slave less late); no message on error log (deadlock is too common sometimes), a global counter instead (SHOW STATUS LIKE 'slave_retried_transactions'). Plus a fix for libmysql/Makefile.shared
* | Last part of WL#1062: better replication of timezones: no more usegbichot@production.mysql.com2005-03-221-0/+1
| | | | | | | | | | of SET ONE_SHOT; storing tz info directly in event (if this info is needed), it's now allowed to have different global tz on master and slave.
* | Mergeguilhem@mysql.com2005-03-021-1/+2
|\ \ | |/
| * Fix for BUG#8325 "Deadlock in replication thread stops replication":guilhem@mysql.com2005-03-021-1/+3
| | | | | | | | | | in slave SQL thread: if a transaction fails because of InnoDB deadlock or innodb_lock_wait_timeout exceeded, optionally retry the transaction a certain number of times (new variable --slave_transaction_retries).
* | manually mergedserg@serg.mylan2005-02-141-10/+9
|\ \
| * | open binlog index file *before* tc_log->open() and binlog itself *after*serg@serg.mylan2005-02-011-10/+9
| | |
* | | WL#1062 "log charset info into all Query_log_event":guilhem@mysql.com2005-02-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we store 7 bytes (1 + 2*3) in every Query_log_event. In the future if users want binlog optimized for small size and less safe, we could add --binlog-no-charset (and binlog-no-sql-mode etc): charset info is something by design optional (even if for now we don't offer possibility to disable it): it's not a binlog format change. We try to reduce the number of get_charset() calls in the slave SQL thread to a minimum by caching the charset read from the previous event (which will often be equal to the one of the current event). We don't use SET ONE_SHOT for charset-aware repl (we still do for timezones, will be fixed later). No more errors if one changes the global value of charset vars on master or slave (as we log charset info in all Query_log_event). Not fixing Load_log_event as it will be rewritten soon by Dmitri. Testing how mysqlbinlog behaves in rpl_charset.test. mysqlbinlog needs to know where charset file is (to be able to convert a charset number found in binlog (e.g. in User_var_log_event) to a charset name); mysql-test-run needs to pass the correct value for this option to mysqlbinlog. Many result udpates (adding charset info into every event shifts log_pos in SHOW BINLOG EVENTS). Roughly the same job is to be done for timezones :)
* | | Merge with 4.1monty@mishka.local2004-12-221-5/+22
|\ \ \ | |/ / |/| / | |/
| * A change of behaviour of Seconds_Behind_Master from SHOW SLAVE STATUS. It's ↵guilhem@mysql.com2004-12-161-5/+22
| | | | | | | | | | | | | | going into 4.1 because old behaviour was somewhat nonsensical (kind of bug). Changes are that if repl threads are down or disconnected the column will be NULL, and if master is idle the column will not grow indefinitely anymore.
* | Merge with 4.1monty@mysql.com2004-12-061-1/+1
|\ \ | |/
| * Due to a compiler bug, slave.cc:tables_ok() sometimes wrongly returnslars@mysql.com2004-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1 if the return type is int or int_fast8_t. The test case that showed this problem is rpl000001 and the tested version was MySQL 5.0.2. The compiler with the problem is GCC 3.0.4 runing on "Linux bitch 2.4.18 #2 Thu Apr 11 14:37:17 EDT 2002 sparc64 unknown". By changing the return type to bool the problem disappear. (Another way to make the problem disappear is to simply print the returned value with printf("%d",?). The printed returned value is always 0 in the test cases I have run.) This is only a partial solution to the problem, since someone could later change the return type of the function back to int or some other type that does not work.
* | Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1tomas@poseidon.ndb.mysql.com2004-11-261-1/+2
|\ \ | |/ | | | | into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
| * Mergemats@mysql.com2004-11-251-1/+2
| |\
| | * Fix for Bug#6148. Only rewind read position in binary log when themats@mysql.com2004-11-251-1/+2
| | | | | | | | | | | | slave SQL thread is started.
* | | mergedserg@serg.mylan2004-11-171-1/+1
|\ \ \ | |/ /
| * | Fixes for compilation errors in Windows (casts from uint32* to uint*) in ↵guilhem@mysql.com2004-11-171-1/+1
| | | | | | | | | | | | | | | | | | repl and charset code. Moving the part of user_var.test using UCS2 to ctype_ucs.test
* | | mergebell@sanja.is.com.ua2004-11-121-2/+2
|\ \ \
| * | | errors without code removedbell@sanja.is.com.ua2004-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed (WL#2133)
* | | | Resolved merge from 4.1 -> 5.0 (mainly Guilhem's work with mysqldump)brian@avenger.(none)2004-11-111-2/+2
|\ \ \ \ | | |/ / | |/| |
| * | | Optimization: in the replication slave, we can avoid doing one strlen() per ↵guilhem@mysql.com2004-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | event's execution, as we already have db_len in Log_event. Only if rewrite_db() changed the db we need a strlen (so we now do the strlen() in rewrite_db). Plus a test (we had none for --replicate-rewrite-db :( ).
* | | | merge with 4.1monty@mysql.com2004-10-291-0/+16
|\ \ \ \ | |/ / / | | / / | |/ / |/| |
| * | Merge with 4.0 for 4.1 releasemonty@mysql.com2004-10-061-0/+16
| |\ \ | | |/ | | | | | | | | | | | | | | | Noteworthy: - New HANDLER code - New multi-update-grant-check code - Table lock code in ha_innodb.cc was not applied
| | * Updating the headers on a few files to include GPL header.brian@brian-akers-computer.local2004-09-081-0/+16
| | |
* | | Post-merge fixes.pem@mysql.comhem.se2004-05-141-3/+5
| | | | | | | | | | | | Note: One sp.test still fails (prime), and rpl_server_id2.test fails (will be fixed by guilhem ASAP).
* | | Merge 4.1 -> 5.0pem@mysql.com2004-05-071-55/+4
|\ \ \ | |/ /
| * | Merge with 4.0.19monty@mysql.com2004-05-051-1/+1
| |\ \ | | |/
| | * A new option --replicate-same-server-id to force a slave to execute queries ↵guilhem@mysql.com2004-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | originating from itself (WL#794). This can be of interest in some recovery-from-backup scenarios, and also when you have two databases in one mysqld, having a certain similarity and you want one db to be updated when the other is (some sort of trigger). Plus small fix for BUG#3568 "MySQL server crashes when built --with-debug and CHANGE MASTER +MASTER_POS_WAIT"
| | * This is a fix for a bug in 3.23 -> 4.0 replication: Exec_master_log_pos is ↵guilhem@mysql.com2004-04-071-28/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | always too big by 6 bytes. So I add code to substract 6 bytes if the master is 3.23. This is not perfect (because it won't work if the slave I/O thread has not noticed yet that the master is 3.23), but as long as the slave I/O thread starts Exec_master_log_pos will be ok. It must be merged to 4.1 but not to 5.0 (or it can be, because of #if MYSQL_VERSION_ID), because 5.0 already works if the master is 3.23 (and in a more natural way: in 5.0 we store the end_log_pos in the binlog and relay log). I had to move functions from slave.h to slave.cc to satisfy gcc.
| * | After merge fixesmonty@mishka.local2004-04-271-28/+1
| | | | | | | | | | | | Changed 'SHOW FIELD STATUS' to use 'Engine' instead of 'Type'
* | | Merge 4.1 -> 5.0.pem@mysql.com2004-04-071-27/+25
|\ \ \ | |/ /
| * | After merge fixesmonty@mysql.com2004-03-171-2/+1
| | |
| * | merge with 4.0monty@mysql.com2004-03-161-24/+25
| |\ \ | | |/
| | * Fix for BUG#2921 "Replication problem on mutex lock in mySQL-4.0.18":guilhem@mysql.com2004-03-111-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-using unused LOCK_active_mi to serialize all administrative commands related to replication: START SLAVE, STOP SLAVE, RESET SLAVE, CHANGE MASTER, init_slave() (replication autostart at server startup), end_slave() (replication autostop at server shutdown), LOAD DATA FROM MASTER. This protects us against a handful of deadlocks (like BUG#2921 when two START SLAVE, but when two STOP SLAVE too). Removing unused variables.
| | * Backporting parts ofguilhem@mysql.com2004-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | ChangeSet 1.1620.12.1 and ChangeSet 1.1625.2.1 from 4.1. This makes the slave I/O thread flush the relay log after every event, which provides additional safety in case of brutal crash (reduces chances to lose a part of the relay log).
| | * Undoing 2 parts of changeset 1.1730.1.1 :guilhem@mysql.com2004-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | - the one about BUG#2921 - the one about relay log flushing Both will be rewritten in a next changeset (this one will not be pushed before the next changeset).
| | * Fixed memory leak in DROP DATABASE when using RAID tables (Bug #2882)monty@mysql.com2004-03-101-1/+1
| | |
| | * Fix for BUG#3015guilhem@mysql.com2004-03-011-5/+9
| | | | | | | | | | | | | | | | | | "(binlog, position) stored by InnoDB for a replication slave can be wrong". This code contains conditional #if to distinguish between versions; it should be merged into 4.1 and 5.0.
* | | Merge 4.1 into 5.0.pem@mysql.com2004-02-101-0/+5
|\ \ \ | |/ /
| * | Fixed bug in table level privilege GRANT handling. (Bug #2178)monty@mysql.com2003-12-261-0/+5
| | | | | | | | | | | | Portability fixes
* | | This will be pushed only after I fix the testsuite.guilhem@gbichot22003-12-181-18/+42
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the main commit for Worklog tasks: * A more dynamic binlog format which allows small changes (1064) * Log session variables in Query_log_event (1063) Below 5.0 means 5.0.0. MySQL 5.0 is able to replicate FOREIGN_KEY_CHECKS, UNIQUE_KEY_CHECKS (for speed), SQL_AUTO_IS_NULL, SQL_MODE. Not charsets (WL#1062), not some vars (I can only think of SQL_SELECT_LIMIT, which deserves a special treatment). Note that this works for queries, except LOAD DATA INFILE (for this it would have to wait for Dmitri's push of WL#874, which in turns waits for the present push, so... the deadlock must be broken!). Note that when Dmitri pushes WL#874 in 5.0.1, 5.0.0 won't be able to replicate a LOAD DATA INFILE from 5.0.1. Apart from that, the new binlog format is designed so that it can tolerate a little variation in the events (so that a 5.0.0 slave could replicate a 5.0.1 master, except for LOAD DATA INFILE unfortunately); that is, when I later add replication of charsets it should break nothing. And when I later add a UID to every event, it should break nothing. The main change brought by this patch is a new type of event, Format_description_log_event, which describes some lengthes in other event types. This event is needed for the master/slave/mysqlbinlog to understand a 5.0 log. Thanks to this event, we can later add more bytes to the header of every event without breaking compatibility. Inside Query_log_event, we have some additional dynamic format, as every Query_log_event can have a different number of status variables, stored as pairs (code, value); that's how SQL_MODE and session variables and catalog are stored. Like this, we can later add count of affected rows, charsets... and we can have options --don't-log-count-affected-rows if we want. MySQL 5.0 is able to run on 4.x relay logs, 4.x binlogs. Upgrading a 4.x master to 5.0 is ok (no need to delete binlogs), upgrading a 4.x slave to 5.0 is ok (no need to delete relay logs); so both can be "hot" upgrades. Upgrading a 3.23 master to 5.0 requires as much as upgrading it to 4.0. 3.23 and 4.x can't be slaves of 5.0. So downgrading from 5.0 to 4.x may be complicated. Log_event::log_pos is now the position of the end of the event, which is more useful than the position of the beginning. We take care about compatibility with <5.0 (in which log_pos is the beginning). I added a short test for replication of SQL_MODE and some other variables. TODO: - after committing this, merge the latest 5.0 into it - fix all tests - update the manual with upgrade notes.
* | Replication:guilhem@gbichot22003-11-231-1/+1
| | | | | | | | | | | | | | | | | | Now the I/O thread (in flush_master_info()) flushes the relay log to disk after reading every event. Slower but provides additionnal safety in case of brutal crash. I had to make the flush optional (i.e. add a if(some_bool_argument) in the function) because sometimes flush_master_info() is called when there is no usable relay log (the relay log's IO_CACHE is not initialized so can't be flushed).
* | Merge with 4.0monty@narttu.mysql.fi2003-11-041-1/+1
|\ \ | |/
| * Portability fixmonty@narttu.mysql.fi2003-11-021-1/+1
| |
| * 4 small items in this:guilhem@mysql.com2003-10-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | - when we don't have in_addr_t, use uint32. - a forgotten initialization of slave_proxy_id in sql/log_event.cc (was not really "forgot", was "we needn't init it there", but there was one case where we needed...). - made slave_proxy_id always meaningful in THD and Log_event, so we can rely more on it (no need to test if it's meaningful). THD::slave_proxy_id is equal to THD::thread_id except for the slave SQL thread. - clean up the slave's temporary table (i.e. free their memory) when slave server shuts down.