From cd876fb11883f68f93027a70b5f3f99ad9234f27 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Aug 2006 19:19:47 +0200 Subject: amd64 atomic ops lock-free alloc (WL#3229), lock-free hash (WL#3230) bit functions made inline include/Makefile.am: lf.h added mysys/Makefile.am: lf_hash.c lf_dynarray.c lf_alloc-pin.c include/atomic/nolock.h: amd64 atomic ops include/atomic/rwlock.h: s/rw_lock/mutex/g include/atomic/x86-gcc.h: amd64 atomic ops try PAUSE include/my_global.h: STATIC_INLINE mysys/mf_keycache.c: make bit functions inline mysys/my_atomic.c: STATIC_INLINE mysys/my_bitmap.c: make bit functions inline sql/ha_myisam.cc: make bit functions inline sql/item_func.cc: make bit functions inline include/my_atomic.h: STATIC_INLINE mysys/my_bit.c: make bit functions inline sql/sql_select.cc: make bit functions inline storage/myisam/mi_create.c: make bit functions inline storage/myisam/mi_test2.c: make bit functions inline storage/myisam/myisamchk.c: make bit functions inline mysys/my_init.c: thread_size moved to mysys sql/mysql_priv.h: thread_size moved to mysys sql/set_var.cc: thread_size moved to mysys include/my_sys.h: thread_size moved to mysys sql/mysqld.cc: thread_size moved to mysys sql/sql_parse.cc: thread_size moved to mysys sql/sql_test.cc: thread_size moved to mysys include/lf.h: dylf_dynarray refactored to remove 65536 elements limit mysys/lf_alloc-pin.c: dylf_dynarray refactored to remove 65536 elements limit mysys/lf_dynarray.c: dylf_dynarray refactored to remove 65536 elements limit mysys/lf_hash.c: dylf_dynarray refactored to remove 65536 elements limit unittest/mysys/my_atomic-t.c: fix to commit (remove debug code) --- mysys/mf_keycache.c | 1 + 1 file changed, 1 insertion(+) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index e6f4348968f..9a99a278bc5 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -43,6 +43,7 @@ #include #include "my_static.h" #include +#include #include #include -- cgit v1.2.1 From 714f3b73e513f2d12fb45e8256fa6299e60cd5a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Dec 2006 18:58:35 +0100 Subject: merge of recent MyISAM changes into Maria. Only failure is ndb_restore - could have been worse!! include/pagecache.h: LSN->lsn mysys/mf_keycache.c: page_status is int mysys/mf_pagecache.c: merge of recent key cache changes sql/mysqld.cc: post-merge fixes sql/set_var.cc: post-merge fixes storage/maria/ha_maria.cc: merge of recent MyISAM changes into Maria storage/maria/ha_maria.h: merge of recent MyISAM changes into Maria storage/maria/ma_close.c: merge of recent MyISAM changes into Maria storage/maria/ma_create.c: merge of recent MyISAM changes into Maria storage/maria/ma_delete.c: merge of recent MyISAM changes into Maria storage/maria/ma_dynrec.c: merge of recent MyISAM changes into Maria storage/maria/ma_ft_boolean_search.c: merge of recent MyISAM changes into Maria storage/maria/ma_key.c: merge of recent MyISAM changes into Maria storage/maria/ma_keycache.c: merge of recent MyISAM changes into Maria storage/maria/ma_open.c: merge of recent MyISAM changes into Maria storage/maria/ma_page.c: merge of recent MyISAM changes into Maria storage/maria/ma_rsamepos.c: merge of recent MyISAM changes into Maria storage/maria/ma_statrec.c: merge of recent MyISAM changes into Maria storage/maria/ma_unique.c: merge of recent MyISAM changes into Maria storage/maria/maria_chk.c: merge of recent MyISAM changes into Maria storage/maria/maria_pack.c: merge of recent MyISAM changes into Maria storage/myisam/myisampack.c: compiler warning --- mysys/mf_keycache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 111a28d01a4..12be01184b6 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1642,9 +1642,9 @@ restart: KEYCACHE_DBUG_ASSERT(page_status != -1); *page_st=page_status; KEYCACHE_DBUG_PRINT("find_key_block", - ("fd: %d pos: %lu block->status: %u page_status: %u", + ("fd: %d pos: %lu block->status: %u page_status: %d", file, (ulong) filepos, block->status, - (uint) page_status)); + page_status)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) DBUG_EXECUTE("check_keycache2", -- cgit v1.2.1 From 345959c660d7401c9dc991a2c572ba145d6e199c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Jan 2007 21:38:14 +0200 Subject: Implementation of rows-in-block - Fixes some things missed in myisam->maria port - Moved variables that holds the state for the current row to 'cur_row' - Changed most uchar * to byte * to be able to remove a lot of casts - Removed RAID support - Added CHECK for rows-in-block - Added allocate_dynamic() for easier usage of dynamic rows when we know how many entries we will need - Reorder columns after CREATE for more optimal row storage (for rows-in-block) - Removed flag 'RRND_PRESERVER_LASTINX' (not needed) - Extended ma_test_all.sh to test more completely all row formats - New structs and variables to hold rows-in-block and bitmap information - Added org_data_file_type in header to allow easy restore of old record format when doing maria_pack / maria_chk -u - More virtual functions to handle different row types - Pointer to row is now MARIA_RECORD_POS instead of my_off_t - New header signature for MARIA index files - Fixed bugs in ma_test1.c and ma_test2.c - All key and row blocks are now of same size - We now only have one link chain for deleted key blocks include/m_string.h: Define bzero_if_purify include/maria.h: Implementation of rows-in-block include/my_base.h: Implementation of rows-in-block include/my_handler.h: Cleanup macros Added size_to_store_key_length() include/my_sys.h: Added 'allocate_dynamic()' include/myisamchk.h: Implementation of rows-in-block mysys/array.c: Added allocate_dynamic() mysys/mf_keycache.c: Moved DBUG_ENTER to it's right position mysys/my_pread.c: Ensure my_errno is always set sql/filesort.cc: Fixed some compiler warnings sql/gen_lex_hash.cc: Removed not needed 'inline' sql/ha_maria.cc: Implementation of rows-in-block Fixed compiler warnings sql/mysqld.cc: Fixed setting of wrong variable sql/uniques.cc: Fixed compiler warnings storage/maria/Makefile.am: Implementation of rows-in-block storage/maria/ma_check.c: Removed RAID functions Added support for CHECK of rows-in-blocks rows storage/maria/ma_checksum.c: Implementation of rows-in-block storage/maria/ma_close.c: Implementation of rows-in-block storage/maria/ma_create.c: Implementation of rows-in-block: - Reorder columns - All key blocks are now of same size - Removed old RAID support storage/maria/ma_dbug.c: Implementation of rows-in-block storage/maria/ma_delete.c: Implementation of rows-in-block storage/maria/ma_delete_all.c: Implementation of rows-in-block storage/maria/ma_dynrec.c: info->rec_buff is now allocated through _ma_alloc_buffer() Use new info->cur_row structure storage/maria/ma_extra.c: Implementation of rows-in-block storage/maria/ma_ft_boolean_search.c: Removed compiler warnings Indentation fixes storage/maria/ma_ft_nlq_search.c: Removed compiler warnings Indentation fixes storage/maria/ma_ft_update.c: Removed some casts storage/maria/ma_fulltext.h: Changed pointer type storage/maria/ma_info.c: Implementation of rows-in-block More general _ma_report_error() storage/maria/ma_init.c: Implementation of rows-in-block storage/maria/ma_key.c: Implementation of rows-in-block Removed some casts storage/maria/ma_keycache.c: Fixed DBUG entry storage/maria/ma_locking.c: Implementation of rows-in-block storage/maria/ma_open.c: Implementation of rows-in-block storage/maria/ma_packrec.c: Indentation fixes Changed uchar * to byte * to make it possible to remove some casts storage/maria/ma_page.c: Implementation of rows-in-block storage/maria/ma_range.c: Implementation of rows-in-block storage/maria/ma_rfirst.c: Implementation of rows-in-block storage/maria/ma_rkey.c: Implementation of rows-in-block Indentation fixes storage/maria/ma_rlast.c: Implementation of rows-in-block storage/maria/ma_rnext.c: Implementation of rows-in-block storage/maria/ma_rnext_same.c: Implementation of rows-in-block storage/maria/ma_rprev.c: Implementation of rows-in-block storage/maria/ma_rrnd.c: Implementation of rows-in-block Removed flag 'RRND_PRESERVER_LASTINX', by not resetting lastinx (This is reset by maria_scan_init()) storage/maria/ma_rsame.c: Implementation of rows-in-block storage/maria/ma_rsamepos.c: Implementation of rows-in-block storage/maria/ma_rt_index.c: Implementation of rows-in-block storage/maria/ma_rt_index.h: Implementation of rows-in-block storage/maria/ma_rt_key.c: Implementation of rows-in-block storage/maria/ma_rt_key.h: Implementation of rows-in-block storage/maria/ma_rt_mbr.c: Implementation of rows-in-block storage/maria/ma_rt_mbr.h: Implementation of rows-in-block storage/maria/ma_rt_split.c: Implementation of rows-in-block storage/maria/ma_rt_test.c: Indentation fix storage/maria/ma_scan.c: Implementation of rows-in-block Added 'maria_scan_end()' storage/maria/ma_search.c: Implementation of rows-in-block storage/maria/ma_sort.c: Indentation fixes uchar -> byte to be able to remove some casts storage/maria/ma_sp_defs.h: uchar * -> byte * storage/maria/ma_sp_key.c: uchar * -> byte * storage/maria/ma_sp_test.c: Indentation fixes storage/maria/ma_static.c: New header signature for MARIA storage/maria/ma_statrec.c: int -> my_bool functions my_off_t -> MARIA_RECORD_POS Fixed argument order for _ma_read_static_record() storage/maria/ma_test1.c: Implementation of rows-in-block Fixed some bugs in VARCHAR and BLOB testing storage/maria/ma_test2.c: Implementation of rows-in-block Fixed bug in BLOB testing storage/maria/ma_test3.c: Implementation of rows-in-block storage/maria/ma_test_all.sh: Run all tests with dynamic, static and block row formats (For the moment we skip REPAIR test of rows-in-block as this is not yet implemented) storage/maria/ma_unique.c: Implementation of rows-in-block storage/maria/ma_update.c: Implementation of rows-in-block storage/maria/ma_write.c: Implementation of rows-in-block Write of row is split into two parts, as rows-in-block format require us to do write of row before keys (to get row position) in contrast to all other row formats storage/maria/maria_chk.c: Implementation of rows-in-block storage/maria/maria_def.h: Implementation of rows-in-block - New structs and variables to hold rows-in-block and bitmap information - Added org_data_file_type in header to allow easy restore of old record format when doing maria_pack / maria_chk -u - More virtual functions to handle different row types - Pointer to row is now MARIA_RECORD_POS instead of my_off_t - uchar -> byte for many parameters to avoid casts storage/maria/maria_ftdump.c: Implementation of rows-in-block storage/maria/maria_pack.c: Implementation of rows-in-block storage/myisam/mi_check.c: Added new row types into switch to avoid compiler warnings Added some casts to avoid warnings after changing type of lastkey and buff storage/myisam/mi_create.c: Fix that 'pack_fields' is calculated correctly storage/myisam/mi_rsamepos.c: Implementation of rows-in-block storage/myisam/mi_test2.c: Fixed wrong printf storage/myisam/sort.c: uchar * -> byte * support-files/magic: Added support for Maria files Fided wrong entry's for MyISAM files storage/maria/ma_bitmap.c: New BitKeeper file ``storage/maria/ma_bitmap.c'' storage/maria/ma_blockrec.c: New BitKeeper file ``storage/maria/ma_blockrec.c'' storage/maria/ma_blockrec.h: New BitKeeper file ``storage/maria/ma_blockrec.h'' --- mysys/mf_keycache.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index e6f4348968f..10a3e85eb4d 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1791,8 +1791,6 @@ byte *key_cache_read(KEY_CACHE *keycache, uint offset= 0; byte *start= buff; DBUG_ENTER("key_cache_read"); - DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u", - (uint) file, (ulong) filepos, length)); if (keycache->can_be_used) { @@ -1802,6 +1800,11 @@ byte *key_cache_read(KEY_CACHE *keycache, uint status; int page_st; + DBUG_PRINT("enter", ("fd: %u pos: %lu page: %lu length: %u", + (uint) file, (ulong) filepos, + (ulong) (filepos / keycache->key_cache_block_size), + length)); + offset= (uint) (filepos & (keycache->key_cache_block_size-1)); /* Read data in key_cache_block_size increments */ do @@ -2053,10 +2056,6 @@ int key_cache_write(KEY_CACHE *keycache, reg1 BLOCK_LINK *block; int error=0; DBUG_ENTER("key_cache_write"); - DBUG_PRINT("enter", - ("fd: %u pos: %lu length: %u block_length: %u key_block_length: %u", - (uint) file, (ulong) filepos, length, block_length, - keycache ? keycache->key_cache_block_size : 0)); if (!dont_write) { @@ -2078,6 +2077,12 @@ int key_cache_write(KEY_CACHE *keycache, int page_st; uint offset; + DBUG_PRINT("enter", + ("fd: %u pos: %lu page: %lu length: %u block_length: %u", + (uint) file, (ulong) filepos, + (ulong) (filepos / keycache->key_cache_block_size), + length, block_length)); + offset= (uint) (filepos & (keycache->key_cache_block_size-1)); do { -- cgit v1.2.1 From 025400922118f11a15be54c66455f20e2f72c0b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Feb 2007 09:41:32 +0200 Subject: postreview changes for page cache and pre review commit for loghandler storage/maria/unittest/test_file.c: Rename: unittest/mysys/test_file.c -> storage/maria/unittest/test_file.c storage/maria/unittest/test_file.h: Rename: unittest/mysys/test_file.h -> storage/maria/unittest/test_file.h include/pagecache.h: A waiting queue mechanism moved to separate file wqueue.* Pointer name changed for compatibility mysys/Makefile.am: A waiting queue mechanism moved to separate file wqueue.* mysys/mf_keycache.c: fixed unsigned comparison mysys/mf_pagecache.c: A waiting queue mechanism moved to separate file wqueue.* Fixed bug in unregistering block during write storage/maria/Makefile.am: The loghandler files added storage/maria/ma_control_file.h: Now we have loghandler and can compile control file storage/maria/maria_def.h: Including files need for compilation of maria storage/maria/unittest/Makefile.am: unit tests of loghandler storage/maria/unittest/ma_control_file-t.c: Used maria def storage/maria/unittest/mf_pagecache_consist.c: fixed memory overrun storage/maria/unittest/mf_pagecache_single.c: fixed used uninitialized memory unittest/mysys/Makefile.am: unittests of pagecache moved to maria becase pagecache need loghandler include/wqueue.h: New BitKeeper file ``include/wqueue.h'' mysys/wqueue.c: New BitKeeper file ``mysys/wqueue.c'' storage/maria/ma_loghandler.c: New BitKeeper file ``storage/maria/ma_loghandler.c'' storage/maria/ma_loghandler.h: New BitKeeper file ``storage/maria/ma_loghandler.h'' storage/maria/ma_loghandler_lsn.h: New BitKeeper file ``storage/maria/ma_loghandler_lsn.h'' storage/maria/unittest/ma_test_loghandler-t.c: New BitKeeper file ``storage/maria/unittest/ma_test_loghandler-t.c'' storage/maria/unittest/ma_test_loghandler_multigroup-t.c: New BitKeeper file ``storage/maria/unittest/ma_test_loghandler_multigroup-t.c'' storage/maria/unittest/ma_test_loghandler_multithread-t.c: New BitKeeper file ``storage/maria/unittest/ma_test_loghandler_multithread-t.c'' storage/maria/unittest/ma_test_loghandler_pagecache-t.c: New BitKeeper file ``storage/maria/unittest/ma_test_loghandler_pagecache-t.c'' --- mysys/mf_keycache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 9a99a278bc5..9cb428ab200 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1008,12 +1008,12 @@ static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block) KEYCACHE_THREAD_TRACE("unlink_block"); #if defined(KEYCACHE_DEBUG) + KEYCACHE_DBUG_ASSERT(keycache->blocks_available != 0); keycache->blocks_available--; KEYCACHE_DBUG_PRINT("unlink_block", ("unlinked block %u status=%x #requests=%u #available=%u", BLOCK_NUMBER(block), block->status, block->requests, keycache->blocks_available)); - KEYCACHE_DBUG_ASSERT(keycache->blocks_available >= 0); #endif } -- cgit v1.2.1 From a3d2ae4648d739a7ec7820e22c05373fde65b770 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Jul 2007 12:06:39 +0200 Subject: merging MyISAM changes into Maria (not done in 5.1->maria merge of Jul 7th). "maria.test" and "ps_maria.test" still fail; "ma_test_all" starts failing (MyISAM has the same issue see BUG#30094). include/maria.h: merging MyISAM changes into Maria mysys/mf_keycache.c: mi_test_all showed "floating point exception", this was already fixed in the latest 5.1, importing fix. sql/item_xmlfunc.cc: compiler warning (already fixed in latest 5.1) storage/maria/ha_maria.cc: merging MyISAM changes into Maria. See #ifdef ASK_MONTY. storage/maria/ha_maria.h: merging MyISAM changes into Maria storage/maria/ma_cache.c: merging MyISAM changes into Maria storage/maria/ma_check.c: merging MyISAM changes into Maria storage/maria/ma_create.c: merging MyISAM changes into Maria storage/maria/ma_dynrec.c: merging MyISAM changes into Maria storage/maria/ma_extra.c: merging MyISAM changes into Maria storage/maria/ma_ft_boolean_search.c: merging MyISAM changes into Maria storage/maria/ma_ft_nlq_search.c: merging MyISAM changes into Maria storage/maria/ma_info.c: merging MyISAM changes into Maria storage/maria/ma_key.c: merging MyISAM changes into Maria storage/maria/ma_loghandler.c: compiler warning (part->length is size_t) storage/maria/ma_open.c: merging MyISAM changes into Maria storage/maria/ma_preload.c: merging MyISAM changes into Maria storage/maria/ma_range.c: merging MyISAM changes into Maria storage/maria/ma_rkey.c: merging MyISAM changes into Maria storage/maria/ma_rt_index.c: merging MyISAM changes into Maria storage/maria/ma_rt_key.c: merging MyISAM changes into Maria storage/maria/ma_rt_split.c: merging MyISAM changes into Maria storage/maria/ma_search.c: merging MyISAM changes into Maria storage/maria/ma_sort.c: merging MyISAM changes into Maria storage/maria/maria_def.h: merging MyISAM changes into Maria --- mysys/mf_keycache.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 6845e63dc33..4a8ab5b6719 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -2522,10 +2522,8 @@ uchar *key_cache_read(KEY_CACHE *keycache, int error=0; uchar *start= buff; DBUG_ENTER("key_cache_read"); - DBUG_PRINT("enter", ("fd: %u pos: %lu page: %lu length: %u", - (uint) file, (ulong) filepos, - (ulong) (filepos / keycache->key_cache_block_size), - length)); + DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u", + (uint) file, (ulong) filepos, length)); if (keycache->key_cache_inited) { @@ -2979,10 +2977,10 @@ int key_cache_write(KEY_CACHE *keycache, int error=0; DBUG_ENTER("key_cache_write"); DBUG_PRINT("enter", - ("fd: %u pos: %lu page: %lu length: %u block_length: %u", - (uint) file, (ulong) filepos, - (ulong) (filepos / keycache->key_cache_block_size), - length, block_length)); + ("fd: %u pos: %lu length: %u block_length: %u key_block_length: + %u", + (uint) file, (ulong) filepos, length, block_length, + keycache ? keycache->key_cache_block_size : 0)); if (!dont_write) { -- cgit v1.2.1 From 9b1e83dba732896f606181b21becc3b0144a91ec Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Jul 2007 16:11:40 +0200 Subject: porting Serg's fix for BUG#30094 to Maria. Now ma_test_all passes. maria.test and ps_maria.test still fail. mysys/mf_keycache.c: split string annoys some compilers storage/maria/ha_maria.cc: fix for compiler warnings storage/maria/ma_test1.c: porting Serg's fix for BUG#30094 to Maria storage/maria/ma_test2.c: porting Serg's fix for BUG#30094 to Maria storage/maria/ma_test3.c: porting Serg's fix for BUG#30094 to Maria storage/maria/ma_test_recovery: don't print ma_test1's messages if no problem --- mysys/mf_keycache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 4a8ab5b6719..e865d152633 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -2977,8 +2977,8 @@ int key_cache_write(KEY_CACHE *keycache, int error=0; DBUG_ENTER("key_cache_write"); DBUG_PRINT("enter", - ("fd: %u pos: %lu length: %u block_length: %u key_block_length: - %u", + ("fd: %u pos: %lu length: %u block_length: %u" + " key_block_length: %u", (uint) file, (ulong) filepos, length, block_length, keycache ? keycache->key_cache_block_size : 0)); -- cgit v1.2.1 From 77017191de1b2d05392a8ad2f202f5162aa5fc68 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Oct 2007 14:15:13 +0200 Subject: WL#3071 - Maria checkpoint - serializing calls to flush_pagecache_blocks_int() on the same file to avoid known concurrency bugs - having that, we can now enable the background thread, as the flushes it does are now supposedly safe in concurrent situations. - new type of flush FLUSH_KEEP_LAZY: when the background checkpoint thread is flushing a packet of dirty pages between two checkpoints, it uses this flush type, indeed if a file is already being flushed by another thread it's smarter to move on to the next file than wait. - maria_checkpoint_frequency renamed to maria_checkpoint_interval. include/my_sys.h: new type of flushing for the page cache: FLUSH_KEEP_LAZY mysql-test/r/maria.result: result update mysys/mf_keycache.c: indentation. No FLUSH_KEEP_LAZY support in key cache. storage/maria/ha_maria.cc: maria_checkpoint_frequency was somehow a hidden part of the Checkpoint API and that was not good. Now we have checkpoint_interval, local to ha_maria.cc, which serves as container for the user-visible maria_checkpoint_interval global variable; setting it calls update_checkpoint_interval which passes the new value to ma_checkpoint_init(). There is no hiding anymore. By default, enable background thread which does checkpoints every 30 seconds, and dirty page flush in between. That thread takes a checkpoint when it ends, so no need for maria_hton_panic to take one. The | is | and not ||, because maria_panic() must always be called. frequency->interval. storage/maria/ma_checkpoint.c: Use FLUSH_KEEP_LAZY for background thread when it flushes packets of dirty pages between two checkpoints: it is smarter to move on to the next file than wait for it to have been completely flushed, which may take long. Comments about flush concurrency bugs moved from ma_pagecache.c. Removing out-of-date comment. frequency->interval. create_background_thread -> (interval>0). In ma_checkpoint_background(), some variables need to be preserved between iterations. storage/maria/ma_checkpoint.h: new prototype storage/maria/ma_pagecache.c: - concurrent calls of flush_pagecache_blocks_int() on the same file cause bugs (see @note in that function); we fix them by serializing in this situation. For that we use a global hash of (file, wqueue). When flush_pagecache_blocks_int() starts it looks into the hash, using the file as key. If not found, it inserts (file,wqueue) into the hash, flushes the file, and finally removes itself from the hash and wakes up any waiter in the queue. If found, it adds itself to the wqueue and waits. - As a by-product, we can remove changed_blocks_is_incomplete and replace it by scanning the hash, replace the sleep() by a queue wait. - new type of flush FLUSH_KEEP_LAZY: when flushing a file, if it's already being flushed by another thread (even partially), return immediately. storage/maria/ma_pagecache.h: In pagecache, a hash of files currently being flushed (i.e. there is a call to flush_pagecache_blocks_int() for them). storage/maria/ma_recovery.c: new prototype storage/maria/ma_test1.c: new prototype storage/maria/ma_test2.c: new prototype --- mysys/mf_keycache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mysys/mf_keycache.c') diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index ea05ea6e127..8b1f3ad0540 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -3557,10 +3557,11 @@ static int flush_key_blocks_int(KEY_CACHE *keycache, file, keycache->blocks_used, keycache->blocks_changed)); #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) - DBUG_EXECUTE("check_keycache", - test_key_cache(keycache, "start of flush_key_blocks", 0);); + DBUG_EXECUTE("check_keycache", + test_key_cache(keycache, "start of flush_key_blocks", 0);); #endif + DBUG_ASSERT(type != FLUSH_KEEP_LAZY); cache= cache_buff; if (keycache->disk_blocks > 0 && (!my_disable_flush_key_blocks || type != FLUSH_KEEP)) -- cgit v1.2.1