List:Commits« Previous MessageNext Message »
From:kpettersson Date:March 9 2007 12:22pm
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 13:22:34+01:00, thek@stripped +1 -0
  Bug#25648 repair table hangs (deadlocks) with myisam_repair_threads > 1
  
  - During parallel repair it could happen that the server lost track
    of the number of running threads and waited forever.
  - If the writer-thread left while the readers were asleep, there 
    wouldn't be any thread 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. Later on, a dead lock would appear 
    when new threads would be waiting for threads which never could 
    arrive.
  - In case that the writer-thread has gone away, the reader-thread
    needs to increase the running_threads count on its own. 

  mysys/mf_iocache.c@stripped, 2007-03-09 13:22:33+01:00, thek@stripped +5 -0
    Bug#25648 repair table hangs (deadlocks) with myisam_repair_threads > 1
    
    - If the writer-thread left while the readers were asleep, there 
      wouldn't be any thread 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. Later on, a dead lock would appear 
      when new threads would be waiting for threads which never could 
      arrive.
    - In case that the writer-thread has gone away, the reader-thread
      needs to increase the running_threads count on its 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 13:22:38 +01:00
+++ 1.52/mysys/mf_iocache.c	2007-03-09 13:22:38 +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