summaryrefslogtreecommitdiff
path: root/storage/maria/ma_bitmap.c
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-09-10 02:42:12 +0300
committerMichael Widenius <monty@askmonty.org>2010-09-10 02:42:12 +0300
commitb7158601d35456fde4167fe44dcf505495b045af (patch)
tree088daf596bf6cd7fb06201ce1473d18c2408595b /storage/maria/ma_bitmap.c
parent6f59c41d2dfad95ecdb161d6b08ec4cce736f7a8 (diff)
downloadmariadb-git-b7158601d35456fde4167fe44dcf505495b045af.tar.gz
Fixed bug LP#605798 "wrong data in bitmap" after recovery.
Extend remove_function_from_trace.pl to work with many threads (patch from Sergei) dbug/remove_function_from_trace.pl: Extend remove_function_from_trace.pl to work with many threads (patch from Sergei) storage/maria/ma_bitmap.c: Added marker that table had changed since last checkpoint. This ensures that we will flush all bitmap pages from cache at checkpoint. This fixes bug LP#605798 "wrong data in bitmap" after recovery. storage/maria/ma_check.c: Cleaned up error output storage/maria/ma_recovery.c: Cleaned up error output storage/maria/maria_def.h: Added changed_not_flushed
Diffstat (limited to 'storage/maria/ma_bitmap.c')
-rw-r--r--storage/maria/ma_bitmap.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index ff23c408931..4f37d7b9a1f 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -147,6 +147,12 @@ static inline my_bool write_changed_bitmap(MARIA_SHARE *share,
DBUG_ASSERT(bitmap->file.write_callback != 0);
DBUG_PRINT("info", ("bitmap->non_flushable: %u", bitmap->non_flushable));
+ /*
+ Mark that a bitmap page has been written to page cache and we have
+ to flush it during checkpoint.
+ */
+ bitmap->changed_not_flushed= 1;
+
if ((bitmap->non_flushable == 0)
#ifdef WRONG_BITMAP_FLUSH
|| 1
@@ -347,7 +353,7 @@ my_bool _ma_bitmap_flush_all(MARIA_SHARE *share)
MARIA_FILE_BITMAP *bitmap= &share->bitmap;
DBUG_ENTER("_ma_bitmap_flush_all");
pthread_mutex_lock(&bitmap->bitmap_lock);
- if (bitmap->changed)
+ if (bitmap->changed || bitmap->changed_not_flushed)
{
bitmap->flush_all_requested= TRUE;
#ifndef WRONG_BITMAP_FLUSH
@@ -384,6 +390,7 @@ my_bool _ma_bitmap_flush_all(MARIA_SHARE *share)
&bitmap->pages_covered) &
PCFLUSH_PINNED_AND_ERROR)
res= TRUE;
+ bitmap->changed_not_flushed= FALSE;
bitmap->flush_all_requested= FALSE;
/*
Some well-behaved threads may be waiting for flush_all_requested to