Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja 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-07-16 15:57:20+04:00, kostja@bodhi.(none) +1 -0
A follow up after the fix for Bug#21074 - fix NDB tests breaking on
asserts.
The patch for Bug#21074 replaces acquisition of the global LOCK_open lock
with exclusive locks on table names in such operations ad DROP TABLE
and RENAME TABLE.
Unfortunately, NDB internally assumes that LOCK_open is acquired and
tries to release it.
This dependency should be fixed by a separate (and significant in size)
patch. For now we just satisfy it - after all, the original
goal of the patch for Bug#21074 was to move query_cache_invalidate
outside of the scope of LOCK_open, and we still can do that.
This fixes some failing NDB tests in the runtime tree.
sql/sql_rename.cc@stripped, 2007-07-16 15:57:17+04:00, kostja@bodhi.(none) +11 -1
Move release of LOCK_open after ha_ndbcluster::rename_tables to
satisfy an assert in ndb_log_schema_op.
diff -Nrup a/sql/sql_rename.cc b/sql/sql_rename.cc
--- a/sql/sql_rename.cc 2007-07-02 23:00:12 +04:00
+++ b/sql/sql_rename.cc 2007-07-16 15:57:17 +04:00
@@ -150,7 +150,6 @@ bool mysql_rename_tables(THD *thd, TABLE
pthread_mutex_unlock(&LOCK_open);
goto err;
}
- pthread_mutex_unlock(&LOCK_open);
error=0;
if ((ren_table=rename_tables(thd,table_list,0)))
@@ -174,6 +173,17 @@ bool mysql_rename_tables(THD *thd, TABLE
error= 1;
}
+ /*
+ An exclusive lock on table names is satisfactory to ensure
+ no other thread accesses this table.
+ However, NDB assumes that handler::rename_tables is called under
+ LOCK_open. And it indeed is, from ALTER TABLE.
+ TODO: remove this limitation.
+ We still should unlock LOCK_open as early as possible, to provide
+ higher concurrency - query_cache_invalidate can take minutes to
+ complete.
+ */
+ pthread_mutex_unlock(&LOCK_open);
/* Lets hope this doesn't fail as the result will be messy */
if (!silent && !error)
| Thread |
|---|
| • bk commit into 5.1 tree (kostja:1.2533) BUG#21074 | konstantin | 16 Jul |