4092 Martin Zaun 2011-02-18 [merge]
merge Jonas's (?) commits from 7.0 to 7.1
modified:
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
storage/ndb/include/ndb_constants.h
storage/ndb/include/ndbapi/NdbDictionary.hpp
storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/lgman.cpp
storage/ndb/src/ndbapi/NdbDictionary.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
4091 Magnus Blåudd 2011-02-16 [merge]
Merge 7.0 -> 7.1
modified:
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.h
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.h
=== modified file 'storage/ndb/include/kernel/signaldata/DictTabInfo.hpp'
--- a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp 2011-02-16 14:53:53 +0000
@@ -148,6 +148,8 @@ public:
HashMapObjectId = 153,
HashMapVersion = 154,
+ TableStorageType = 155,
+
TableEnd = 999,
AttributeName = 1000, // String, Mandatory
@@ -376,7 +378,9 @@ public:
Uint32 HashMapObjectId;
Uint32 HashMapVersion;
-
+
+ Uint32 TableStorageType;
+
Table() {}
void init();
};
=== modified file 'storage/ndb/include/ndb_constants.h'
--- a/storage/ndb/include/ndb_constants.h 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/ndb_constants.h 2011-02-16 14:53:53 +0000
@@ -87,6 +87,7 @@
#define NDB_STORAGETYPE_MEMORY 0
#define NDB_STORAGETYPE_DISK 1
+#define NDB_STORAGETYPE_DEFAULT 2 /* not set */
/*
* Table temporary status.
=== modified file 'storage/ndb/include/ndbapi/NdbDictionary.hpp'
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp 2011-02-10 18:47:43 +0000
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp 2011-02-18 19:43:58 +0000
@@ -287,7 +287,8 @@ public:
*/
enum StorageType {
StorageTypeMemory = NDB_STORAGETYPE_MEMORY,
- StorageTypeDisk = NDB_STORAGETYPE_DISK
+ StorageTypeDisk = NDB_STORAGETYPE_DISK,
+ StorageTypeDefault = NDB_STORAGETYPE_DEFAULT
};
/**
@@ -1054,6 +1055,12 @@ public:
* this as way way too much stuff is pushed into NdbDictInterface
*/
void assignObjId(const ObjectId &);
+
+ /**
+ * set/get table-storage-method
+ */
+ void setStorageType(Column::StorageType);
+ Column::StorageType getStorageType() const;
#endif
// these 2 are not de-doxygenated
=== modified file 'storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp 2011-02-16 14:53:53 +0000
@@ -72,6 +72,7 @@ DictTabInfo::TableMapping[] = {
DTIMAP(Table, SingleUserMode, SingleUserMode),
DTIMAP(Table, HashMapObjectId, HashMapObjectId),
DTIMAP(Table, HashMapVersion, HashMapVersion),
+ DTIMAP(Table, TableStorageType, TableStorageType),
DTIBREAK(AttributeName)
};
@@ -181,6 +182,8 @@ DictTabInfo::Table::init(){
HashMapObjectId = RNIL;
HashMapVersion = RNIL;
+
+ TableStorageType = NDB_STORAGETYPE_DEFAULT;
}
void
=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2011-02-15 10:52:32 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2011-02-16 14:53:53 +0000
@@ -744,6 +744,7 @@ Dbdict::packTableIntoPages(SimplePropert
w.add(DictTabInfo::MinRowsHigh, tablePtr.p->minRowsHigh);
w.add(DictTabInfo::SingleUserMode, tablePtr.p->singleUserMode);
w.add(DictTabInfo::HashMapObjectId, tablePtr.p->hashMapObjectId);
+ w.add(DictTabInfo::TableStorageType, tablePtr.p->storageType);
if (tablePtr.p->hashMapObjectId != RNIL)
{
@@ -2452,6 +2453,7 @@ void Dbdict::initialiseTableRecord(Table
tablePtr.p->triggerId = RNIL;
tablePtr.p->buildTriggerId = RNIL;
tablePtr.p->m_read_locked= 0;
+ tablePtr.p->storageType = NDB_STORAGETYPE_DEFAULT;
}//Dbdict::initialiseTableRecord()
void Dbdict::initTriggerRecords()
@@ -4941,6 +4943,7 @@ void Dbdict::handleTabInfoInit(Signal *
tablePtr.p->singleUserMode = c_tableDesc.SingleUserMode;
tablePtr.p->hashMapObjectId = c_tableDesc.HashMapObjectId;
tablePtr.p->hashMapVersion = c_tableDesc.HashMapVersion;
+ tablePtr.p->storageType = c_tableDesc.TableStorageType;
tabRequire(tablePtr.p->noOfAttributes <= MAX_ATTRIBUTES_IN_TABLE,
CreateTableRef::NoMoreAttributeRecords); // bad error code!
=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp 2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp 2011-02-16 14:53:53 +0000
@@ -330,6 +330,11 @@ public:
*/
Uint8 minLoadFactor;
+ /**
+ * Table default storage method
+ */
+ Uint8 storageType; // NDB_STORAGETYPE_
+
/* Convenience routines */
bool isTable() const;
bool isIndex() const;
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2011-02-16 08:21:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2011-02-18 19:43:58 +0000
@@ -1989,6 +1989,7 @@ void Dbdih::execREAD_NODESCONF(Signal* s
if (c_2pass_inr)
{
jam();
+ Uint32 workers = getNodeInfo(getOwnNodeId()).m_lqh_workers;
printf("Checking 2-pass initial node restart: ");
for (i = 0; i<index; i++)
{
@@ -1996,7 +1997,16 @@ void Dbdih::execREAD_NODESCONF(Signal* s
{
jam();
c_2pass_inr = false;
- printf("not ok (node %u) => disabled\n", nodeArray[i]);
+ printf("not ok (version node %u) => disabled\n", nodeArray[i]);
+ break;
+ }
+
+ if (workers > 1 &&
+ workers != getNodeInfo(nodeArray[i]).m_lqh_workers)
+ {
+ c_2pass_inr = false;
+ printf("not ok (different worker cnt node %u) => disabled\n",
+ nodeArray[i]);
break;
}
}
@@ -3778,7 +3788,7 @@ done:
req->fragId = takeOverPtr.p->toCurrentFragid;
req->noOfLogNodes = 0;
- if (c_2pass_inr)
+ if (c_2pass_inr && cstarttype == NodeState::ST_INITIAL_NODE_RESTART)
{
/**
* Check if we can make 2-phase copy
@@ -3829,7 +3839,7 @@ done:
takeOverPtr.p->toCurrentTabref,
takeOverPtr.p->toCurrentFragid,
req->lqhLogNode[0],
- req->lcpId);
+ takeOverPtr.p->startGci);
}
BlockReference ref = numberToRef(DBLQH, takeOverPtr.p->toStartingNode);
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-02-16 08:21:03 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-02-18 19:43:58 +0000
@@ -73,6 +73,7 @@
#include <signaldata/SignalDroppedRep.hpp>
#include <signaldata/FsReadWriteReq.hpp>
#include <signaldata/DbinfoScan.hpp>
+#include <signaldata/SystemError.hpp>
#include <NdbEnv.h>
#include "../suma/Suma.hpp"
@@ -7807,12 +7808,6 @@ void Dblqh::commitContinueAfterBlockedLa
EXECUTE_DIRECT(tup, GSN_TUP_COMMITREQ, signal,
TupCommitReq::SignalLength);
- if(signal->theData[0] != 0)
- {
- regTcPtr.p->transactionState = TcConnectionrec::WAIT_TUP_COMMIT;
- return; // TUP_COMMIT was timesliced
- }
-
if (TRACENR_FLAG)
{
TRACENR("COMMIT: ");
@@ -7833,9 +7828,18 @@ void Dblqh::commitContinueAfterBlockedLa
if (LqhKeyReq::getRowidFlag(regTcPtr.p->reqinfo))
TRACENR(" rowid: " << regTcPtr.p->m_row_id);
TRACENR(" key: " << getKeyInfoWordOrZero(regTcPtr.p, 0));
+
+ if (signal->theData[0] != 0)
+ TRACENR(" TIMESLICE");
TRACENR(endl);
}
+ if(signal->theData[0] != 0)
+ {
+ regTcPtr.p->transactionState = TcConnectionrec::WAIT_TUP_COMMIT;
+ return; // TUP_COMMIT was timesliced
+ }
+
TRACE_OP(regTcPtr.p, "ACC_COMMITREQ");
Uint32 acc = refToMain(regTcPtr.p->tcAccBlockref);
@@ -16495,7 +16499,6 @@ Dblqh::send_restore_lcp(Signal * signal)
sendSignal(ref, GSN_COPY_FRAGREQ, signal,
CopyFragReq::SignalLength, JBB);
-
}
}
@@ -16503,7 +16506,17 @@ void
Dblqh::execCOPY_FRAGREF(Signal* signal)
{
jamEntry();
- ndbrequire(false);
+
+ const CopyFragRef * ref = CAST_CONSTPTR(CopyFragRef, signal->getDataPtr());
+ Uint32 errorCode = ref->errorCode;
+
+ SystemError * sysErr = (SystemError*)&signal->theData[0];
+ sysErr->errorCode = SystemError::CopyFragRefError;
+ sysErr->errorRef = reference();
+ sysErr->data[0] = errorCode;
+ sysErr->data[1] = 0;
+ sendSignal(NDBCNTR_REF, GSN_SYSTEM_ERROR, signal,
+ SystemError::SignalLength, JBB);
}
void
@@ -16600,7 +16613,18 @@ void Dblqh::execRESTORE_LCP_CONF(Signal*
lcpPtr.i = 0;
ptrAss(lcpPtr, lcpRecord);
lcpPtr.p->m_outstanding = 1;
-
+
+ if (cstartType == NodeState::ST_INITIAL_NODE_RESTART)
+ {
+ jam();
+ /**
+ * Skip lgman undo...
+ */
+ signal->theData[0] = LGMAN_REF;
+ sendSignal(reference(), GSN_START_RECCONF, signal, 1, JBB);
+ return;
+ }
+
if (!isNdbMtLqh())
{
jam();
=== modified file 'storage/ndb/src/kernel/blocks/lgman.cpp'
--- a/storage/ndb/src/kernel/blocks/lgman.cpp 2011-02-15 08:46:20 +0000
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp 2011-02-17 15:51:08 +0000
@@ -595,7 +595,9 @@ Lgman::execCREATE_FILEGROUP_IMPL_REQ(Sig
m_logfile_group_hash.add(ptr);
m_logfile_group_list.add(ptr);
- if (getNodeState().getNodeRestartInProgress() ||
+ if ((getNodeState().getNodeRestartInProgress() &&
+ getNodeState().starting.restartType !=
+ NodeState::ST_INITIAL_NODE_RESTART)||
getNodeState().getSystemRestartInProgress())
{
ptr.p->m_state = Logfile_group::LG_STARTING;
=== modified file 'storage/ndb/src/ndbapi/NdbDictionary.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionary.cpp 2011-02-10 18:47:43 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionary.cpp 2011-02-18 19:43:58 +0000
@@ -1003,6 +1003,18 @@ NdbDictionary::Table::assignObjId(const
m_impl.m_version = objId.m_version;
}
+void
+NdbDictionary::Table::setStorageType(NdbDictionary::Column::StorageType type)
+{
+ m_impl.m_storageType = type;
+}
+
+NdbDictionary::Column::StorageType
+NdbDictionary::Table::getStorageType() const
+{
+ return (NdbDictionary::Column::StorageType)m_impl.m_storageType;
+}
+
/*****************************************************************
* Index facade
*/
=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2011-02-04 18:34:09 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2011-02-18 19:43:58 +0000
@@ -637,6 +637,7 @@ NdbTableImpl::init(){
m_single_user_mode = 0;
m_hash_map_id = RNIL;
m_hash_map_version = ~0;
+ m_storageType = NDB_STORAGETYPE_DEFAULT;
}
bool
@@ -921,6 +922,8 @@ NdbTableImpl::assign(const NdbTableImpl&
m_tablespace_name = org.m_tablespace_name;
m_tablespace_id= org.m_tablespace_id;
m_tablespace_version = org.m_tablespace_version;
+ m_storageType = org.m_storageType;
+
DBUG_RETURN(0);
}
@@ -2681,6 +2684,7 @@ NdbDictInterface::parseTableInfo(NdbTabl
impl->m_minLoadFactor = tableDesc->MinLoadFactor;
impl->m_maxLoadFactor = tableDesc->MaxLoadFactor;
impl->m_single_user_mode = tableDesc->SingleUserMode;
+ impl->m_storageType = tableDesc->TableStorageType;
impl->m_indexType = (NdbDictionary::Object::Type)
getApiConstant(tableDesc->TableType,
@@ -3393,6 +3397,7 @@ NdbDictInterface::serializeTableDesc(Ndb
tmpTab->HashMapObjectId = impl.m_hash_map_id;
tmpTab->HashMapVersion = impl.m_hash_map_version;
+ tmpTab->TableStorageType = impl.m_storageType;
const char *tablespace_name= impl.m_tablespace_name.c_str();
loop:
=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2011-02-03 14:45:49 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2011-02-18 19:43:58 +0000
@@ -233,6 +233,7 @@ public:
Uint16 m_keyLenInWords;
Uint16 m_fragmentCount;
Uint8 m_single_user_mode;
+ Uint8 m_storageType; // NDB_STORAGETYPE_MEMORY or _DISK or DEFAULT
NdbIndexImpl * m_index;
NdbColumnImpl * getColumn(unsigned attrId);
Attachment: [text/bzr-bundle] bzr/martin.zaun@oracle.com-20110218194358-4x84rrn9i2d1uay9.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.1 branch (martin.zaun:4091 to 4092) | Martin Zaun | 18 Feb |