summaryrefslogtreecommitdiff
path: root/mysys/my_static.c
diff options
context:
space:
mode:
authorIngo Struewing <ingo.struewing@sun.com>2009-09-07 18:35:37 +0200
committerIngo Struewing <ingo.struewing@sun.com>2009-09-07 18:35:37 +0200
commit540b2dc0041c292220d389bbb5b87a8410aef3f4 (patch)
tree470a73f1eea902399f74466405e0b8d56d27e661 /mysys/my_static.c
parent643fbe4234a06e51746c8912223652a3b41fe133 (diff)
downloadmariadb-git-540b2dc0041c292220d389bbb5b87a8410aef3f4.tar.gz
Bug#17332 - changing key_buffer_size on a running server
can crash under load Backport from 5.1. Does also include key cache fixes from: Bug 44068 (RESTORE can disable the MyISAM Key Cache) Bug 40944 (Backup: crash after myisampack) include/keycache.h: Bug#17332 - changing key_buffer_size on a running server can crash under load Added KEY_CACHE components in_resize and waiting_for_resize_cnt. myisam/mi_preload.c: Bug#17332 - changing key_buffer_size on a running server can crash under load Added code to allow LOAD INDEX to load indexes of different block size. mysys/mf_keycache.c: Bug#17332 - changing key_buffer_size on a running server can crash under load . Changed resize_key_cache() to not disable the key cache after the flush phase. Changed queue handling to use standard functions. Wake all threads waiting on resize_queue. We can now have read/write threads waiting there (see below). . Combined add_to_queue() and the wait loops that were always following it to the new function wait_on_queue(). Combined release_queue() and the condition that was always preceding it to the new function release_whole_queue(). . Added code to flag and respect the exceptional situation BLOCK_IN_EVICTION. . Rewrote the resize branch of find_key_block(). . Added code to the eviction handling in find_key_block() to catch more exceptional cases. . Changed key_cache_read(), key_cache_insert() and key_cache_write() so that they lock keycache->cache_lock whenever the key cache is initialized. Checking for a disabled cache and incrementing and decrementing the "resize counter" is always done within the lock. Locking and unlocking as well as counting the "resize counter" is now done once outside the loop. All three functions can now handle a NULL return from find_key_block. This happens in the flush phase of a resize and demands direct file I/O. Care is taken for secondary requests (PAGE_WAIT_TO_BE_READ) to wait in any case. Moved block status changes behind the copying of buffer data. key_cache_insert() does now read the block if the caller did supply less data than a full cache block. key_cache_write() does now take care of parallel running flushes (BLOCK_FOR_UPDATE, BLOCK_IN_FLUSHWRITE). . Changed free_block() to un-initialize block variables in the correct order and respect an exceptional BLOCK_IN_EVICTION state. . Changed flushing to take care for parallel running writes. Changed flushing to avoid freeing blocks in eviction. Changed flushing to consider that parallel writes can move blocks from the file_blocks hash to the changed_blocks hash. Changed flushing to take care for other parallel flushes. Changed flushing to assure that it ends with everything flushed. Optimized normal flush at end of statement (FLUSH_KEEP), but let other flush types be stringent. . Added some comments and debugging statements. mysys/my_static.c: Bug#17332 - changing key_buffer_size on a running server can crash under load Removed an unused global variable. sql/ha_myisam.cc: Bug#17332 - changing key_buffer_size on a running server can crash under load Moved an automatic (stack) variable to the scope where it is used. sql/sql_table.cc: Bug#17332 - changing key_buffer_size on a running server can crash under load Changed TL_READ to TL_READ_NO_INSERT in mysql_preload_keys.
Diffstat (limited to 'mysys/my_static.c')
-rw-r--r--mysys/my_static.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 1858d830f41..23e37c53f98 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -48,9 +48,6 @@ struct st_remember _my_sig_remember[MAX_SIGNALS]={{0,0}};
sigset_t my_signals; /* signals blocked by mf_brkhant */
#endif
- /* from mf_keycache.c */
-my_bool key_cache_inited=0;
-
/* from mf_reccache.c */
ulong my_default_record_cache_size=RECORD_CACHE_SIZE;