4849 jonas oreland 2012-02-03
ndb - fix upgrade for lqh > 4
modified:
storage/ndb/include/ndb_version.h.in
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
4848 jonas oreland 2012-02-03
ndb - fix uninit variable, cause (maybe) huge allocations if running with older ndb_mgmd
modified:
storage/ndb/src/kernel/ndbd.cpp
4847 Jonas Oreland 2012-02-02
ndb - undeprecate TotalSendBufferMemory (as it now actually works in all places)
modified:
storage/ndb/src/mgmsrv/ConfigInfo.cpp
=== modified file 'storage/ndb/include/ndb_version.h.in'
--- a/storage/ndb/include/ndb_version.h.in 2011-11-14 12:02:56 +0000
+++ b/storage/ndb/include/ndb_version.h.in 2012-02-03 12:30:24 +0000
@@ -714,4 +714,27 @@ ndb_configurable_log_parts(Uint32 x)
}
return x >= NDBD_CONFIGURABLE_LOG_PARTS_72;
}
+
+#define NDBD_128_INSTANCES_ADDRESS_70 NDB_MAKE_VERSION(7,0,31)
+#define NDBD_128_INSTANCES_ADDRESS_71 NDB_MAKE_VERSION(7,1,20)
+#define NDBD_128_INSTANCES_ADDRESS_72 NDB_MAKE_VERSION(7,2,5)
+
+static
+inline
+int
+ndbd_128_instances_address(Uint32 x)
+{
+ const Uint32 major = (x >> 16) & 0xFF;
+ const Uint32 minor = (x >> 8) & 0xFF;
+
+ if (major == 7 && minor < 2)
+ {
+ if (minor == 0)
+ return x >= NDBD_128_INSTANCES_ADDRESS_70;
+ else if (minor == 1)
+ return x >= NDBD_128_INSTANCES_ADDRESS_71;
+ }
+ return x >= NDBD_128_INSTANCES_ADDRESS_72;
+}
+
#endif
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2012-01-11 13:16:31 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2012-02-03 12:30:24 +0000
@@ -1894,11 +1894,16 @@ private:
Uint32 dihGetInstanceKey(FragmentstorePtr tFragPtr) {
ndbrequire(!tFragPtr.isNull());
Uint32 log_part_id = tFragPtr.p->m_log_part_id;
- Uint32 instanceKey = 1 + log_part_id % MAX_NDBMT_LQH_WORKERS;
+ Uint32 instanceKey = 1 + (log_part_id % NDBMT_MAX_BLOCK_INSTANCES);
return instanceKey;
}
Uint32 dihGetInstanceKey(Uint32 tabId, Uint32 fragId);
+ /**
+ * Get minimum version of nodes in alive-list
+ */
+ Uint32 getMinVersion() const;
+
bool c_2pass_inr;
};
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2012-01-04 08:17:53 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2012-02-03 12:30:24 +0000
@@ -7710,7 +7710,7 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ
}
const Uint32 max = NGPtr.p->nodeCount;
- fragments[count++] = (NGPtr.p->m_next_log_part++ / cnoReplicas); // Store logpart first
+ fragments[count++] = (NGPtr.p->m_next_log_part++ / cnoReplicas) % globalData.ndbLogParts; // Store logpart first
Uint32 tmp= next_replica_node[NGPtr.i];
for(Uint32 replicaNo = 0; replicaNo < noOfReplicas; replicaNo++)
{
@@ -7811,7 +7811,7 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ
NDB_ARRAY_SIZE(fragments_per_node));
NGPtr.i = getNodeGroup(node);
ptrCheckGuard(NGPtr, MAX_NDB_NODES, nodeGroupRecord);
- fragments[count++] = NGPtr.p->m_next_log_part++;
+ fragments[count++] = (NGPtr.p->m_next_log_part++) % globalData.ndbLogParts;
fragments[count++] = node;
fragments_per_node[node]++;
for (Uint32 r = 0; r<noOfReplicas; r++)
@@ -16473,6 +16473,17 @@ void Dbdih::readFragment(RWFragment* rf,
fragPtr.p->distributionKey = TdistKey;
fragPtr.p->m_log_part_id = readPageWord(rf);
+ if (!ndbd_128_instances_address(getMinVersion()))
+ {
+ jam();
+ /**
+ * Limit log-part to 0-3 as older version didn't handle
+ * getting requests to instances > 4
+ * (in reality 7 i think...but that is useless as log-part dividor anyway)
+ */
+ fragPtr.p->m_log_part_id %= 4;
+ }
+
inc_ng_refcount(getNodeGroup(fragPtr.p->preferredPrimary));
}//Dbdih::readFragment()
@@ -19407,3 +19418,25 @@ error:
sendSignal(req->senderRef, GSN_DROP_NODEGROUP_IMPL_REF, signal,
DropNodegroupImplRef::SignalLength, JBB);
}
+
+Uint32
+Dbdih::getMinVersion() const
+{
+ Uint32 ver = getNodeInfo(getOwnNodeId()).m_version;
+ NodeRecordPtr specNodePtr;
+ specNodePtr.i = cfirstAliveNode;
+ do
+ {
+ jam();
+ ptrCheckGuard(specNodePtr, MAX_NDB_NODES, nodeRecord);
+ Uint32 v = getNodeInfo(specNodePtr.i).m_version;
+ if (v < ver)
+ {
+ jam();
+ ver = v;
+ }
+ specNodePtr.i = specNodePtr.p->nextNode;
+ } while (specNodePtr.i != RNIL);
+
+ return ver;
+}
=== modified file 'storage/ndb/src/kernel/ndbd.cpp'
--- a/storage/ndb/src/kernel/ndbd.cpp 2012-01-30 14:28:55 +0000
+++ b/storage/ndb/src/kernel/ndbd.cpp 2012-02-03 11:00:32 +0000
@@ -234,7 +234,7 @@ init_global_memory_manager(EmulatorData
* Add extra send buffer pages for NDB multithreaded case
*/
{
- Uint64 extra_mem;
+ Uint64 extra_mem = 0;
ndb_mgm_get_int64_parameter(p, CFG_EXTRA_SEND_BUFFER_MEMORY, &extra_mem);
Uint32 extra_mem_pages = Uint32((extra_mem + GLOBAL_PAGE_SIZE - 1) /
GLOBAL_PAGE_SIZE);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4847 to 4849) | jonas oreland | 3 Feb |