From: Ole John Aske Date: November 25 2010 2:42pm Subject: bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (ole.john.aske:3379) List-Archive: http://lists.mysql.com/commits/125034 Message-Id: <20101125144235.2AF84222@fimafeng09.norway.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///net/fimafeng09/export/home/tmp/oleja/mysql/mysql-5.1-telco-7.0-spj-scan-scan/ based on revid:ole.john.aske@stripped 3379 Ole John Aske 2010-11-25 [merge] Merge from telco-7.0 mainline modified: mysql-test/suite/ndb/r/ndb_index.result mysql-test/suite/ndb/r/ndb_read_multi_range.result mysql-test/suite/ndb/t/ndb_index.test mysql-test/suite/ndb/t/ndb_read_multi_range.test mysql-test/suite/rpl/t/disabled.def sql/ha_ndbcluster.cc sql/ha_ndbcluster.h sql/rpl_utility.cc storage/ndb/src/kernel/blocks/ERROR_codes.txt storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp storage/ndb/src/kernel/vm/GlobalData.hpp storage/ndb/src/kernel/vm/mt.cpp storage/ndb/src/mgmsrv/ConfigInfo.cpp storage/ndb/test/ndbapi/testNdbApi.cpp storage/ndb/test/ndbapi/testNodeRestart.cpp storage/ndb/test/run-test/daily-basic-tests.txt === modified file 'mysql-test/suite/ndb/r/ndb_index.result' --- a/mysql-test/suite/ndb/r/ndb_index.result 2010-03-01 21:19:10 +0000 +++ b/mysql-test/suite/ndb/r/ndb_index.result 2010-11-25 14:42:27 +0000 @@ -288,3 +288,93 @@ b 5 6 drop table t1; +create table t1(vc varchar(16), i int, vc2 varchar(1024) +, PRIMARY KEY(vc,vc2) USING HASH +, KEY i1(i) +, KEY i2(vc) +) ENGINE=ndbcluster; +insert into t1 values +('1',1,'1'), ('2',2,'2'), ('3',3,'3'), ('4',1,'4'), ('5',2,'5'), +('6',3,'6'), ('7',1,'7'), ('8',2,'8'), ('9',3,'9'), ('10',1,'10'), +('11',2,'11'), ('12',3,'12'), ('13',1,'13'), ('14',2,'14'), ('15',3,'15'), +('16',1,'16'), ('17',2,'17'), ('x',3,'x'), ('y',1,'y'), ('z',2,'z'), +('1000',3,'1000'), ('2000',3,'2000'), ('10000',3,'10000'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +explain +select i,vc from t1 +where i>=1 or vc > '0'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge PRIMARY,i1,i2 i1,i2 5,18 NULL 20 Using sort_union(i1,i2); Using where with pushed condition +select i,vc from t1 +where i>=1 or vc > '0'; +i vc +1 1 +1 10 +1 13 +1 16 +1 4 +1 7 +1 y +2 11 +2 14 +2 17 +2 2 +2 5 +2 8 +2 z +3 1000 +3 10000 +3 12 +3 15 +3 2000 +3 3 +3 6 +3 9 +3 x +create table t2(vc varchar(16), i int, vc2 varchar(1024) +, KEY i1(i) +, KEY i2(vc) +) ENGINE=ndbcluster; +insert into t2 values +('1',1,'1'), ('2',2,'2'), ('3',3,'3'), ('4',1,'4'), ('5',2,'5'), +('6',3,'6'), ('7',1,'7'), ('8',2,'8'), ('9',3,'9'), ('10',1,'10'), +('11',2,'11'), ('12',3,'12'), ('13',1,'13'), ('14',2,'14'), ('15',3,'15'), +('16',1,'16'), ('17',2,'17'), ('x',3,'x'), ('y',1,'y'), ('z',2,'z'), +('1000',3,'1000'), ('2000',3,'2000'), ('10000',3,'10000'); +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain +select i,vc from t2 +where i>=1 or vc > '0'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index_merge i1,i2 i1,i2 5,19 NULL 20 Using sort_union(i1,i2); Using where with pushed condition +select i,vc from t2 +where i>=1 or vc > '0'; +i vc +1 1 +1 10 +1 13 +1 16 +1 4 +1 7 +1 y +2 11 +2 14 +2 17 +2 2 +2 5 +2 8 +2 z +3 1000 +3 10000 +3 12 +3 15 +3 2000 +3 3 +3 6 +3 9 +3 x +drop table t1, t2; === modified file 'mysql-test/suite/ndb/r/ndb_read_multi_range.result' --- a/mysql-test/suite/ndb/r/ndb_read_multi_range.result 2010-10-15 13:49:39 +0000 +++ b/mysql-test/suite/ndb/r/ndb_read_multi_range.result 2010-11-25 14:42:27 +0000 @@ -599,12 +599,12 @@ t1.a + t2.a*10 + t3.a*100 + t4.a*1000, (t1.a + t2.a*10 + t3.a*100 + t4.a*1000) / 1000 from t2 as t1, t2 as t2, t2 as t3, t2 as t4 -where (t1.a + t2.a*10 + t3.a*100 + t4.a*1000) < 4000; +where (t1.a + t2.a*10 + t3.a*100 + t4.a*1000) < 3000; explain SELECT DISTINCT STRAIGHT_JOIN t1.pk FROM t1 LEFT JOIN t2 ON t2.a = t1.a AND t2.pk != 6; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 4000 Using temporary +1 SIMPLE t1 ALL NULL NULL NULL NULL 3000 Using temporary 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Distinct SELECT DISTINCT STRAIGHT_JOIN t1.pk FROM t1 LEFT JOIN t2 ON t2.a = t1.a AND t2.pk != 6; === modified file 'mysql-test/suite/ndb/t/ndb_index.test' --- a/mysql-test/suite/ndb/t/ndb_index.test 2010-03-01 20:10:49 +0000 +++ b/mysql-test/suite/ndb/t/ndb_index.test 2010-11-24 17:45:27 +0000 @@ -192,3 +192,50 @@ select distinct b from t1; select distinct b from t1 group by b; drop table t1; + +# bug#58280 +create table t1(vc varchar(16), i int, vc2 varchar(1024) + , PRIMARY KEY(vc,vc2) USING HASH + , KEY i1(i) + , KEY i2(vc) + ) ENGINE=ndbcluster; + +insert into t1 values +('1',1,'1'), ('2',2,'2'), ('3',3,'3'), ('4',1,'4'), ('5',2,'5'), +('6',3,'6'), ('7',1,'7'), ('8',2,'8'), ('9',3,'9'), ('10',1,'10'), +('11',2,'11'), ('12',3,'12'), ('13',1,'13'), ('14',2,'14'), ('15',3,'15'), +('16',1,'16'), ('17',2,'17'), ('x',3,'x'), ('y',1,'y'), ('z',2,'z'), +('1000',3,'1000'), ('2000',3,'2000'), ('10000',3,'10000'); + +analyze table t1; +explain +select i,vc from t1 + where i>=1 or vc > '0'; + +--sorted_result +select i,vc from t1 + where i>=1 or vc > '0'; + +# also test with hidden primary key +create table t2(vc varchar(16), i int, vc2 varchar(1024) + , KEY i1(i) + , KEY i2(vc) + ) ENGINE=ndbcluster; + +insert into t2 values +('1',1,'1'), ('2',2,'2'), ('3',3,'3'), ('4',1,'4'), ('5',2,'5'), +('6',3,'6'), ('7',1,'7'), ('8',2,'8'), ('9',3,'9'), ('10',1,'10'), +('11',2,'11'), ('12',3,'12'), ('13',1,'13'), ('14',2,'14'), ('15',3,'15'), +('16',1,'16'), ('17',2,'17'), ('x',3,'x'), ('y',1,'y'), ('z',2,'z'), +('1000',3,'1000'), ('2000',3,'2000'), ('10000',3,'10000'); + +analyze table t2; +explain +select i,vc from t2 + where i>=1 or vc > '0'; + +--sorted_result +select i,vc from t2 + where i>=1 or vc > '0'; + +drop table t1, t2; === modified file 'mysql-test/suite/ndb/t/ndb_read_multi_range.test' --- a/mysql-test/suite/ndb/t/ndb_read_multi_range.test 2010-10-15 13:49:39 +0000 +++ b/mysql-test/suite/ndb/t/ndb_read_multi_range.test 2010-11-25 14:42:27 +0000 @@ -460,7 +460,7 @@ insert into t1 (t1.a + t2.a*10 + t3.a*100 + t4.a*1000) / 1000 from t2 as t1, t2 as t2, t2 as t3, t2 as t4 -where (t1.a + t2.a*10 + t3.a*100 + t4.a*1000) < 4000; +where (t1.a + t2.a*10 + t3.a*100 + t4.a*1000) < 3000; # Execute a 'scan(t1) join mrr(t2)' === modified file 'mysql-test/suite/rpl/t/disabled.def' --- a/mysql-test/suite/rpl/t/disabled.def 2010-10-12 11:54:35 +0000 +++ b/mysql-test/suite/rpl/t/disabled.def 2010-11-23 14:12:50 +0000 @@ -10,7 +10,6 @@ # ############################################################################## -rpl_geometry : bug#51996 rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576 rpl_log_pos : BUG#55675 Sep 10 2010 27 2010 alfranio rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2010-11-23 10:05:44 +0000 +++ b/sql/ha_ndbcluster.cc 2010-11-25 14:42:27 +0000 @@ -7823,7 +7823,7 @@ int ha_ndbcluster::rnd_next(uchar *buf) error= next_result(buf); else error= full_table_scan(NULL, NULL, NULL, buf); - + table->status= error ? STATUS_NOT_FOUND: 0; DBUG_RETURN(error); } @@ -7990,6 +7990,44 @@ void ha_ndbcluster::position(const uchar DBUG_VOID_RETURN; } +int +ha_ndbcluster::cmp_ref(const uchar * ref1, const uchar * ref2) +{ + DBUG_ENTER("cmp_ref"); + + if (table_share->primary_key != MAX_KEY) + { + KEY *key_info= table->key_info + table_share->primary_key; + KEY_PART_INFO *key_part= key_info->key_part; + KEY_PART_INFO *end= key_part + key_info->key_parts; + + for (; key_part != end; key_part++) + { + // NOTE: No need to check for null since PK is not-null + + Field *field= key_part->field; + int result= field->key_cmp(ref1, ref2); + if (result) + { + DBUG_RETURN(result); + } + + if (field->type() == MYSQL_TYPE_VARCHAR) + { + ref1+= 2; + ref2+= 2; + } + + ref1+= key_part->length; + ref2+= key_part->length; + } + DBUG_RETURN(0); + } + else + { + DBUG_RETURN(memcmp(ref1, ref2, ref_length)); + } +} int ha_ndbcluster::info(uint flag) { @@ -14058,8 +14096,7 @@ ha_ndbcluster::read_multi_range_first(KE } /** - * There may still be an open m_multi_cursor from the previous - * mrr access on this handler. + * There may still be an open m_multi_cursor from the previous mrr access on this handler. * Close it now to free up resources for this NdbScanOperation. */ if (unlikely((error= close_scan()))) === modified file 'sql/ha_ndbcluster.h' --- a/sql/ha_ndbcluster.h 2010-11-15 10:26:48 +0000 +++ b/sql/ha_ndbcluster.h 2010-11-25 14:42:27 +0000 @@ -451,6 +451,7 @@ class ha_ndbcluster: public handler int rnd_pos(uchar *buf, uchar *pos); void position(const uchar *record); int read_first_row(uchar *buf, uint primary_key); + virtual int cmp_ref(const uchar * ref1, const uchar * ref2); int read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range, bool sorted); === modified file 'sql/rpl_utility.cc' --- a/sql/rpl_utility.cc 2010-11-09 09:29:29 +0000 +++ b/sql/rpl_utility.cc 2010-11-23 14:45:43 +0000 @@ -995,6 +995,7 @@ table_def::table_def(unsigned char *type case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_DOUBLE: case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_GEOMETRY: { /* These types store a single byte. === modified file 'storage/ndb/src/kernel/blocks/ERROR_codes.txt' --- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt 2010-10-29 20:51:26 +0000 +++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt 2010-11-25 14:42:27 +0000 @@ -3,7 +3,7 @@ Next NDBCNTR 1002 Next NDBFS 2000 Next DBACC 3002 Next DBTUP 4035 -Next DBLQH 5061 +Next DBLQH 5064 Next DBDICT 6026 Next DBDIH 7229 Next DBTC 8088 === modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp' --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2010-10-29 20:45:08 +0000 +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2010-11-25 14:42:27 +0000 @@ -1714,6 +1714,17 @@ void Dbdih::execNDB_STTOR(Signal* signal break; case ZNDB_SPH5: jam(); + if (m_gcp_monitor.m_micro_gcp.m_max_lag > 0) + { + infoEvent("GCP Monitor: Computed max GCP_SAVE lag to %u seconds", + m_gcp_monitor.m_gcp_save.m_max_lag / 10); + infoEvent("GCP Monitor: Computed max GCP_COMMIT lag to %u seconds", + m_gcp_monitor.m_micro_gcp.m_max_lag / 10); + } + else + { + infoEvent("GCP Monitor: unlimited lags allowed"); + } switch(typestart){ case NodeState::ST_INITIAL_START: case NodeState::ST_SYSTEM_RESTART: @@ -5851,6 +5862,17 @@ void Dbdih::MASTER_GCPhandling(Signal* s m_micro_gcp.m_master.m_start_time = 0; m_gcp_save.m_master.m_start_time = 0; + if (m_gcp_monitor.m_micro_gcp.m_max_lag > 0) + { + infoEvent("GCP Monitor: Computed max GCP_SAVE lag to %u seconds", + m_gcp_monitor.m_gcp_save.m_max_lag / 10); + infoEvent("GCP Monitor: Computed max GCP_COMMIT lag to %u seconds", + m_gcp_monitor.m_micro_gcp.m_max_lag / 10); + } + else + { + infoEvent("GCP Monitor: unlimited lags allowed"); + } bool ok = false; switch(m_micro_gcp.m_master.m_state){ @@ -13948,11 +13970,29 @@ void Dbdih::checkGcpStopLab(Signal* sign if (m_gcp_monitor.m_gcp_save.m_gci == m_gcp_save.m_gci) { jam(); - if (cnt0 == m_gcp_monitor.m_gcp_save.m_max_lag) + if (m_gcp_monitor.m_gcp_save.m_max_lag && + cnt0 == m_gcp_monitor.m_gcp_save.m_max_lag) { crashSystemAtGcpStop(signal, false); return; } + + Uint32 threshold = 60; // seconds + if (cnt0 && ((cnt0 % (threshold * 10)) == 0)) + { + if (m_gcp_monitor.m_gcp_save.m_max_lag) + { + warningEvent("GCP Monitor: GCP_SAVE lag %u seconds" + " (max lag: %us)", + cnt0/10, m_gcp_monitor.m_gcp_save.m_max_lag/10); + } + else + { + warningEvent("GCP Monitor: GCP_SAVE lag %u seconds" + " (no max lag)", + cnt0/10); + } + } } else { @@ -13968,11 +14008,28 @@ void Dbdih::checkGcpStopLab(Signal* sign m_gcp_monitor.m_micro_gcp.m_max_lag : m_gcp_monitor.m_gcp_save.m_max_lag; - if (cnt1 == cmp) + if (cmp && cnt1 == cmp) { crashSystemAtGcpStop(signal, false); return; } + + Uint32 threshold = 10; // seconds + if (cnt1 && ((cnt0 % (threshold * 10)) == 0)) + { + if (m_gcp_monitor.m_micro_gcp.m_max_lag) + { + warningEvent("GCP Monitor: GCP_COMMIT lag %u seconds" + " (max lag: %u)", + cnt1/10, m_gcp_monitor.m_micro_gcp.m_max_lag/10); + } + else + { + warningEvent("GCP Monitor: GCP_COMMIT lag %u seconds" + " (no max lag)", + cnt1/10); + } + } } else { @@ -14933,9 +14990,19 @@ void Dbdih::initCommonData() { // Set time-between epochs timeout Uint32 tmp = 4000; ndb_mgm_get_int_parameter(p, CFG_DB_MICRO_GCP_TIMEOUT, &tmp); - tmp += max_failure_time; - m_gcp_monitor.m_micro_gcp.m_max_lag = - (m_micro_gcp.m_master.m_time_between_gcp + tmp) / 100; + if (tmp != 0) + { + jam(); + tmp += max_failure_time; + m_gcp_monitor.m_micro_gcp.m_max_lag = + (m_micro_gcp.m_master.m_time_between_gcp + tmp) / 100; + } + else + { + jam(); + m_gcp_monitor.m_gcp_save.m_max_lag = 0; + m_gcp_monitor.m_micro_gcp.m_max_lag = 0; + } } } }//Dbdih::initCommonData() === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2010-11-04 09:41:08 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2010-11-25 14:42:27 +0000 @@ -3104,7 +3104,11 @@ void Dblqh::execPACKED_SIGNAL(Signal* si TcommitLen = 4; Tgci_lo_mask = 0; } - + +#ifdef ERROR_INSERT + Uint32 senderBlockRef = signal->getSendersBlockRef(); +#endif + ndbrequire(Tlength <= 25); MEMCOPY_NO_WORDS(&TpackedData[0], &signal->theData[0], Tlength); while (Tlength > Tstep) { @@ -3173,6 +3177,9 @@ void Dblqh::execPACKED_SIGNAL(Signal* si ndbrequire(false); return; }//switch +#ifdef ERROR_INSERT + signal->header.theSendersBlockRef = senderBlockRef; +#endif }//while ndbrequire(Tlength == Tstep); return; @@ -7176,6 +7183,24 @@ void Dblqh::execCOMMIT(Signal* signal) sendSignalWithDelay(cownref, GSN_COMMIT, signal, 2000,signal->getLength()); return; }//if + if (ERROR_INSERTED(5062) && + ((refToMain(signal->getSendersBlockRef()) == DBTC) || + signal->getSendersBlockRef() == reference())) + { + Uint32 save = signal->getSendersBlockRef(); + ndbout_c("Delaying execCOMMIT"); + sendSignalWithDelay(cownref, GSN_COMMIT, signal, 2000, signal->getLength()); + + if (refToMain(save) == DBTC) + { + ndbout_c("killing %u", refToNode(save)); + signal->theData[0] = 9999; + sendSignal(numberToRef(CMVMI, refToNode(save)), + GSN_NDB_TAMPER, signal, 1, JBB); + } + return; + } + tcConnectptr.i = tcIndex; ptrAss(tcConnectptr, regTcConnectionrec); if ((tcConnectptr.p->transid[0] == transid1) && @@ -7313,6 +7338,24 @@ void Dblqh::execCOMPLETE(Signal* signal) sendSignalWithDelay(cownref, GSN_COMPLETE, signal, 2000, 3); return; }//if + if (ERROR_INSERTED(5063) && + ((refToMain(signal->getSendersBlockRef()) == DBTC) || + signal->getSendersBlockRef() == reference())) + { + Uint32 save = signal->getSendersBlockRef(); + ndbout_c("Delaying execCOMPLETE"); + sendSignalWithDelay(cownref, GSN_COMPLETE,signal, 2000,signal->getLength()); + + if (refToMain(save) == DBTC) + { + ndbout_c("killing %u", refToNode(save)); + signal->theData[0] = 9999; + sendSignal(numberToRef(CMVMI, refToNode(save)), + GSN_NDB_TAMPER, signal, 1, JBB); + } + return; + } + tcConnectptr.i = tcIndex; ptrAss(tcConnectptr, regTcConnectionrec); if ((tcConnectptr.p->transactionState == TcConnectionrec::COMMITTED) && @@ -7871,8 +7914,6 @@ void Dblqh::commitReplyLab(Signal* signa sendSignal(tcConnectptr.p->reqBlockref, GSN_COMMITCONF, signal, 4, JBB); } else { ndbrequire(regTcPtr->abortState == TcConnectionrec::NEW_FROM_TC); - jam(); - sendLqhTransconf(signal, LqhTransConf::Committed); }//if return; }//Dblqh::commitReplyLab() @@ -7925,7 +7966,6 @@ void Dblqh::completeUnusualLab(Signal* s sendAborted(signal); } else if (regTcPtr->abortState == TcConnectionrec::NEW_FROM_TC) { jam(); - sendLqhTransconf(signal, LqhTransConf::Committed); } else { ndbrequire(regTcPtr->abortState == TcConnectionrec::REQ_FROM_TC); jam(); @@ -8387,6 +8427,7 @@ void Dblqh::abortStateHandlerLab(Signal* /*WE ARE ONLY CHECKING THE STATUS OF THE TRANSACTION. IT IS COMMITTING. */ /*COMPLETE THE COMMIT LOCALLY AND THEN SEND REPORT OF COMMITTED TO THE NEW TC*/ /* ------------------------------------------------------------------------- */ + sendLqhTransconf(signal, LqhTransConf::Committed); return; break; case TcConnectionrec::COMMITTED: @@ -8900,6 +8941,29 @@ void Dblqh::lqhTransNextLab(Signal* sign * now scan markers */ #ifdef ERROR_INSERT + if (ERROR_INSERTED(5061)) + { + CLEAR_ERROR_INSERT_VALUE; + for (Uint32 i = 0; i < cnoOfNodes; i++) + { + Uint32 node = cnodeData[i]; + if (node != getOwnNodeId() && cnodeStatus[i] == ZNODE_UP) + { + ndbout_c("clearing ERROR_INSERT in LQH:%u", node); + signal->theData[0] = 0; + sendSignal(numberToRef(DBLQH, node), GSN_NDB_TAMPER, + signal, 1, JBB); + } + } + + signal->theData[0] = ZSCAN_MARKERS; + signal->theData[1] = tcNodeFailptr.i; + signal->theData[2] = 0; + signal->theData[3] = RNIL; + sendSignalWithDelay(cownref, GSN_CONTINUEB, signal, 5000, 4); + return; + } + if (ERROR_INSERTED(5050)) { ndbout_c("send ZSCAN_MARKERS with 5s delay and killing master"); === modified file 'storage/ndb/src/kernel/vm/GlobalData.hpp' --- a/storage/ndb/src/kernel/vm/GlobalData.hpp 2010-04-28 12:21:54 +0000 +++ b/storage/ndb/src/kernel/vm/GlobalData.hpp 2010-11-25 12:53:32 +0000 @@ -96,6 +96,7 @@ struct GlobalData { SimulatedBlock * getBlockInstance(BlockNumber fullBlockNo) { return getBlock(blockToMain(fullBlockNo), blockToInstance(fullBlockNo)); } + SimulatedBlock * mt_getBlock(BlockNumber blockNo, Uint32 instanceNo); void incrementWatchDogCounter(Uint32 place); Uint32 * getWatchDogPtr(); === modified file 'storage/ndb/src/kernel/vm/mt.cpp' --- a/storage/ndb/src/kernel/vm/mt.cpp 2010-11-10 08:01:00 +0000 +++ b/storage/ndb/src/kernel/vm/mt.cpp 2010-11-25 14:42:27 +0000 @@ -34,6 +34,16 @@ #include "mt-asm.h" +inline +SimulatedBlock* +GlobalData::mt_getBlock(BlockNumber blockNo, Uint32 instanceNo) +{ + SimulatedBlock* b = getBlock(blockNo); + if (b != 0 && instanceNo != 0) + b = b->getInstance(instanceNo); + return b; +} + #ifdef __GNUC__ /* Provides a small (but noticeable) speedup in benchmarks. */ #define memcpy __builtin_memcpy @@ -2395,7 +2405,7 @@ execute_signals(thr_data *selfptr, thr_j } Uint32 bno = blockToMain(s->theReceiversBlockNumber); Uint32 ino = map_instance(s); - SimulatedBlock* block = globalData.getBlock(bno, ino); + SimulatedBlock* block = globalData.mt_getBlock(bno, ino); assert(block != 0); Uint32 gsn = s->theVerId_signalNumber; === modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp' --- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2010-10-28 13:24:21 +0000 +++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2010-11-22 14:27:12 +0000 @@ -1038,7 +1038,7 @@ const ConfigInfo::ParamInfo ConfigInfo:: ConfigInfo::CI_INT, "4000", "0", - "32000" }, + "256000" }, { CFG_DB_MAX_BUFFERED_EPOCHS, === modified file 'storage/ndb/test/ndbapi/testNdbApi.cpp' --- a/storage/ndb/test/ndbapi/testNdbApi.cpp 2010-11-10 12:28:34 +0000 +++ b/storage/ndb/test/ndbapi/testNdbApi.cpp 2010-11-24 12:42:48 +0000 @@ -3104,7 +3104,8 @@ int runBulkPkReads(NDBT_Context* ctx, ND hugoOps.closeTransaction(otherNdb); - if ((err.code == 4010) || // Node failure + if ((err.code == 4002) || // send failed + (err.code == 4010) || // Node failure (err.code == 4025) || // Node failure (err.code == 1218)) // Send buffer overload (reading larger tables) { === modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp' --- a/storage/ndb/test/ndbapi/testNodeRestart.cpp 2010-10-28 12:59:31 +0000 +++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp 2010-11-24 12:16:55 +0000 @@ -4127,6 +4127,59 @@ runForceStopAndRestart(NDBT_Context* ctx return NDBT_OK; } +int +runBug58453(NDBT_Context* ctx, NDBT_Step* step) +{ + NdbRestarter res; + if (res.getNumDbNodes() < 4) + return NDBT_OK; + + Ndb* pNdb = GETNDB(step); + HugoOperations hugoOps(*ctx->getTab()); + + int loops = ctx->getNumLoops(); + while (loops--) + { + if (hugoOps.startTransaction(pNdb) != 0) + return NDBT_FAILED; + + if (hugoOps.pkInsertRecord(pNdb, 0, 128 /* records */) != 0) + return NDBT_FAILED; + + int err = 5062; + switch(loops & 1){ + case 0: + err = 5062; + break; + case 1: + err = 5063; + break; + } + int node = (int)hugoOps.getTransaction()->getConnectedNodeId(); + int node0 = res.getRandomNodeOtherNodeGroup(node, rand()); + int node1 = res.getRandomNodeSameNodeGroup(node0, rand()); + + ndbout_c("node %u err: %u, node: %u err: %u", + node0, 5061, node1, err); + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + + res.dumpStateOneNode(node, val2, 2); + res.insertErrorInNode(node0, 5061); + res.insertErrorInNode(node1, err); + + hugoOps.execute_Commit(pNdb); + hugoOps.closeTransaction(pNdb); + + res.waitNodesNoStart(&node, 1); + res.startNodes(&node, 1); + res.waitClusterStarted(); + hugoOps.clearTable(pNdb); + } + + return NDBT_OK; +} + NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", "Test that one node at a time can be stopped and then restarted "\ @@ -4609,6 +4662,10 @@ TESTCASE("Bug42422", ""){ TESTCASE("Bug43224", ""){ INITIALIZER(runBug43224); } +TESTCASE("Bug58453", "") +{ + INITIALIZER(runBug58453); +} TESTCASE("Bug43888", ""){ INITIALIZER(runBug43888); } === modified file 'storage/ndb/test/run-test/daily-basic-tests.txt' --- a/storage/ndb/test/run-test/daily-basic-tests.txt 2010-11-03 14:11:46 +0000 +++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2010-11-25 14:42:27 +0000 @@ -1387,6 +1387,10 @@ cmd: testNodeRestart args: -n Bug36245 T1 max-time: 300 +cmd: testNodeRestart +args: -n Bug58453 T1 + +max-time: 300 cmd: test_event args: -n Bug34853 T1 No bundle (reason: revision is a merge).