From: magnus.blaudd Date: June 15 2011 12:50pm Subject: bzr push into mysql-5.1-telco-7.1 branch (magnus.blaudd:4242 to 4243) List-Archive: http://lists.mysql.com/commits/139234 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4243 magnus.blaudd@stripped 2011-06-15 [merge] Merge 7.0 -> 7.1 modified: storage/ndb/include/mgmapi/mgmapi_config_parameters.h storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp storage/ndb/src/mgmsrv/ConfigInfo.cpp storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp storage/ndb/src/ndbapi/ndberror.c 4242 magnus.blaudd@stripped 2011-06-13 [merge] Merge 7.0 -> 7.1 modified: mysql-test/suite/ndb_rpl/my.cnf mysql-test/suite/ndb_rpl/t/ndb_rpl_break_3_chain.cnf mysql-test/suite/ndb_rpl/t/ndb_rpl_multi_binlog_update.cnf mysql-test/suite/ndb_team/my.cnf mysql-test/suite/rpl_ndb/my.cnf sql/ha_ndbcluster.cc sql/sql_class.cc sql/sql_class.h storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp storage/ndb/src/kernel/vm/NdbSeqLock.hpp storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp storage/ndb/test/ndbapi/testSystemRestart.cpp storage/ndb/test/run-test/autotest-boot.sh storage/ndb/test/src/NdbBackup.cpp === modified file 'storage/ndb/include/mgmapi/mgmapi_config_parameters.h' --- a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2011-05-31 08:28:58 +0000 +++ b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2011-06-15 10:55:06 +0000 @@ -194,6 +194,8 @@ #define CFG_DB_INDEX_STAT_TRIGGER_SCALE 625 #define CFG_DB_INDEX_STAT_UPDATE_DELAY 626 +#define CFG_DB_MAX_DML_OPERATIONS_PER_TRANSACTION 627 + #define CFG_NODE_ARBIT_RANK 200 #define CFG_NODE_ARBIT_DELAY 201 #define CFG_RESERVED_SEND_BUFFER_MEMORY 202 === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-06-13 06:14:56 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-06-15 12:49:14 +0000 @@ -18955,6 +18955,30 @@ stepNext_2: { jam(); logPartPtr.p->invalidatePageNo = logPartPtr.p->headPageNo; + + if (! ((cstartType == NodeState::ST_INITIAL_START) || + (cstartType == NodeState::ST_INITIAL_NODE_RESTART))) + { + jam(); + if (logFilePtr.i == logPartPtr.p->lastLogfile) + { + jam(); + Uint32 lastMbytePageNo = + logPartPtr.p->lastMbyte << ZTWOLOG_NO_PAGES_IN_MBYTE; + if (logPartPtr.p->invalidatePageNo < lastMbytePageNo) + { + jam(); + if (DEBUG_REDO) + { + ndbout_c("readFileInInvalidate part: %u step: %u moving invalidatePageNo from %u to %u (lastMbyte)", + logPartPtr.p->logPartNo, stepNext, + logPartPtr.p->invalidatePageNo, + lastMbytePageNo); + } + logPartPtr.p->invalidatePageNo = lastMbytePageNo; + } + } + } readFileInInvalidate(signal, 1); return; } === modified file 'storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp' --- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2011-05-26 12:42:11 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2011-06-15 12:49:14 +0000 @@ -140,6 +140,7 @@ #define ZUNLOCKED_IVAL_TOO_HIGH 294 #define ZUNLOCKED_OP_HAS_BAD_STATE 295 #define ZBAD_DIST_KEY 298 +#define ZTRANS_TOO_BIG 261 #endif class Dbtc: public SimulatedBlock { @@ -722,6 +723,7 @@ public: }; Uint32 no_commit_ack_markers; + Uint32 m_write_count; ReturnSignal returnsignal; AbortState abortState; @@ -2102,6 +2104,7 @@ private: Uint32 c_lastFailedApi; #endif Uint32 m_deferred_enabled; + Uint32 m_max_writes_per_trans; }; #endif === modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp' --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp 2011-04-28 09:42:34 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp 2011-06-15 12:49:14 +0000 @@ -338,6 +338,7 @@ Dbtc::Dbtc(Block_context& ctx, Uint32 in c_apiConTimer_line = 0; csystemStart = SSS_FALSE; m_deferred_enabled = ~Uint32(0); + m_max_writes_per_trans = ~Uint32(0); }//Dbtc::Dbtc() Dbtc::~Dbtc() === modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp' --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-05-31 13:02:43 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-06-15 12:49:14 +0000 @@ -685,6 +685,10 @@ void Dbtc::execREAD_CONFIG_REQ(Signal* s //ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_TRANSACTION_TAKEOVER, &val); set_no_parallel_takeover(val); + val = ~(Uint32)0; + ndb_mgm_get_int_parameter(p, CFG_DB_MAX_DML_OPERATIONS_PER_TRANSACTION, &val); + m_max_writes_per_trans = val; + ctimeOutCheckDelay = 50; // 500ms }//Dbtc::execSIZEALT_REP() @@ -1857,6 +1861,13 @@ start_failure: abortErrorLab(signal); return; } + case 65: + { + jam(); + terrorCode = ZTRANS_TOO_BIG; + abortErrorLab(signal); + return; + } default: jam(); systemErrorLab(signal, __LINE__); @@ -2398,6 +2409,8 @@ void Dbtc::initApiConnectRec(Signal* sig #ifdef ERROR_INSERT regApiPtr->continueBCount = 0; #endif + + regApiPtr->m_write_count = 0; }//Dbtc::initApiConnectRec() int @@ -3068,6 +3081,11 @@ void Dbtc::execTCKEYREQ(Signal* signal) case ZWRITE: case ZREFRESH: jam(); + if (unlikely((++ regApiPtr->m_write_count) > m_max_writes_per_trans)) + { + TCKEY_abort(signal, 65); + return; + } break; default: TCKEY_abort(signal, 9); === modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp' --- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2011-05-19 09:16:32 +0000 +++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2011-06-15 10:55:06 +0000 @@ -36,6 +36,7 @@ #define KEY_INTERNAL 0 #define MAX_INT_RNIL 0xfffffeff +#define MAX_INT32 0xffffffff #define MAX_PORT_NO 65535 #define _STR_VALUE(x) #x @@ -771,6 +772,19 @@ const ConfigInfo::ParamInfo ConfigInfo:: STR_VALUE(MAX_INT_RNIL) }, { + CFG_DB_MAX_DML_OPERATIONS_PER_TRANSACTION, + "MaxDMLOperationsPerTransaction", + DB_TOKEN, + "Max DML-operations in one transaction (0 == no limit)", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + STR_VALUE(MAX_INT32), + "32", + STR_VALUE(MAX_INT32) + }, + + { CFG_DB_NO_LOCAL_OPS, "MaxNoOfLocalOperations", DB_TOKEN, === modified file 'storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp' --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp 2011-05-25 14:35:46 +0000 +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp 2011-06-15 12:49:14 +0000 @@ -596,6 +596,7 @@ NdbEventOperationImpl::execute_nolock() { switch(myDict->getNdbError().code){ case 711: + case 763: // ignore; break; default: === modified file 'storage/ndb/src/ndbapi/ndberror.c' --- a/storage/ndb/src/ndbapi/ndberror.c 2011-06-06 12:18:27 +0000 +++ b/storage/ndb/src/ndbapi/ndberror.c 2011-06-15 10:55:06 +0000 @@ -317,7 +317,9 @@ ErrorBundle ErrorCodes[] = { */ { 281, HA_ERR_NO_CONNECTION, AE, "Operation not allowed due to cluster shutdown in progress" }, { 299, DMEC, AE, "Operation not allowed or aborted due to single user mode" }, - { 763, DMEC, AE, "Alter table requires cluster nodes to have exact same version" }, + { 261, DMEC, AE, + "DML count in transaction exceeds config parameter MaxDMLOperationsPerTransaction" }, + { 763, DMEC, AE, "DDL is not supported with mixed data-node versions" }, { 823, DMEC, AE, "Too much attrinfo from application in tuple manager" }, { 829, DMEC, AE, "Corrupt data received for insert/update" }, { 831, DMEC, AE, "Too many nullable/bitfields in table definition" }, No bundle (reason: useless for push emails).