Below is the list of changes that have just been committed into a local
5.1 repository of istruewing. When istruewing 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-13 16:43:45+01:00, istruewing@stripped +1 -0
Bug#25460 - High concurrency MyISAM access causes severe mysqld crash.
The previous two patches for this bug worked together so that
no permanent table was memory mapped. The first patch tried to
avoid mapping while a table is in use. It allowed mapping only
if there was exactly one lock on the table, assuming that the
calling thread owned it. During mi_open(), a different call to
memory mapping was coded, which did not have this limitation.
The second patch tried to remove the code duplication and just
called mi_extra() from mi_open() an thus inherited the limitation.
But on open, a thread does not have a lock on the table...
A possible solution would be to check for zero or one lock.
But since I learned that it is safe to memory map a file while
normal file I/O is done on it, I removed the restriction altogether
and allow to memory map while a table is in use.
No test case. I do not see a chance to verify with the test suite
which kind of I/O is used on a table.
storage/myisam/mi_extra.c@stripped, 2007-03-13 16:43:41+01:00, istruewing@stripped +6 -4
Bug#25460 - High concurrency MyISAM access causes severe mysqld crash.
Allow to memory map while table is in use.
# 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: istruewing
# Host: chilla.local
# Root: /home/mydev/mysql-5.1-bug25460
--- 1.53/storage/myisam/mi_extra.c 2007-03-13 16:43:52 +01:00
+++ 1.54/storage/myisam/mi_extra.c 2007-03-13 16:43:52 +01:00
@@ -350,11 +350,13 @@ int mi_extra(MI_INFO *info, enum ha_extr
#ifdef HAVE_MMAP
pthread_mutex_lock(&share->intern_lock);
/*
- Memory map the data file if it is not already mapped and if there
- are no other threads using this table. intern_lock prevents other
- threads from starting to use the table while we are mapping it.
+ Memory map the data file if it is not already mapped. It is safe
+ to memory map a file while other threads are using file I/O on it.
+ Assigning a new address to a function pointer is an atomic
+ operation. intern_lock prevents that two or more mappings are done
+ at the same time.
*/
- if (!share->file_map && (share->tot_locks == 1))
+ if (!share->file_map)
{
if (mi_dynmap_file(info, share->state.state.data_file_length))
{
| Thread |
|---|
| • bk commit into 5.1 tree (istruewing:1.2439) BUG#25460 | ingo | 13 Mar |