diff options
author | unknown <sanja@askmonty.org> | 2009-04-03 12:23:26 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2009-04-03 12:23:26 +0300 |
commit | cce577ebd4915fca6c450f926f526c8e2ab8a9fd (patch) | |
tree | 059f6515c61a051857985434edf45771746bb90f /storage/maria/ma_checkpoint.c | |
parent | f353f678107e68cf1fd09628414fd51b776f4da3 (diff) | |
parent | 032ef1fa0781490606c2cf690420464ed98ace8c (diff) | |
download | mariadb-git-cce577ebd4915fca6c450f926f526c8e2ab8a9fd.tar.gz |
5.1 -> 5.2 merge
Diffstat (limited to 'storage/maria/ma_checkpoint.c')
-rw-r--r-- | storage/maria/ma_checkpoint.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index 5e41b2be833..b75267f81f1 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -368,7 +368,9 @@ static void flush_all_tables(int what_to_flush) FLUSH_KEEP, FLUSH_KEEP); break; case 1: - res= _ma_state_info_write(info->s, 1|4); + res= _ma_state_info_write(info->s, + MA_STATE_INFO_WRITE_DONT_MOVE_OFFSET| + MA_STATE_INFO_WRITE_LOCK); DBUG_PRINT("maria_flush_states", ("is_of_horizon: LSN (%lu,0x%lx)", LSN_IN_PARTS(info->s->state.is_of_horizon))); @@ -632,6 +634,14 @@ pthread_handler_t ma_checkpoint_background(void *arg) We use FLUSH_KEEP_LAZY: if a file is already in flush, it's smarter to move to the next file than wait for this one to be completely flushed, which may take long. + StaleFilePointersInFlush: notice how below we use "dfile" which + is an OS file descriptor plus some function and MARIA_SHARE + pointers; this data dates from a previous checkpoint; since then, + the table may have been closed (so MARIA_SHARE* became stale), and + the file descriptor reassigned to another table which does not + have the same CRC-read-set callbacks: it is thus important that + flush_pagecache_blocks_with_filter() does not use the pointers, + only the OS file descriptor. */ int res= flush_pagecache_blocks_with_filter(maria_pagecache, @@ -1008,7 +1018,8 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon) state_copies_horizon; if (kfile.file >= 0) sync_error|= - _ma_state_info_write_sub(kfile.file, &state_copy->state, 1); + _ma_state_info_write_sub(kfile.file, &state_copy->state, + MA_STATE_INFO_WRITE_DONT_MOVE_OFFSET); /* We don't set share->changed=0 because it may interfere with a concurrent _ma_writeinfo() doing share->changed=1 (cancel its |