Commit 5ed31f10 authored by Michael Widenius's avatar Michael Widenius

Automatic merge

parents f40f0ff6 5c3e18fe
...@@ -603,24 +603,25 @@ pthread_handler_t ma_checkpoint_background(void *arg) ...@@ -603,24 +603,25 @@ pthread_handler_t ma_checkpoint_background(void *arg)
want to checkpoint every minute, hence the positive want to checkpoint every minute, hence the positive
maria_checkpoint_min_activity. maria_checkpoint_min_activity.
*/ */
if (horizon != log_horizon_at_last_checkpoint && if ((ulonglong) (horizon - log_horizon_at_last_checkpoint) <=
(ulonglong) (horizon - log_horizon_at_last_checkpoint) <=
maria_checkpoint_min_log_activity && maria_checkpoint_min_log_activity &&
((ulonglong) (maria_pagecache->global_cache_write - ((ulonglong) (maria_pagecache->global_cache_write -
pagecache_flushes_at_last_checkpoint) * pagecache_flushes_at_last_checkpoint) *
maria_pagecache->block_size) <= maria_pagecache->block_size) <=
maria_checkpoint_min_cache_activity) maria_checkpoint_min_cache_activity)
{ {
/* don't take checkpoint, so don't know what to flush */ /*
pages_to_flush_before_next_checkpoint= 0; Not enough has happend since last checkpoint.
Sleep for a while and try again later
*/
sleep_time= interval; sleep_time= interval;
break; break;
} }
sleep_time= 1; sleep_time= 1;
ma_checkpoint_execute(CHECKPOINT_MEDIUM, TRUE); ma_checkpoint_execute(CHECKPOINT_MEDIUM, TRUE);
/* /*
Snapshot this kind of "state" of the engine. Note that the value below Snapshot this kind of "state" of the engine. Note that the value
is possibly greater than last_checkpoint_lsn. below is possibly greater than last_checkpoint_lsn.
*/ */
log_horizon_at_last_checkpoint= translog_get_horizon(); log_horizon_at_last_checkpoint= translog_get_horizon();
pagecache_flushes_at_last_checkpoint= pagecache_flushes_at_last_checkpoint=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment