List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:October 21 2010 8:46pm
Subject:bzr commit into mysql-5.5-runtime branch (kostja:3175) Bug#54673
View as plain text  
#At file:///opt/local/work/5.5-rt-stage/ based on revid:kostja@stripped

 3175 Konstantin Osipov	2010-10-22
      Bug#54673, code review: remove a special case for innobackup.pl,
      it's unnecessary.

    modified:
      sql/handler.cc
      sql/lock.cc
      sql/sql_class.h
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2010-10-18 12:33:49 +0000
+++ b/sql/handler.cc	2010-10-21 20:46:17 +0000
@@ -1169,18 +1169,16 @@ int ha_commit_trans(THD *thd, bool all)
     if (rw_trans)
     {
       /*
-        Acquire metadata lock which will ensure that COMMIT is blocked
-        by active FLUSH TABLES WITH READ LOCK (and vice versa COMMIT in
-        progress blocks FTWRL).
-
-        We allow FLUSHer to COMMIT; we assume FLUSHer knows what it does.
-        This allowance is needed to not break existing versions of innobackup
-        which do a BEGIN; INSERT; FLUSH TABLES WITH READ LOCK; COMMIT.
+        Acquire a metadata lock which will ensure that COMMIT is blocked
+        by an active FLUSH TABLES WITH READ LOCK (and vice versa:
+        COMMIT in progress blocks FTWRL).
+
+        We allow the owner of FTWRL to COMMIT; we assume that it knows
+        what it does.
       */
-      thd->global_read_lock.init_commit_request(&mdl_request);
+      mdl_request.init(MDL_key::COMMIT, "", "", MDL_INTENTION_EXCLUSIVE);
 
-      if (! thd->global_read_lock.has_read_lock() &&
-          thd->mdl_context.acquire_lock(&mdl_request,
+      if (thd->mdl_context.acquire_lock(&mdl_request,
                                         thd->variables.lock_wait_timeout))
       {
         ha_rollback_trans(thd, all);

=== modified file 'sql/lock.cc'
--- a/sql/lock.cc	2010-10-20 07:52:42 +0000
+++ b/sql/lock.cc	2010-10-21 20:46:17 +0000
@@ -1068,18 +1068,6 @@ void Global_read_lock::init_protection_r
 
 
 /**
-  Initialize request for lock protecting commit from GRL (and vice versa).
-
-  QQ: Does it make sense to make it inline?
-*/
-
-void Global_read_lock::init_commit_request(MDL_request *request)
-{
-  request->init(MDL_key::COMMIT, "", "", MDL_INTENTION_EXCLUSIVE);
-}
-
-
-/**
   Release protection against global read lock if it is set.
 
   See also "Handling of global read locks" above.

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2010-10-20 07:52:42 +0000
+++ b/sql/sql_class.h	2010-10-21 20:46:17 +0000
@@ -1346,7 +1346,6 @@ public:
   bool can_acquire_protection();
   bool has_read_lock() const { return (m_state != GRL_NONE); }
   void init_protection_request(MDL_request *request);
-  void init_commit_request(MDL_request *request);
   void release_protection_if_set(THD *thd);
   bool make_global_read_lock_block_commit(THD *thd);
   bool is_acquired() const { return m_state != GRL_NONE; }


Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20101021204617-g0wu2mpdhjuwogpn.bundle
Thread
bzr commit into mysql-5.5-runtime branch (kostja:3175) Bug#54673Konstantin Osipov21 Oct