List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:June 27 2011 7:01am
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4261 to 4262)
View as plain text  
 4262 Jonas Oreland	2011-06-27 [merge]
      ndb - merge 70 to 71

    modified:
      mysql-test/suite/funcs_1/r/ndb_views.result
      sql/ha_ndb_index_stat.cc
      storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp
      storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp
      storage/ndb/src/mgmsrv/MgmtSrvr.cpp
      storage/ndb/test/ndbapi/testMgmd.cpp
 4261 Craig L Russell	2011-06-24
      Update crund clusterjLoad to new operation names
      fix build for clusterjLoad

    modified:
      storage/ndb/test/crund/build.xml
      storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java
=== modified file 'mysql-test/suite/funcs_1/r/ndb_views.result'
--- a/mysql-test/suite/funcs_1/r/ndb_views.result	2009-10-27 16:44:30 +0000
+++ b/mysql-test/suite/funcs_1/r/ndb_views.result	2011-06-25 14:19:31 +0000
@@ -21439,7 +21439,7 @@ f1
 1.000
 EXPLAIN SELECT * FROM test3.v32;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	1	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	
 DROP VIEW test3.v0;
 SHOW CREATE VIEW test3.v32;
 View	Create View	character_set_client	collation_connection

=== modified file 'sql/ha_ndb_index_stat.cc'
--- a/sql/ha_ndb_index_stat.cc	2011-06-22 07:37:51 +0000
+++ b/sql/ha_ndb_index_stat.cc	2011-06-25 15:07:07 +0000
@@ -1084,10 +1084,10 @@ ndb_index_stat_proc_idle(Ndb_index_stat_
   const time_t check_wait=
     st->check_time == 0 ? 0 : st->check_time + check_delay - pr.now;
 
-  DBUG_PRINT("index_stat", ("st %s check wait:%ds force update:%u"
-                            " clean wait:%ds cache clean:%d",
-                            st->id, check_wait, st->force_update,
-                            clean_wait, st->cache_clean));
+  DBUG_PRINT("index_stat", ("st %s check wait:%lds force update:%u"
+                            " clean wait:%lds cache clean:%d",
+                            st->id, (long)check_wait, st->force_update,
+                            (long)clean_wait, st->cache_clean));
 
   if (!st->cache_clean && clean_wait <= 0)
   {

=== modified file 'storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp	2011-05-04 11:45:33 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/Dbspj.hpp	2011-06-24 12:01:37 +0000
@@ -532,7 +532,7 @@ public:
 
   struct ScanIndexData
   {
-    Uint16 m_frags_not_complete;
+    Uint16 m_frags_complete;
     Uint16 m_frags_outstanding;
     Uint32 m_rows_received;  // #execTRANSID_AI
     Uint32 m_rows_expecting; // Sum(ScanFragConf)

=== modified file 'storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2011-06-16 08:37:10 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp	2011-06-24 12:01:37 +0000
@@ -4449,7 +4449,7 @@ Dbspj::parseScanIndex(Build_context& ctx
     ScanIndexData& data = treeNodePtr.p->m_scanindex_data;
     data.m_fragments.init();
     data.m_frags_outstanding = 0;
-    data.m_frags_not_complete = 0;
+    data.m_frags_complete = 0;
     data.m_batch_chunks = 0;
 
     err = parseDA(ctx, requestPtr, treeNodePtr,
@@ -4679,6 +4679,7 @@ Dbspj::execDIH_SCAN_TAB_CONF(Signal* sig
       }
     }
   }
+  data.m_frags_complete = data.m_fragCount;
 
   if (!pruned)
   {
@@ -4966,7 +4967,8 @@ Dbspj::scanIndex_parent_batch_complete(S
   data.m_rows_received = 0;
   data.m_rows_expecting = 0;
   ndbassert(data.m_frags_outstanding == 0);
-  ndbassert(data.m_frags_not_complete == 0);
+  ndbassert(data.m_frags_complete == data.m_fragCount);
+  data.m_frags_complete = 0;
 
   Ptr<ScanFragHandle> fragPtr;
   {
@@ -4975,32 +4977,33 @@ Dbspj::scanIndex_parent_batch_complete(S
 
     if ((treeNodePtr.p->m_bits & TreeNode::T_PRUNE_PATTERN) == 0)
     {
-      if (fragPtr.p->m_rangePtrI != RNIL)
+      if (fragPtr.p->m_rangePtrI == RNIL)
       {
-        // No pruning, so we must scan all fragments.
+        // No keys found
         jam();
-        data.m_frags_not_complete = data.m_fragCount;
+        data.m_frags_complete = data.m_fragCount;
       }
     }
     else
     {
       while(!fragPtr.isNull())
       {
-        if (fragPtr.p->m_rangePtrI != RNIL)
+        if (fragPtr.p->m_rangePtrI == RNIL)
         {
           jam();
           /**
            * This is a pruned scan, so we must scan those fragments that
            * some distribution key hashed to.
            */
-          data.m_frags_not_complete++;
+          fragPtr.p->m_state = ScanFragHandle::SFH_COMPLETE;
+          data.m_frags_complete++;
         }
         list.next(fragPtr);
       }
     }
   }
 
-  if (data.m_frags_not_complete == 0)
+  if (data.m_frags_complete == data.m_fragCount)
   {
     jam();
     /**
@@ -5058,7 +5061,7 @@ Dbspj::scanIndex_send(Signal* signal,
   if (treeNodePtr.p->m_bits & TreeNode::T_SCAN_PARALLEL)
   {
     jam();
-    cnt = data.m_frags_not_complete;
+    cnt = data.m_fragCount - data.m_frags_complete;
     ndbrequire(cnt > 0);
 
     bs_rows /= cnt;
@@ -5194,7 +5197,8 @@ Dbspj::scanIndex_send(Signal* signal,
 
   if (treeNodePtr.p->m_bits & TreeNode::T_SCAN_PARALLEL)
   {
-    ndbrequire(data.m_frags_outstanding == data.m_frags_not_complete);
+    ndbrequire(data.m_frags_outstanding == 
+               data.m_fragCount - data.m_frags_complete);
   }
   else
   {
@@ -5295,10 +5299,10 @@ Dbspj::scanIndex_execSCAN_FRAGCONF(Signa
   {
     jam();
     fragPtr.p->m_state = ScanFragHandle::SFH_COMPLETE;
-    ndbrequire(data.m_frags_not_complete>0);
-    data.m_frags_not_complete--;
+    ndbrequire(data.m_frags_complete < data.m_fragCount);
+    data.m_frags_complete++;
 
-    if (data.m_frags_not_complete == 0)
+    if (data.m_frags_complete == data.m_fragCount)
     {
       jam();
       ndbrequire(requestPtr.p->m_cnt_active);
@@ -5355,12 +5359,12 @@ Dbspj::scanIndex_execSCAN_FRAGREF(Signal
   fragPtr.p->m_state = ScanFragHandle::SFH_COMPLETE;
 
   ScanIndexData& data = treeNodePtr.p->m_scanindex_data;
-  ndbrequire(data.m_frags_not_complete > 0);
-  data.m_frags_not_complete--;
+  ndbrequire(data.m_frags_complete < data.m_fragCount);
+  data.m_frags_complete++;
   ndbrequire(data.m_frags_outstanding > 0);
   data.m_frags_outstanding--;
 
-  if (data.m_frags_not_complete == 0)
+  if (data.m_frags_complete == data.m_fragCount)
   {
     jam();
     ndbrequire(requestPtr.p->m_cnt_active);
@@ -5391,8 +5395,8 @@ Dbspj::scanIndex_execSCAN_NEXTREQ(Signal
   data.m_rows_expecting = 0;
   ndbassert(data.m_frags_outstanding == 0);
 
-  ndbrequire(data.m_frags_not_complete>0);
-  Uint32 cnt = data.m_frags_not_complete;
+  ndbrequire(data.m_frags_complete < data.m_fragCount);
+  Uint32 cnt = data.m_fragCount - data.m_frags_complete;
   if ((treeNodePtr.p->m_bits & TreeNode::T_SCAN_PARALLEL) == 0)
   {
     jam();
@@ -5581,7 +5585,7 @@ Dbspj::scanIndex_execNODE_FAILREP(Signal
   Ptr<ScanFragHandle> fragPtr;
 
   Uint32 save0 = data.m_frags_outstanding;
-  Uint32 save1 = data.m_frags_not_complete;
+  Uint32 save1 = data.m_frags_complete;
 
   for (list.first(fragPtr); !fragPtr.isNull(); list.next(fragPtr))
   {
@@ -5597,8 +5601,8 @@ Dbspj::scanIndex_execNODE_FAILREP(Signal
     switch(fragPtr.p->m_state){
     case ScanFragHandle::SFH_NOT_STARTED:
       jam();
-      ndbrequire(data.m_frags_not_complete > 0);
-      data.m_frags_not_complete--;
+      ndbrequire(data.m_frags_complete < data.m_fragCount);
+      data.m_frags_complete++;
       // fall through
     case ScanFragHandle::SFH_COMPLETE:
       jam();
@@ -5618,8 +5622,8 @@ Dbspj::scanIndex_execNODE_FAILREP(Signal
     case ScanFragHandle::SFH_WAIT_NEXTREQ:
       jam();
       sum++;
-      ndbrequire(data.m_frags_not_complete > 0);
-      data.m_frags_not_complete--;
+      ndbrequire(data.m_frags_complete < data.m_fragCount);
+      data.m_frags_complete++;
       break;
     }
     fragPtr.p->m_ref = 0;
@@ -5633,7 +5637,8 @@ Dbspj::scanIndex_execNODE_FAILREP(Signal
     requestPtr.p->m_outstanding--;
   }
 
-  if (save1 != 0 && data.m_frags_not_complete == 0)
+  if (save1 != data.m_fragCount
+      && data.m_frags_complete == data.m_fragCount)
   {
     jam();
     ndbrequire(requestPtr.p->m_cnt_active);

=== modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp'
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2011-06-22 09:32:00 +0000
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2011-06-27 07:00:44 +0000
@@ -1081,10 +1081,6 @@ MgmtSrvr::sendall_STOP_REQ(NodeBitmask &
         else
           failed++;
       }
-      else
-      {
-        failed++;
-      }
     }
   }
 

=== modified file 'storage/ndb/test/ndbapi/testMgmd.cpp'
--- a/storage/ndb/test/ndbapi/testMgmd.cpp	2011-06-21 13:50:33 +0000
+++ b/storage/ndb/test/ndbapi/testMgmd.cpp	2011-06-27 07:00:44 +0000
@@ -280,6 +280,8 @@ public:
 
   }
 
+  NdbMgmHandle handle() { return m_mgmd_client.handle(); }
+
 private:
 
   bool get_section_string(const Properties& config,
@@ -1099,6 +1101,55 @@ int runTestBug12352191(NDBT_Context* ctx
 
 }
 
+int
+runBug61607(NDBT_Context* ctx, NDBT_Step* step)
+{
+  NDBT_Workingdir wd("test_mgmd"); // temporary working directory
+
+  // Create config.ini
+  const int cnt_mgmd = 1;
+  Properties config = ConfigFactory::create(cnt_mgmd);
+  CHECK(ConfigFactory::write_config_ini(config,
+                                        path(wd.path(),
+                                             "config.ini",
+                                             NULL).c_str()));
+  // Start ndb_mgmd(s)
+  MgmdProcessList mgmds;
+  for (int i = 1; i <= cnt_mgmd; i++)
+  {
+    Mgmd* mgmd = new Mgmd(i);
+    mgmds.push_back(mgmd);
+    CHECK(mgmd->start_from_config_ini(wd.path()));
+  }
+
+  // Connect the ndb_mgmd(s)
+  for (unsigned i = 0; i < mgmds.size(); i++)
+    CHECK(mgmds[i]->connect(config));
+
+  // wait for confirmed config
+  for (unsigned i = 0; i < mgmds.size(); i++)
+    CHECK(mgmds[i]->wait_confirmed_config());
+
+  // Check binary config files created
+  CHECK(file_exists(path(wd.path(),
+                         "ndb_1_config.bin.1",
+                         NULL).c_str()));
+
+  int no_of_nodes = 0;
+  int * node_ids = 0;
+  int initialstart = 0;
+  int nostart = 0;
+  int abort = 0;
+  int force = 0;
+  int need_disconnect = 0;
+  int res = ndb_mgm_restart4(mgmds[0]->handle(), no_of_nodes, node_ids,
+                             initialstart, nostart, abort, force,
+                             &need_disconnect);
+
+
+  return res == 0 ? NDBT_OK : NDBT_FAILED;
+}
+
 NDBT_TESTSUITE(testMgmd);
 DRIVER(DummyDriver); /* turn off use of NdbApi */
 
@@ -1151,6 +1202,10 @@ TESTCASE("Bug12352191",
 {
   INITIALIZER(runTestBug12352191);
 }
+TESTCASE("Bug61607", "")
+{
+  INITIALIZER(runBug61607);
+}
 
 NDBT_TESTSUITE_END(testMgmd);
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas.oreland:4261 to 4262) Jonas Oreland27 Jun