MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:September 23 2008 2:03pm
Subject:Re: bzr commit into mysql-6.0-runtime branch (davi:2696)
View as plain text  
* Davi Arnaut <Davi.Arnaut@stripped> [08/08/11 18:39]:
>  2696 Davi Arnaut	2008-08-11
>       WL#4284: Transactional DDL locking
>       Bug#989: If DROP TABLE while there's an active transaction,
>                wrong binlog order
>       Currently the MySQL server does not keep metadata locks on
>       schema objects for the duration of a transaction, thus failing
>       to guarantee the integrity of the schema objects being used
>       during the transaction and to protect then from concurrent
>       DDL operations. This also poses a problem for replication as
>       a DDL operation might be replicated even thought there are
>       active transactions using the object being modified.
>       The solution is to defer the release of metadata locks until
>       a active transaction is either committed or rolled back. This
>       prevents other statements from modifying the table for the
>       entire duration of the transaction. This provides commitment
>       ordering for guaranteeing serializability across multiple
>       transactions.

Please find my review below:

1) flush_block_commit.test: +flush tables with read lock;;
 -> remove double semicolon

2) flush_block_commit_notembedded.test:
-insert t1 values (1);
+select 1;

 * please add a commit after insert instad
 * add --echo # switching to connection 
   to places that switch between connections

3) kostja to find out: should flush tables with read lock block commit
of empty transactions?

4) kostja to find out: should flush tables with read lock block commit
of transactions that only use temporary tables?
 (if yes, the code in ha_commit that checks for the read lock should be moved
 up. Otherwise it should be removed).

5) kostja to discuss with dmitry how we should allocate lock requests.

6) davi to add a slab allocator (bsd) into the system

7) +# GLR blocks new transactions
  please don't use abbreviations. I advocate that we should use 
  --echo # for all comments in mysqltest. 

8) kostja wrote some bad code in event_db_repository, when a decision
  whether to make or not make a backup was made outside open_event_table.
  This should perhaps be reconsidered, and we should always do backup 
  inside open_event_table.

9) CTT_RELEASE_TRANS_LOCKS shouldn't be needed. The decision to release the
  locks should be done in commit.

10) check for OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN should be moved into 
  a function in a separate patch.

11) release of locks should be done only in COMMIT code, not in
  close_thread_tables(). At least it's a good idea to try in a separate,
  pre-requisite patch.

+    Allocate a new metadata lock request for the table object that
+    doesn't have one already. This is done at this point because a
+    implicit commit (with locks release and freeing) might have been
+    issued after this object was assembled.
+  */
+  if (! table_list->mdl_lock_data)
+   table_list->mdl_lock_data= mdl_alloc_lock(0, table_list->db,
+                                             table_list->table_name,
+                                             thd->lock_data_root());

  - when you make sure that mdl_acquire_lock actually allocates
    the lock request when it grants it, the lock_data here can be
    allocated on stack

14) in savepoint_release_locks(), you should do nothing if inside LOCK TABLES.
    Please add a test case ;)

Thank you for working on this!

bzr commit into mysql-6.0-runtime branch (davi:2696) Davi Arnaut11 Aug
  • Re: bzr commit into mysql-6.0-runtime branch (davi:2696)Konstantin Osipov23 Sep