Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-12-22 00:15:13+01:00, jonas@stripped +6 -0
merge
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-12-22 00:15:10+01:00, jonas@stripped +21 -300
merge
storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp@stripped, 2007-12-22 00:15:10+01:00, jonas@stripped +4 -4
merge
storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2007-12-22 00:15:10+01:00, jonas@stripped +68 -80
merge
storage/ndb/src/kernel/blocks/suma/Suma.hpp@stripped, 2007-12-22 00:15:10+01:00, jonas@stripped +1 -2
merge
storage/ndb/src/kernel/vm/LockQueue.cpp@stripped, 2007-12-22 00:15:10+01:00, jonas@stripped +31 -25
merge
storage/ndb/src/kernel/vm/LockQueue.hpp@stripped, 2007-12-22 00:15:10+01:00, jonas@stripped +6 -3
merge
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-12-21 21:44:09 +01:00
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-12-22 00:15:10 +01:00
@@ -3740,7 +3740,7 @@ void Dbdict::execNODE_FAILREP(Signal* si
lockReq.lockId = 0;
lockReq.requestInfo = UtilLockReq::SharedLock;
lockReq.extra = DictLockReq::NodeFailureLock;
- m_dict_lock.lock(m_dict_lock_pool, &lockReq, 0);
+ m_dict_lock.lock(this, m_dict_lock_pool, &lockReq, 0);
}
}
@@ -4035,80 +4035,6 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
// Get table definition
TableRecordPtr tablePtr;
c_tableRecordPool.getPtr(tablePtr, tableId, false);
-<<<<<<< gca storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.2.1
- if(tablePtr.isNull()){
- jam();
- alterTableRef(signal, req, AlterTableRef::NoSuchTable);
- return;
- }
-
- if(getOwnNodeId() != c_masterNodeId){
- jam();
- alterTableRef(signal, req, AlterTableRef::NotMaster);
- return;
- }
-
- if(c_blockState == BS_NODE_RESTART){
- jam();
- alterTableRef(signal, req, AlterTableRef::BusyWithNR);
- return;
- }
-
- if(c_blockState != BS_IDLE){
- jam();
- alterTableRef(signal, req, AlterTableRef::Busy);
- return;
- }
-
- if (!check_ndb_versions())
- {
- jam();
- alterTableRef(signal, req, AlterTableRef::IncompatibleVersions);
- return;
- }
-
- if (checkSingleUserMode(signal->getSendersBlockRef()))
- {
- jam();
- alterTableRef(signal, req, AlterTableRef::SingleUser);
- return;
- }
-
- const TableRecord::TabState tabState = tablePtr.p->tabState;
- bool ok = false;
- switch(tabState){
- case TableRecord::NOT_DEFINED:
- case TableRecord::REORG_TABLE_PREPARED:
- case TableRecord::DEFINING:
- case TableRecord::CHECKED:
- jam();
- alterTableRef(signal, req, AlterTableRef::NoSuchTable);
- return;
- case TableRecord::DEFINED:
- ok = true;
- jam();
- break;
- case TableRecord::BACKUP_ONGOING:
- jam();
- alterTableRef(signal, req, AlterTableRef::BackupInProgress);
- return;
- case TableRecord::PREPARE_DROPPING:
- case TableRecord::DROPPING:
- jam();
- alterTableRef(signal, req, AlterTableRef::DropInProgress);
- return;
- }
- ndbrequire(ok);
-
- if(tablePtr.p->tableVersion != tableVersion){
- jam();
- alterTableRef(signal, req, AlterTableRef::InvalidTableVersion);
- return;
- }
- // Parse new table defintion
- ParseDictTabInfoRecord parseRecord;
- aParseRecord = &parseRecord;
-<<<<<<< local storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.149
do {
if(tablePtr.isNull())
@@ -4125,20 +4051,6 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
break;
}
- if(c_blockState == BS_NODE_RESTART)
- {
- jam();
- aParseRecord.errorCode = AlterTableRef::BusyWithNR;
- break;
- }
-
- if(c_blockState != BS_IDLE)
- {
- jam();
- aParseRecord.errorCode = AlterTableRef::Busy;
- break;
- }
-
if (!check_ndb_versions())
{
jam();
@@ -4194,69 +4106,6 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
CreateTableRecordPtr alterTabPtr; // Reuse create table records
c_opCreateTable.seize(alterTabPtr);
-<<<<<<< remote storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.1.3
- if(tablePtr.isNull()){
- jam();
- alterTableRef(signal, req, AlterTableRef::NoSuchTable);
- return;
- }
-
- if(getOwnNodeId() != c_masterNodeId){
- jam();
- alterTableRef(signal, req, AlterTableRef::NotMaster);
- return;
- }
-
- if (!check_ndb_versions())
- {
- jam();
- alterTableRef(signal, req, AlterTableRef::IncompatibleVersions);
- return;
- }
-
- if (checkSingleUserMode(signal->getSendersBlockRef()))
- {
- jam();
- alterTableRef(signal, req, AlterTableRef::SingleUser);
- return;
- }
-
- const TableRecord::TabState tabState = tablePtr.p->tabState;
- bool ok = false;
- switch(tabState){
- case TableRecord::NOT_DEFINED:
- case TableRecord::REORG_TABLE_PREPARED:
- case TableRecord::DEFINING:
- case TableRecord::CHECKED:
- jam();
- alterTableRef(signal, req, AlterTableRef::NoSuchTable);
- return;
- case TableRecord::DEFINED:
- ok = true;
- jam();
- break;
- case TableRecord::BACKUP_ONGOING:
- jam();
- alterTableRef(signal, req, AlterTableRef::BackupInProgress);
- return;
- case TableRecord::PREPARE_DROPPING:
- case TableRecord::DROPPING:
- jam();
- alterTableRef(signal, req, AlterTableRef::DropInProgress);
- return;
- }
- ndbrequire(ok);
-
- if(tablePtr.p->tableVersion != tableVersion){
- jam();
- alterTableRef(signal, req, AlterTableRef::InvalidTableVersion);
- return;
- }
- // Parse new table defintion
- ParseDictTabInfoRecord parseRecord;
- aParseRecord = &parseRecord;
->>>>>>>
-
if(alterTabPtr.isNull())
{
jam();
@@ -4264,101 +4113,32 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
break;
}
-<<<<<<< gca storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.2.1
- alterTabPtr.p->m_changeMask = changeMask;
- parseRecord.requestType = DictTabInfo::AlterTableFromAPI;
- parseRecord.errorCode = 0;
-<<<<<<< local storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.149
- alterTabPtr.p->m_changeMask = changeMask;
- aParseRecord.requestType = DictTabInfo::AlterTableFromAPI;
-<<<<<<< remote storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.1.3
- DictLockReq lockReq;
- lockReq.userPtr = alterTabPtr.i;
- lockReq.userRef = reference();
- lockReq.lockType = DictLockReq::AlterTableLock;
- parseRecord.errorCode = dict_lock_trylock(&lockReq);
- if (parseRecord.errorCode)
- {
- jam();
- c_opCreateTable.release(alterTabPtr);
- alterTableRef(signal, req,
- (AlterTableRef::ErrorCode) parseRecord.errorCode);
- return;
- }
-
- alterTabPtr.p->m_changeMask = changeMask;
- parseRecord.requestType = DictTabInfo::AlterTableFromAPI;
- parseRecord.errorCode = 0;
->>>>>>>
+ DictLockReq lockReq;
+ lockReq.userPtr = alterTabPtr.i;
+ lockReq.userRef = reference();
+ lockReq.lockType = DictLockReq::AlterTableLock;
+ aParseRecord.errorCode = dict_lock_trylock(&lockReq);
+ if (aParseRecord.errorCode)
+ {
+ jam();
+ c_opCreateTable.release(alterTabPtr);
+ break;
+ }
SegmentedSectionPtr ptr;
handle.getSection(ptr, AlterTableReq::DICT_TAB_INFO);
SimplePropertiesSectionReader r(ptr, getSectionSegmentPool());
+ aParseRecord.requestType = DictTabInfo::AlterTableFromAPI;
handleTabInfoInit(r, &aParseRecord, false); // Will not save info
-
-<<<<<<< gca storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.2.1
- if(parseRecord.errorCode != 0){
- jam();
- c_opCreateTable.release(alterTabPtr);
- alterTableRef(signal, req,
- (AlterTableRef::ErrorCode) parseRecord.errorCode,
- aParseRecord);
- return;
- }
-<<<<<<< local storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.149
+
if(aParseRecord.errorCode != 0)
{
jam();
+ dict_lock_unlock(0, &lockReq);
c_opCreateTable.release(alterTabPtr);
break;
}
-<<<<<<< remote storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.1.3
- if(parseRecord.errorCode != 0){
- jam();
- dict_lock_unlock(0, &lockReq);
- c_opCreateTable.release(alterTabPtr);
- alterTableRef(signal, req,
- (AlterTableRef::ErrorCode) parseRecord.errorCode,
- aParseRecord);
- return;
- }
->>>>>>>
-
-<<<<<<< gca storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.2.1
- releaseSections(signal);
- alterTabPtr.p->key = ++c_opRecordSequence;
- c_opCreateTable.add(alterTabPtr);
- ndbrequire(c_opCreateTable.find(alterTabPtr, alterTabPtr.p->key));
- alterTabPtr.p->m_errorCode = 0;
- alterTabPtr.p->m_senderRef = senderRef;
- alterTabPtr.p->m_senderData = senderData;
- alterTabPtr.p->m_tablePtrI = parseRecord.tablePtr.i;
- alterTabPtr.p->m_alterTableFailed = false;
- alterTabPtr.p->m_coordinatorRef = reference();
- alterTabPtr.p->m_tupAlterTabPtr= RNIL;
- alterTabPtr.p->m_fragmentsPtrI = RNIL;
- alterTabPtr.p->m_dihAddFragPtr = RNIL;
- alterTabPtr.p->m_alterTableId = tablePtr.p->tableId;
-
- // Send prepare request to all alive nodes
- SimplePropertiesSectionWriter w(getSectionSegmentPool());
- packTableIntoPages(w, parseRecord.tablePtr);
-
- SegmentedSectionPtr tabInfoPtr;
- w.getPtr(tabInfoPtr);
-
- alterTabPtr.p->m_tabInfoPtrI = tabInfoPtr.i;
-
- // Alter table on all nodes
- c_blockState = BS_BUSY;
-
- Mutex mutex(signal, c_mutexMgr, alterTabPtr.p->m_startLcpMutex);
- Callback c = { safe_cast(&Dbdict::alterTable_backup_mutex_locked),
- alterTabPtr.p->key };
-
- ndbrequire(mutex.lock(c));
-<<<<<<< local storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.149
releaseSections(handle);
alterTabPtr.p->key = ++c_opRecordSequence;
@@ -4374,6 +4154,7 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
alterTabPtr.p->m_fragmentsPtrI = RNIL;
alterTabPtr.p->m_dihAddFragPtr = RNIL;
alterTabPtr.p->m_alterTableId = tablePtr.p->tableId;
+ alterTabPtr.p->m_changeMask = changeMask;
// Send prepare request to all alive nodes
SimplePropertiesSectionWriter w(getSectionSegmentPool());
@@ -4384,9 +4165,6 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
alterTabPtr.p->m_tabInfoPtrI = tabInfoPtr.i;
- // Alter table on all nodes
- c_blockState = BS_BUSY;
-
Mutex mutex(signal, c_mutexMgr, alterTabPtr.p->m_startLcpMutex);
Callback c = { safe_cast(&Dbdict::alterTable_backup_mutex_locked),
alterTabPtr.p->key };
@@ -4408,37 +4186,6 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
ref->status = aParseRecord.status;
sendSignal(senderRef, GSN_ALTER_TABLE_REF, signal,
AlterTableRef::SignalLength, JBB);
-<<<<<<< remote storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.1.3
- releaseSections(signal);
- alterTabPtr.p->key = ++c_opRecordSequence;
- c_opCreateTable.add(alterTabPtr);
- ndbrequire(c_opCreateTable.find(alterTabPtr, alterTabPtr.p->key));
- alterTabPtr.p->m_errorCode = 0;
- alterTabPtr.p->m_senderRef = senderRef;
- alterTabPtr.p->m_senderData = senderData;
- alterTabPtr.p->m_tablePtrI = parseRecord.tablePtr.i;
- alterTabPtr.p->m_alterTableFailed = false;
- alterTabPtr.p->m_coordinatorRef = reference();
- alterTabPtr.p->m_tupAlterTabPtr= RNIL;
- alterTabPtr.p->m_fragmentsPtrI = RNIL;
- alterTabPtr.p->m_dihAddFragPtr = RNIL;
- alterTabPtr.p->m_alterTableId = tablePtr.p->tableId;
-
- // Send prepare request to all alive nodes
- SimplePropertiesSectionWriter w(getSectionSegmentPool());
- packTableIntoPages(w, parseRecord.tablePtr);
-
- SegmentedSectionPtr tabInfoPtr;
- w.getPtr(tabInfoPtr);
-
- alterTabPtr.p->m_tabInfoPtrI = tabInfoPtr.i;
-
- Mutex mutex(signal, c_mutexMgr, alterTabPtr.p->m_startLcpMutex);
- Callback c = { safe_cast(&Dbdict::alterTable_backup_mutex_locked),
- alterTabPtr.p->key };
-
- ndbrequire(mutex.lock(c));
->>>>>>>
}
void
@@ -4487,14 +4234,7 @@ Dbdict::alterTable_backup_mutex_locked(S
dict_lock_unlock(signal, &lockReq);
c_opCreateTable.release(alterTabPtr);
-<<<<<<< gca storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.2.1
- c_blockState = BS_IDLE;
-<<<<<<< local storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.149
- c_blockState = BS_IDLE;
releaseSections(handle);
-<<<<<<< remote storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.1.3
-
->>>>>>>
return;
}
@@ -4781,14 +4521,6 @@ Dbdict::execALTER_TAB_REQ(Signal * signa
sendSignal(senderRef, GSN_ALTER_TAB_REF, signal,
AlterTabRef::SignalLength, JBB);
-<<<<<<< gca storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.2.1
-
- c_blockState = BS_IDLE;
-<<<<<<< local storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.149
-
- c_blockState = BS_IDLE;
-<<<<<<< remote storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 1.144.1.3
->>>>>>>
}
@@ -10692,17 +10424,6 @@ void Dbdict::execSUB_START_REQ(Signal* s
OpSubEventPtr subbPtr;
Uint32 errCode = 0;
- LockQueue::Iterator iter;
- if (m_dict_lock.first(m_dict_lock_pool, iter))
- {
- if (iter.m_curr.p->m_req.extra == DictLockReq::NodeRestartLock)
- {
- jam();
- errCode = 1405;
- goto busy;
- }
- }
-
if (!c_opSubEvent.seize(subbPtr)) {
errCode = SubStartRef::Busy;
busy:
@@ -14384,7 +14105,7 @@ Dbdict::execDICT_LOCK_REQ(Signal* signal
goto ref;
}
- res = m_dict_lock.lock(m_dict_lock_pool, &lockReq, 0);
+ res = m_dict_lock.lock(this, m_dict_lock_pool, &lockReq, 0);
switch(res){
case 0:
jam();
@@ -14471,7 +14192,7 @@ void
Dbdict::removeStaleDictLocks(Signal* signal, const Uint32* theFailedNodes)
{
LockQueue::Iterator iter;
- if (m_dict_lock.first(m_dict_lock_pool, iter))
+ if (m_dict_lock.first(this, m_dict_lock_pool, iter))
{
do {
if (NodeBitmask::get(theFailedNodes,
@@ -14511,7 +14232,7 @@ Dbdict::dict_lock_trylock(const DictLock
req.extra = _req->lockType;
req.requestInfo = UtilLockReq::TryLock | UtilLockReq::Notify;
- Uint32 res = m_dict_lock.lock(m_dict_lock_pool, &req, &lockOwner);
+ Uint32 res = m_dict_lock.lock(this, m_dict_lock_pool, &req, &lockOwner);
switch(res){
case UtilLockRef::OK:
jam();
@@ -14546,7 +14267,7 @@ Dbdict::dict_lock_unlock(Signal* signal,
req.senderData = _req->userPtr;
req.senderRef = _req->userRef;
- Uint32 res = m_dict_lock.unlock(m_dict_lock_pool, &req);
+ Uint32 res = m_dict_lock.unlock(this, m_dict_lock_pool, &req);
switch(res){
case UtilUnlockRef::OK:
case UtilUnlockRef::NotLockOwner:
@@ -14558,7 +14279,7 @@ Dbdict::dict_lock_unlock(Signal* signal,
UtilLockReq lockReq;
LockQueue::Iterator iter;
- if (m_dict_lock.first(m_dict_lock_pool, iter))
+ if (m_dict_lock.first(this, m_dict_lock_pool, iter))
{
int res;
while ((res = m_dict_lock.checkLockGrant(iter, &lockReq)) > 0)
diff -Nrup a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp 2007-12-21 21:36:30 +01:00
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp 2007-12-22 00:15:10 +01:00
@@ -2409,7 +2409,7 @@ DbUtil::execUTIL_LOCK_REQ(Signal * signa
return;
}
- Uint32 res = lockQPtr.p->m_queue.lock(c_lockElementPool, &req);
+ Uint32 res = lockQPtr.p->m_queue.lock(this, c_lockElementPool, &req);
switch(res){
case UtilLockRef::OK:
jam();
@@ -2455,7 +2455,7 @@ DbUtil::execUTIL_UNLOCK_REQ(Signal* sign
return;
}
- Uint32 res = lockQPtr.p->m_queue.unlock(c_lockElementPool, &req);
+ Uint32 res = lockQPtr.p->m_queue.unlock(this, c_lockElementPool, &req);
switch(res){
case UtilUnlockRef::OK:
jam();
@@ -2483,7 +2483,7 @@ DbUtil::execUTIL_UNLOCK_REQ(Signal* sign
*/
UtilLockReq lockReq;
LockQueue::Iterator iter;
- if (lockQPtr.p->m_queue.first(c_lockElementPool, iter))
+ if (lockQPtr.p->m_queue.first(this, c_lockElementPool, iter))
{
int res;
while ((res = lockQPtr.p->m_queue.checkLockGrant(iter, &lockReq)) > 0)
@@ -2623,7 +2623,7 @@ DbUtil::execUTIL_DESTORY_LOCK_REQ(Signal
}
LockQueue::Iterator iter;
- if (lockQPtr.p->m_queue.first(c_lockElementPool, iter) == false)
+ if (lockQPtr.p->m_queue.first(this, c_lockElementPool, iter) == false)
{
jam();
err = UtilDestroyLockRef::NotLockOwner;
diff -Nrup a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2007-12-21 21:44:09 +01:00
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2007-12-22 00:15:10 +01:00
@@ -91,85 +91,6 @@ static const Uint32 MAX_CONCURRENT_GCP =
#define PRINT_ONLY 0
-void
-Suma::getNodeGroupMembers(Signal* signal, Uint32 typeOfStart)
-{
- jam();
- DBUG_ENTER("Suma::getNodeGroupMembers");
- /**
- * Ask DIH for nodeGroupMembers
- */
- CheckNodeGroups * sd = (CheckNodeGroups*)signal->getDataPtrSend();
- sd->blockRef = reference();
- sd->requestType = CheckNodeGroups::GetNodeGroupMembers;
- sd->nodeId = getOwnNodeId();
- sd->senderData = typeOfStart;
- sendSignal(DBDIH_REF, GSN_CHECKNODEGROUPSREQ, signal,
- CheckNodeGroups::SignalLength, JBB);
- DBUG_VOID_RETURN;
-}
-
-void
-Suma::execCHECKNODEGROUPSCONF(Signal *signal)
-{
- const CheckNodeGroups *sd = (const CheckNodeGroups *)signal->getDataPtrSend();
- DBUG_ENTER("Suma::execCHECKNODEGROUPSCONF");
- jamEntry();
- Uint32 typeOfStart = sd->senderData;
- c_nodeGroup = sd->output;
- c_nodes_in_nodegroup_mask.assign(sd->mask);
- c_noNodesInGroup = c_nodes_in_nodegroup_mask.count();
- Uint32 i, pos= 0;
-
- for (i = 0; i < MAX_NDB_NODES; i++) {
- if (sd->mask.get(i))
- {
- c_nodesInGroup[pos++] = i;
- }
- }
-
- const Uint32 replicas= c_noNodesInGroup;
-
- Uint32 buckets= 1;
- for(i = 1; i <= replicas; i++)
- buckets *= i;
-
- for(i = 0; i<buckets; i++)
- {
- Bucket* ptr= c_buckets+i;
- for(Uint32 j= 0; j< replicas; j++)
- {
- ptr->m_nodes[j] = c_nodesInGroup[(i + j) % replicas];
- }
- }
-
- c_no_of_buckets= buckets;
- ndbrequire(c_noNodesInGroup > 0); // at least 1 node in the nodegroup
-
-#ifndef DBUG_OFF
- for (Uint32 i = 0; i < c_noNodesInGroup; i++) {
- DBUG_PRINT("exit",("Suma: NodeGroup %u, me %u, "
- "member[%u] %u",
- c_nodeGroup, getOwnNodeId(),
- i, c_nodesInGroup[i]));
- }
-#endif
-
- if (typeOfStart == NodeState::ST_NODE_RESTART ||
- typeOfStart == NodeState::ST_INITIAL_NODE_RESTART)
- {
- jam();
- send_start_me_req(signal);
- }
- else
- {
- jam();
- sendSTTORRY(signal);
- }
-
- DBUG_VOID_RETURN;
-}
-
void
Suma::execREAD_CONFIG_REQ(Signal* signal)
{
@@ -475,8 +396,73 @@ Suma::execREAD_NODESCONF(Signal* signal)
c_masterNodeId = conf->masterNodeId;
- c_startup.m_restart_server_node_id = 0;
getNodeGroupMembers(signal);
+}
+
+void
+Suma::getNodeGroupMembers(Signal* signal)
+{
+ jam();
+ DBUG_ENTER("Suma::getNodeGroupMembers");
+ /**
+ * Ask DIH for nodeGroupMembers
+ */
+ CheckNodeGroups * sd = (CheckNodeGroups*)signal->getDataPtrSend();
+ sd->blockRef = reference();
+ sd->requestType = CheckNodeGroups::GetNodeGroupMembers;
+ sd->nodeId = getOwnNodeId();
+ sd->senderData = RNIL;
+ sendSignal(DBDIH_REF, GSN_CHECKNODEGROUPSREQ, signal,
+ CheckNodeGroups::SignalLength, JBB);
+ DBUG_VOID_RETURN;
+}
+
+void
+Suma::execCHECKNODEGROUPSCONF(Signal *signal)
+{
+ const CheckNodeGroups *sd = (const CheckNodeGroups *)signal->getDataPtrSend();
+ DBUG_ENTER("Suma::execCHECKNODEGROUPSCONF");
+ jamEntry();
+ c_nodeGroup = sd->output;
+ c_nodes_in_nodegroup_mask.assign(sd->mask);
+ c_noNodesInGroup = c_nodes_in_nodegroup_mask.count();
+ Uint32 i, pos= 0;
+
+ for (i = 0; i < MAX_NDB_NODES; i++) {
+ if (sd->mask.get(i))
+ {
+ c_nodesInGroup[pos++] = i;
+ }
+ }
+
+ const Uint32 replicas= c_noNodesInGroup;
+
+ Uint32 buckets= 1;
+ for(i = 1; i <= replicas; i++)
+ buckets *= i;
+
+ for(i = 0; i<buckets; i++)
+ {
+ Bucket* ptr= c_buckets+i;
+ for(Uint32 j= 0; j< replicas; j++)
+ {
+ ptr->m_nodes[j] = c_nodesInGroup[(i + j) % replicas];
+ }
+ }
+
+ c_no_of_buckets= buckets;
+ ndbrequire(c_noNodesInGroup > 0); // at least 1 node in the nodegroup
+
+#ifndef DBUG_OFF
+ for (Uint32 i = 0; i < c_noNodesInGroup; i++) {
+ DBUG_PRINT("exit",("Suma: NodeGroup %u, me %u, "
+ "member[%u] %u",
+ c_nodeGroup, getOwnNodeId(),
+ i, c_nodesInGroup[i]));
+ }
+#endif
+
+ c_startup.m_restart_server_node_id = 0;
if (m_typeOfStart == NodeState::ST_NODE_RESTART ||
m_typeOfStart == NodeState::ST_INITIAL_NODE_RESTART)
{
@@ -487,6 +473,8 @@ Suma::execREAD_NODESCONF(Signal* signal)
}
sendSTTORRY(signal);
+
+ DBUG_VOID_RETURN;
}
void
diff -Nrup a/storage/ndb/src/kernel/blocks/suma/Suma.hpp b/storage/ndb/src/kernel/blocks/suma/Suma.hpp
--- a/storage/ndb/src/kernel/blocks/suma/Suma.hpp 2007-12-21 21:44:09 +01:00
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp 2007-12-22 00:15:10 +01:00
@@ -406,8 +406,7 @@ public:
* Framework signals
*/
- void getNodeGroupMembers(Signal* signal, Uint32 typeOfStart);
-
+ void getNodeGroupMembers(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal);
diff -Nrup a/storage/ndb/src/kernel/vm/LockQueue.cpp b/storage/ndb/src/kernel/vm/LockQueue.cpp
--- a/storage/ndb/src/kernel/vm/LockQueue.cpp 2007-11-13 09:34:35 +01:00
+++ b/storage/ndb/src/kernel/vm/LockQueue.cpp 2007-12-22 00:15:10 +01:00
@@ -15,9 +15,11 @@
#include "LockQueue.hpp"
+#include "SimulatedBlock.hpp"
Uint32
-LockQueue::lock(Pool & thePool,
+LockQueue::lock(SimulatedBlock* block,
+ Pool & thePool,
const UtilLockReq* req, const UtilLockReq** lockOwner)
{
const bool exclusive = ! (req->requestInfo & UtilLockReq::SharedLock);
@@ -30,35 +32,35 @@ LockQueue::lock(Pool & thePool,
Ptr<LockQueueElement> lockEPtr;
if (queue.last(lockEPtr))
{
- jam();
+ jamBlock(block);
if (! (lockEPtr.p->m_req.requestInfo & UtilLockReq::SharedLock))
{
- jam();
+ jamBlock(block);
grant = false;
}
else if (exclusive)
{
- jam();
+ jamBlock(block);
grant = false;
}
else if (lockEPtr.p->m_req.requestInfo & UtilLockReq::Granted)
{
- jam();
+ jamBlock(block);
grant = true;
}
else
{
- jam();
+ jamBlock(block);
grant = false;
}
}
if(trylock && grant == false)
{
- jam();
+ jamBlock(block);
if (notify && lockOwner)
{
- jam();
+ jamBlock(block);
queue.first(lockEPtr);
* lockOwner = &lockEPtr.p->m_req;
}
@@ -67,7 +69,7 @@ LockQueue::lock(Pool & thePool,
if(!thePool.seize(lockEPtr))
{
- jam();
+ jamBlock(block);
return UtilLockRef::OutOfLockRecords;
}
@@ -76,19 +78,20 @@ LockQueue::lock(Pool & thePool,
if(grant)
{
- jam();
+ jamBlock(block);
lockEPtr.p->m_req.requestInfo |= UtilLockReq::Granted;
return UtilLockRef::OK;
}
else
{
- jam();
+ jamBlock(block);
return UtilLockRef::InLockQueue;
}
}
Uint32
-LockQueue::unlock(Pool & thePool,
+LockQueue::unlock(SimulatedBlock* block,
+ Pool & thePool,
const UtilUnlockReq* req)
{
const Uint32 senderRef = req->senderRef;
@@ -99,21 +102,21 @@ LockQueue::unlock(Pool & thePool,
for (queue.first(lockEPtr); !lockEPtr.isNull(); queue.next(lockEPtr))
{
- jam();
+ jamBlock(block);
if (lockEPtr.p->m_req.senderData == senderData &&
lockEPtr.p->m_req.senderRef == senderRef)
{
- jam();
+ jamBlock(block);
Uint32 res;
if (lockEPtr.p->m_req.requestInfo & UtilLockReq::Granted)
{
- jam();
+ jamBlock(block);
res = UtilUnlockRef::OK;
}
else
{
- jam();
+ jamBlock(block);
res = UtilUnlockRef::NotLockOwner;
}
queue.release(lockEPtr);
@@ -125,11 +128,13 @@ LockQueue::unlock(Pool & thePool,
}
bool
-LockQueue::first(Pool& thePool, Iterator & iter)
+LockQueue::first(SimulatedBlock* block,
+ Pool& thePool, Iterator & iter)
{
LocalDLFifoList<LockQueueElement> queue(thePool, m_queue);
if (queue.first(iter.m_curr))
{
+ iter.m_block = block;
iter.m_prev.setNull();
iter.thePool = &thePool;
return true;
@@ -148,17 +153,18 @@ LockQueue::next(Iterator& iter)
int
LockQueue::checkLockGrant(Iterator& iter, UtilLockReq* req)
{
+ SimulatedBlock* block = iter.m_block;
LocalDLFifoList<LockQueueElement> queue(*iter.thePool, m_queue);
if (iter.m_prev.isNull())
{
if (iter.m_curr.p->m_req.requestInfo & UtilLockReq::Granted)
{
- jam();
+ jamBlock(block);
return 1;
}
else
{
- jam();
+ jamBlock(block);
* req = iter.m_curr.p->m_req;
iter.m_curr.p->m_req.requestInfo |= UtilLockReq::Granted;
return 2;
@@ -166,25 +172,25 @@ LockQueue::checkLockGrant(Iterator& iter
}
else
{
- jam();
+ jamBlock(block);
/**
* Prev is granted...
*/
assert(iter.m_prev.p->m_req.requestInfo & UtilLockReq::Granted);
if (iter.m_prev.p->m_req.requestInfo & UtilLockReq::SharedLock)
{
- jam();
+ jamBlock(block);
if (iter.m_curr.p->m_req.requestInfo & UtilLockReq::SharedLock)
{
- jam();
+ jamBlock(block);
if (iter.m_curr.p->m_req.requestInfo & UtilLockReq::Granted)
{
- jam();
+ jamBlock(block);
return 1;
}
else
{
- jam();
+ jamBlock(block);
* req = iter.m_curr.p->m_req;
iter.m_curr.p->m_req.requestInfo |= UtilLockReq::Granted;
return 2;
@@ -212,7 +218,7 @@ LockQueue::dump_queue(Pool& thePool, Sim
for (queue.first(ptr); !ptr.isNull(); queue.next(ptr))
{
- jam();
+ jamBlock(block);
block->infoEvent("- sender: 0x%x data: %u %s %s extra: %u",
ptr.p->m_req.senderRef,
ptr.p->m_req.senderData,
diff -Nrup a/storage/ndb/src/kernel/vm/LockQueue.hpp b/storage/ndb/src/kernel/vm/LockQueue.hpp
--- a/storage/ndb/src/kernel/vm/LockQueue.hpp 2007-11-13 09:34:35 +01:00
+++ b/storage/ndb/src/kernel/vm/LockQueue.hpp 2007-12-22 00:15:10 +01:00
@@ -41,20 +41,23 @@ public:
typedef class ArrayPool<LockQueueElement> Pool;
- Uint32 lock(Pool&, const UtilLockReq * req, const UtilLockReq** lockOwner= 0);
- Uint32 unlock(Pool&, const UtilUnlockReq* req);
+ Uint32 lock(SimulatedBlock*,
+ Pool&, const UtilLockReq*, const UtilLockReq** = 0);
+ Uint32 unlock(SimulatedBlock*,
+ Pool&, const UtilUnlockReq* req);
/**
* After unlock
*/
struct Iterator
{
+ SimulatedBlock* m_block;
Pool * thePool;
Ptr<LockQueueElement> m_prev;
Ptr<LockQueueElement> m_curr;
};
- bool first(Pool& pool, Iterator&);
+ bool first(SimulatedBlock*, Pool& pool, Iterator&);
bool next(Iterator&);
/**
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2641) | jonas | 22 Dec |