[Commits] Rev 3126: FIX for LP bug#956079 in file:///home/bell/maria/bzr/work-maria-5.2-lpb956079/

sanja at montyprogram.com sanja at montyprogram.com
Tue Apr 3 16:18:22 EEST 2012


At file:///home/bell/maria/bzr/work-maria-5.2-lpb956079/

------------------------------------------------------------
revno: 3126
revision-id: sanja at montyprogram.com-20120403131821-iduj4u9x6now4ked
parent: sanja at montyprogram.com-20120314100903-a6txqk4l73smh189
committer: sanja at montyprogram.com
branch nick: work-maria-5.2-lpb956079
timestamp: Tue 2012-04-03 16:18:21 +0300
message:
  FIX for LP bug#956079
  
  Always set all callbacks for page cache.
-------------- next part --------------
=== modified file 'storage/maria/ma_loghandler.c'
--- a/storage/maria/ma_loghandler.c	2011-11-30 20:57:18 +0000
+++ b/storage/maria/ma_loghandler.c	2012-04-03 13:18:21 +0000
@@ -9091,7 +9091,10 @@ static void dump_datapage(uchar *buffer,
     }
     tfile.number= file;
     tfile.handler.file= handler;
-    pagecache_file_init(tfile.handler, NULL, NULL, NULL, NULL, NULL);
+    pagecache_file_init(tfile.handler, &translog_dummy_callback,
+                        &translog_dummy_callback,
+                        &translog_dummy_write_failure,
+                        &translog_dummy_callback, NULL);
     tfile.was_recovered= 0;
     tfile.is_sync= 1;
     if (translog_check_sector_protection(buffer, &tfile))

=== modified file 'storage/maria/ma_open.c'
--- a/storage/maria/ma_open.c	2012-02-24 15:21:44 +0000
+++ b/storage/maria/ma_open.c	2012-04-03 13:18:21 +0000
@@ -1761,6 +1761,7 @@ void _ma_set_data_pagecache_callbacks(PA
 {
   file->callback_data= (uchar*) share;
   file->flush_log_callback= &maria_flush_log_for_page_none; /* Do nothing */
+  file->write_fail= &maria_page_write_failure;
 
   if (share->temporary)
   {

=== modified file 'storage/maria/ma_pagecache.c'
--- a/storage/maria/ma_pagecache.c	2011-08-10 19:44:39 +0000
+++ b/storage/maria/ma_pagecache.c	2012-04-03 13:18:21 +0000
@@ -633,7 +633,6 @@ static my_bool pagecache_fwrite(PAGECACH
 {
   DBUG_ENTER("pagecache_fwrite");
   DBUG_ASSERT(type != PAGECACHE_READ_UNKNOWN_PAGE);
-
 #ifdef EXTRA_DEBUG_BITMAP
   /*
     This code is very good when debugging changes in bitmaps or dirty lists
@@ -654,6 +653,12 @@ static my_bool pagecache_fwrite(PAGECACH
   }
 #endif
 
+  DBUG_ASSERT(filedesc->read_callback);
+  DBUG_ASSERT(filedesc->write_callback);
+  DBUG_ASSERT(filedesc->write_fail);
+  DBUG_ASSERT(filedesc->flush_log_callback);
+
+
   /* Todo: Integrate this with write_callback so we have only one callback */
   if ((*filedesc->flush_log_callback)(buffer, pageno, filedesc->callback_data))
     DBUG_RETURN(1);
@@ -2790,6 +2795,10 @@ static void read_block(PAGECACHE *pageca
     }
     else
     {
+      DBUG_ASSERT(block->hash_link->file.read_callback);
+      DBUG_ASSERT(block->hash_link->file.write_callback);
+      DBUG_ASSERT(block->hash_link->file.write_fail);
+      DBUG_ASSERT(block->hash_link->file.flush_log_callback);
       block->status|= PCBLOCK_READ;
       if ((*block->hash_link->file.read_callback)(block->buffer,
                                                   block->hash_link->pageno,
@@ -4279,6 +4288,10 @@ no_key_cache:
                                    pageno,
                                    pagecache->readwrite_flags) != 0)))
         goto end;
+      DBUG_ASSERT(file->read_callback);
+      DBUG_ASSERT(file->write_callback);
+      DBUG_ASSERT(file->write_fail);
+      DBUG_ASSERT(file->flush_log_callback);
       if ((file->read_callback)(page_buffer, pageno, file->callback_data))
       {
         DBUG_PRINT("error", ("read callback problem"));

=== modified file 'storage/maria/ma_pagecache.h'
--- a/storage/maria/ma_pagecache.h	2011-02-28 17:39:30 +0000
+++ b/storage/maria/ma_pagecache.h	2012-04-03 13:18:21 +0000
@@ -271,6 +271,10 @@ extern void pagecache_set_write_on_delet
     (F).read_callback= (RC); (F).write_callback= (WC); \
     (F).write_fail= (WF); \
     (F).flush_log_callback= (GLC); (F).callback_data= (uchar*)(D); \
+    DBUG_ASSERT((F).read_callback); \
+    DBUG_ASSERT((F).write_callback); \
+    DBUG_ASSERT((F).write_fail); \
+    DBUG_ASSERT((F).flush_log_callback); \
   } while(0)
 
 #define flush_pagecache_blocks(A,B,C)                   \



More information about the commits mailing list