List:Commits« Previous MessageNext Message »
From:jonas oreland Date:September 23 2011 5:19pm
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4544 to 4545)
View as plain text  
 4545 jonas oreland	2011-09-23
      ndb - fix a potential mutex deadlock in ndb_mgmd (last minute fix :())

    modified:
      storage/ndb/src/mgmsrv/MgmtSrvr.cpp
 4544 jonas oreland	2011-09-22 {clone-mysql-5.1.56-ndb-7.0.27-src-build}
      ndb - bug#12543299 - increase default values of ndb-wait-connected and ndb-wait-setup to 30 from 0 and 15 resp. This is there previously was a "hidden" wait of 30s that now has been removed

    modified:
      mysql-test/suite/ndb/my.cnf
      mysql-test/suite/ndb_binlog/my.cnf
      mysql-test/suite/ndb_rpl/my.cnf
      mysql-test/suite/ndb_team/my.cnf
      mysql-test/suite/rpl_ndb/my.cnf
      sql/ha_ndbcluster.cc
=== modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp'
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2011-09-19 14:10:19 +0000
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2011-09-23 17:19:24 +0000
@@ -3451,15 +3451,17 @@ MgmtSrvr::try_alloc_from_list(NodeId& no
   for (unsigned i = 0; i < nodes.size(); i++)
   {
     const unsigned id= nodes[i].id;
-    if (m_reserved_nodes.get(id))
+    if (theFacade->ext_isConnected(id))
     {
-      // Node is already reserved(locally in this node)
+      // Node is already reserved(connected via transporter)
       continue;
     }
 
-    if (theFacade->ext_isConnected(id))
+    NdbMutex_Lock(m_reserved_nodes_mutex);
+    if (m_reserved_nodes.get(id))
     {
-      // Node is already reserved(connected via transporter)
+      // Node is already reserved(locally in this node)
+      NdbMutex_Unlock(m_reserved_nodes_mutex);
       continue;
     }
 
@@ -3483,16 +3485,14 @@ MgmtSrvr::try_alloc_from_list(NodeId& no
           more than one thread asked for same nodeid) since it's
           now reserved in data node
         */
-        m_reserved_nodes.clear(id);
+        release_local_nodeid_reservation(id);
       }
 
-      NdbMutex_Lock(m_reserved_nodes_mutex);
       return true;
     }
 
     /* Release the local reservation */
-    m_reserved_nodes.clear(id);
-    NdbMutex_Lock(m_reserved_nodes_mutex);
+    release_local_nodeid_reservation(id);
 
     if (res < 0)
     {
@@ -3601,8 +3601,6 @@ MgmtSrvr::alloc_node_id_impl(NodeId& nod
     return false;
   }
 
-  Guard g(m_reserved_nodes_mutex);
-
   /* Check timeout of nodeid reservations for NDB */
   if (type == NDB_MGM_NODE_TYPE_NDB)
   {
@@ -3610,8 +3608,11 @@ MgmtSrvr::alloc_node_id_impl(NodeId& nod
     for (unsigned i = 0; i < nodes.size(); i++)
     {
       const NodeId ndb_nodeid = nodes[i].id;
-      if (!m_reserved_nodes.has_timedout(ndb_nodeid, now))
-        continue;
+      {
+        Guard g(m_reserved_nodes_mutex);
+        if (!m_reserved_nodes.has_timedout(ndb_nodeid, now))
+          continue;
+      }
 
       // Found a timedout reservation
       if (theFacade->ext_isConnected(ndb_nodeid))
@@ -3621,7 +3622,7 @@ MgmtSrvr::alloc_node_id_impl(NodeId& nod
                              "releasing it", ndb_nodeid);
 
       // Clear the reservation
-      m_reserved_nodes.clear(ndb_nodeid);
+      release_local_nodeid_reservation(ndb_nodeid);
     }
   }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4544 to 4545) jonas oreland24 Sep