mariadb/sql
Luis Soares 4a6c4d8603 BUG#12400313 RELAY_LOG_SPACE_LIMIT IS NOT WORKING IN MANY CASES
BUG#64503: mysql frequently ignores --relay-log-space-limit

When the SQL thread goes to sleep, waiting for more events, it sets
the flag ignore_log_space_limit to true. This gives the IO thread a
chance to queue some more events and ultimately the SQL thread will be
able to purge the log once it is rotated. By then the SQL thread
resets the ignore_log_space_limit to false. However, between the time
the SQL thread has set the ignore flag and the time it resets it, the
IO thread will be queuing events in the relay log, possibly going way
over the limit.

This patch makes the IO and SQL thread to synchronize when they reach
the space limit and only ask for one event at a time. Thus the SQL
thread sets ignore_log_space_limit flag and the IO thread resets it to
false everytime it processes one more event. In addition, everytime
the SQL thread processes the next event, and the limit has been
reached, it checks if the IO thread should rotate. If it should, it
instructs the IO thread to rotate, giving the SQL thread a chance to
purge the logs (freeing space). Finally, this patch removes the
resetting of the ignore_log_space_limit flag from purge_first_log,
because this is now reset by the IO thread every time it processes the
next event when the limit has been reached.

If the SQL thread is in a transaction, it cannot purge so, there is no
point in asking the IO thread to rotate. The only thing it can do is
to ask for more events until the transaction is over (then it can ask
the IO to rotate and purge the log right away). Otherwise, there would
be a deadlock (SQL would not be able to purge and IO thread would not
be able to queue events so that the SQL would finish the transaction).
2012-03-12 12:28:27 +00:00
..
examples Updated/added copyright headers 2011-06-30 17:31:31 +02:00
share BUG#11758062 - 50206: ER_TOO_BIG_SELECT REFERS TO OUTMODED 2011-09-28 15:39:21 +05:30
.cvsignore
add_errmsg
authors.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
client_settings.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
CMakeLists.txt Updated/added copyright headers 2012-02-15 17:21:38 +01:00
contributors.h
custom_conf.h
debug_sync.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
debug_sync.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
derror.cc Fix for BUG#11755168 '46895: test "outfile_loaddata" fails (reproducible)'. 2011-05-16 22:04:01 +02:00
des_key_file.cc
discover.cc
event_data_objects.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
event_data_objects.h
event_db_repository.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
event_db_repository.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
event_parse_data.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
event_parse_data.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
event_queue.cc
event_queue.h
event_scheduler.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
event_scheduler.h
events.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
events.h
field.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
field.h Backmerge of BUG#12997905 2011-11-18 14:47:11 +01:00
field_conv.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
filesort.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
frm_crypt.cc
gen_lex_hash.cc Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
gstream.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
gstream.h
ha_ndbcluster.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
ha_ndbcluster.h
ha_ndbcluster_binlog.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
ha_ndbcluster_binlog.h
ha_ndbcluster_cond.cc
ha_ndbcluster_cond.h
ha_ndbcluster_tables.h
ha_partition.cc Bug#11766879/Bug#60106: DIFF BETWEEN # OF INDEXES IN MYSQL VS INNODB, 2011-08-23 15:13:17 +02:00
ha_partition.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
handler.cc Fix Bug#12661768 UPDATE IGNORE CRASHES SERVER IF TABLE IS INNODB AND IT IS 2011-10-25 16:46:38 +03:00
handler.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
hash_filo.cc
hash_filo.h
hostname.cc BUG#12377872 ASSERTION FAILED: !_ENTERED WHEN GETHOSTBYADDR_R 2011-04-20 11:32:28 +02:00
init.cc
item.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
item.h Updated/added copyright headers 2011-06-30 17:31:31 +02:00
item_buff.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_cmpfunc.cc Updated/added copyright headers 2011-06-30 17:31:31 +02:00
item_cmpfunc.h Bug#13012483:EXPLAIN EXTENDED, PREPARED STATEMENT, CRASH IN 2012-02-24 11:53:36 +05:30
item_create.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
item_create.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_func.cc Updated/added copyright headers 2011-06-30 17:31:31 +02:00
item_func.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_geofunc.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_geofunc.h Updating header copyright/README in source for 2011 2011-01-25 15:42:40 +01:00
item_row.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_row.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_strfunc.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
item_strfunc.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
item_subselect.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
item_subselect.h Updated/added copyright headers 2012-02-15 17:21:38 +01:00
item_sum.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
item_sum.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_timefunc.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
item_timefunc.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
item_xmlfunc.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
item_xmlfunc.h
key.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
lex.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
lex_symbol.h
lock.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
log.cc BUG#12400313 RELAY_LOG_SPACE_LIMIT IS NOT WORKING IN MANY CASES 2012-03-12 12:28:27 +00:00
log.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
log_event.cc DBUG_PRINT in solaris does not work well with NULL parameters. 2011-07-15 12:42:06 +01:00
log_event.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
log_event_old.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
log_event_old.h
Makefile.am Updated/added copyright headers 2012-02-15 17:21:38 +01:00
message.h Updated/added copyright headers 2011-06-30 17:31:31 +02:00
message.mc
message.rc
mf_iocache.cc
MSG00001.bin
my_decimal.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
my_decimal.h Updated/added copyright headers 2012-02-15 17:21:38 +01:00
my_lock.c
mysql_priv.h Merge from mysql-5.0.94-release 2011-07-06 11:36:39 +02:00
mysql_priv.h.pp
mysqld.cc Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS 2011-11-30 17:11:13 +01:00
mysqld_suffix.h
net_serv.cc Updated/added copyright headers 2011-06-30 17:31:31 +02:00
nt_servc.cc
nt_servc.h
opt_range.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
opt_range.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
opt_sum.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
parse_file.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
parse_file.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
partition_element.h
partition_info.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
partition_info.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
password.c Updated/added copyright headers 2011-07-03 17:47:37 +02:00
procedure.cc
procedure.h
protocol.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
protocol.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
records.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
repl_failsafe.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
repl_failsafe.h
rpl_constants.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_filter.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_filter.h
rpl_injector.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_injector.h
rpl_mi.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_mi.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_record.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_record.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_record_old.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_record_old.h
rpl_reporting.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_reporting.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_rli.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_rli.h BUG#12400313 RELAY_LOG_SPACE_LIMIT IS NOT WORKING IN MANY CASES 2012-03-12 12:28:27 +00:00
rpl_tblmap.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_tblmap.h
rpl_utility.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
rpl_utility.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
scheduler.cc
scheduler.h
set_var.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
set_var.h Updated/added copyright headers 2011-06-30 17:31:31 +02:00
signal_handler.cc Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS 2011-11-30 15:39:29 +01:00
slave.cc BUG#12400313 RELAY_LOG_SPACE_LIMIT IS NOT WORKING IN MANY CASES 2012-03-12 12:28:27 +00:00
slave.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sp.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sp.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sp_cache.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sp_cache.h
sp_head.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
sp_head.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sp_pcontext.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sp_pcontext.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sp_rcontext.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sp_rcontext.h
spatial.cc Updated/added copyright headers 2011-07-03 20:08:47 +02:00
spatial.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_acl.cc Updated/added copyright headers 2011-06-30 17:31:31 +02:00
sql_acl.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_analyse.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_analyse.h
sql_array.h
sql_base.cc Merge. 2011-08-24 11:18:00 +04:00
sql_binlog.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_bitmap.h
sql_builtin.cc.in
sql_cache.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
sql_cache.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_class.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
sql_class.h Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C 2011-08-02 11:33:45 +04:00
sql_client.cc
sql_connect.cc Updated/added copyright headers 2012-02-15 17:21:38 +01:00
sql_crypt.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_crypt.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_cursor.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_cursor.h
sql_db.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_delete.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_derived.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_do.cc
sql_error.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_error.h
sql_handler.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_help.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_insert.cc Bug#11759688 52020: InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY 2011-11-10 12:49:31 +02:00
sql_lex.cc Manual merge from mysql-5.1. 2011-08-09 11:42:07 +04:00
sql_lex.h Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C 2011-08-02 11:33:45 +04:00
sql_list.cc
sql_list.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_load.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
sql_locale.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_manager.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_map.cc
sql_map.h
sql_olap.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_parse.cc BUG 13454045 - 63524: BUG #35396 "ABNORMAL/IMPOSSIBLE/LARGE QUERY_TIME AND LOCK_TIME" HAPPENS A 2012-02-19 03:18:49 +00:00
sql_partition.cc merge of mysql-5.1->mysql-5.1-security 2011-06-06 16:53:46 +03:00
sql_partition.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_plugin.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_plugin.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_prepare.cc Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C 2011-08-02 11:33:45 +04:00
sql_profile.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_profile.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_rename.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_repl.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_repl.h
sql_select.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
sql_select.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_servers.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_servers.h
sql_show.cc Updated/added copyright headers 2012-02-16 11:35:30 +01:00
sql_show.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_sort.h
sql_state.c
sql_string.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
sql_string.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_table.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
sql_tablespace.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_test.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_trigger.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_trigger.h Updated/added copyright headers 2011-07-03 17:47:37 +02:00
sql_udf.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_udf.h
sql_union.cc Bug#11765255 - 58201: VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS 2011-07-11 11:20:19 +02:00
sql_update.cc Updated/added copyright headers 2011-06-30 17:31:31 +02:00
sql_view.cc Updated/added copyright headers 2012-02-15 17:13:47 +01:00
sql_view.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql_yacc.yy Merge from mysql-5.1.59-release 2011-09-15 18:48:54 +02:00
strfunc.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
structs.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
table.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
table.h Updated/added copyright headers 2011-06-30 17:31:31 +02:00
thr_malloc.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
time.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
tzfile.h
tztime.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
tztime.h Updated/added copyright headers 2011-06-30 17:37:13 +02:00
udf_example.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
udf_example.def
uniques.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
unireg.cc Updated/added copyright headers 2011-07-03 17:47:37 +02:00
unireg.h Updated/added copyright headers 2012-02-15 17:21:38 +01:00