List:Commits« Previous MessageNext Message »
From:kpettersson Date:March 9 2007 10:53am
Subject:bk commit into 4.1 tree (thek:1.2595) BUG#25648
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of thek. When thek does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-03-09 10:53:45+01:00, thek@stripped +1 -0
  Bug#25648 repair table hangs (deadlocks) with myisam_repair_threads > 1
  
  - If the writer while the readers are a sleep, there won't be any
    process to unlock the io_cache later. This behavior caused the
    threaded algorithm in mi_repair_table to lose track on the number 
    of running threads and later a dead lock would appear as a 
    result of new threads waiting for threads which never would arrive.
  - In case that the writer has gone away, the reader-thread needs
    to increase the running_threads count on it's own. 

  mysys/mf_iocache.c@stripped, 2007-03-09 10:53:44+01:00, thek@stripped +5 -0
    Bug#25648 repair table hangs (deadlocks) with myisam_repair_threads > 1
    
    - If the writer while the readers are a sleep, there won't be any
      process to unlock the io_cache later. This behavior caused the
      threaded algorithm in mi_repair_table to lose track on the number 
      of running threads and later a dead lock would appear as a 
      result of new threads waiting for threads which never would arrive.
    - In case that the writer has gone away, the reader-thread needs
      to increase the running_threads count on it's own. 

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	thek
# Host:	kpdesk.mysql.com
# Root:	/home/thek/dev/bug25648/my41-bug25648

--- 1.51/mysys/mf_iocache.c	2007-03-09 10:53:49 +01:00
+++ 1.52/mysys/mf_iocache.c	2007-03-09 10:53:49 +01:00
@@ -773,10 +773,15 @@ static int lock_io_cache(IO_CACHE *cache
       of the last block. When we awake here then because the last
       joining thread signalled us. If the writer is not the last, it
       will not signal. So it is safe to clear the buffer here.
+
+      During normal operation the writer is the only one who unlocks and 
+      then sets running_threads= total_threads. If the writer went away
+      the reader needs to increase running_threads on its own.
     */
     if (!cshare->read_end || (cshare->pos_in_file < pos))
     {
       DBUG_PRINT("io_cache_share", ("reader found writer removed. EOF"));
+      cshare->running_threads++;      
       cshare->read_end= cshare->buffer; /* Empty buffer. */
       cshare->error= 0; /* EOF is not an error. */
     }
Thread
bk commit into 4.1 tree (thek:1.2595) BUG#25648kpettersson9 Mar