#At file:///net/atum17/export/home/tmp/jw159207/mysql/repo/push-scan-scan/ based on revid:ole.john.aske@stripped
3504 Jan Wedvik 2011-06-16 [merge]
Merged from mysql-5.1-telco-7.0.
modified:
mysql-test/suite/ndb/r/ndb_join_pushdown.result
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
storage/ndb/src/kernel/blocks/dbspj/DbspjMain.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/ndberror.c
=== modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_join_pushdown.result 2011-06-07 12:26:02 +0000
+++ b/mysql-test/suite/ndb/r/ndb_join_pushdown.result 2011-06-16 09:00:55 +0000
@@ -5174,7 +5174,7 @@ PRUNED_RANGE_SCANS_RECEIVED 21
RANGE_SCANS_RECEIVED 720
READS_NOT_FOUND 6616
READS_RECEIVED 52
-SCAN_ROWS_RETURNED 94353
+SCAN_ROWS_RETURNED 94389
TABLE_SCANS_RECEIVED 234
select sum(spj_counts_at_end.val - spj_counts_at_startup.val) as 'LOCAL+REMOTE READS_SENT'
from spj_counts_at_end, spj_counts_at_startup
=== 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/dbspj/DbspjMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-06-07 12:08:29 +0000
+++ b/storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp 2011-06-16 08:37:10 +0000
@@ -4418,7 +4418,7 @@ Dbspj::scanIndex_build(Build_context& ct
if (requestPtr.p->m_bits & Request::RT_REPEAT_SCAN_RESULT &&
!treeNodePtr.p->m_ancestors.contains(ctx.m_scans))
{
- nodePtr.p->m_bits |= TreeNode::T_SCAN_REPEATABLE;
+ treeNodePtr.p->m_bits |= TreeNode::T_SCAN_REPEATABLE;
}
ctx.m_scan_cnt++;
@@ -5025,6 +5025,8 @@ Dbspj::scanIndex_parent_batch_repeat(Sig
DEBUG("scanIndex_parent_batch_repeat(), m_node_no: " << treeNodePtr.p->m_node_no
<< ", m_batch_chunks: " << data.m_batch_chunks);
+
+ ndbassert(treeNodePtr.p->m_bits & TreeNode::T_SCAN_REPEATABLE);
/**
* Register index-scans to be restarted if we didn't get all
=== modified file 'storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2011-05-26 15:04:45 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2011-06-16 09:00:55 +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 07:47:53 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp 2011-06-15 10:55:06 +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-06-07 12:19:47 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-06-16 09:00:55 +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/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c 2011-06-15 10:40:26 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c 2011-06-16 09:00:55 +0000
@@ -317,6 +317,8 @@ 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" },
+ { 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" },
No bundle (reason: revision is a merge).
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(jan.wedvik:3504) | Jan Wedvik | 16 Jun |