Commit bd2161fb authored by unknown's avatar unknown

Merge perch.ndb.mysql.com:/home/jonas/src/41-work

into  perch.ndb.mysql.com:/home/jonas/src/mysql-4.1
parents 96017177 17741f9c
......@@ -40,12 +40,12 @@ Backup::Backup(const Configuration & conf) :
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
ndbrequire(p != 0);
Uint32 noBackups = 0, noTables = 0, noAttribs = 0;
Uint32 noBackups = 0, noTables = 0, noAttribs = 0, noFrags = 0;
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless));
ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups);
// ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_ATTRIBUTE, &noAttribs));
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_FRAG_CONNECT, &noFrags));
noAttribs++; //RT 527 bug fix
......@@ -55,8 +55,7 @@ Backup::Backup(const Configuration & conf) :
c_attributePool.setSize(noBackups * noAttribs);
c_triggerPool.setSize(noBackups * 3 * noTables);
// 2 = no of replicas
c_fragmentPool.setSize(noBackups * 2 * NO_OF_FRAG_PER_NODE * noTables);
c_fragmentPool.setSize(noBackups * noFrags);
Uint32 szMem = 0;
ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MEM, &szMem);
......
......@@ -1400,7 +1400,7 @@ private:
const UintR scanParallel,
const UintR noOprecPerFrag);
void initScanfragrec(Signal* signal);
void releaseScanResources(ScanRecordPtr);
void releaseScanResources(ScanRecordPtr, bool not_started = false);
ScanRecordPtr seizeScanrec(Signal* signal);
void sendScanFragReq(Signal*, ScanRecord*, ScanFragRec*);
void sendScanTabConf(Signal* signal, ScanRecordPtr);
......@@ -1543,7 +1543,8 @@ private:
void signalErrorRefuseLab(Signal* signal);
void abort080Lab(Signal* signal);
void packKeyData000Lab(Signal* signal, BlockReference TBRef, Uint32 len);
void abortScanLab(Signal* signal, ScanRecordPtr, Uint32 errCode);
void abortScanLab(Signal* signal, ScanRecordPtr, Uint32 errCode,
bool not_started = false);
void sendAbortedAfterTimeout(Signal* signal, int Tcheck);
void abort010Lab(Signal* signal);
void abort015Lab(Signal* signal);
......
......@@ -8767,17 +8767,17 @@ void Dbtc::scanAttrinfoLab(Signal* signal, UintR Tlen)
scanAttrinfo_attrbuf_error:
jam();
abortScanLab(signal, scanptr, ZGET_ATTRBUF_ERROR);
abortScanLab(signal, scanptr, ZGET_ATTRBUF_ERROR, true);
return;
scanAttrinfo_attrbuf2_error:
jam();
abortScanLab(signal, scanptr, ZGET_ATTRBUF_ERROR);
abortScanLab(signal, scanptr, ZGET_ATTRBUF_ERROR, true);
return;
scanAttrinfo_len_error:
jam();
abortScanLab(signal, scanptr, ZLENGTH_ERROR);
abortScanLab(signal, scanptr, ZLENGTH_ERROR, true);
return;
}//Dbtc::scanAttrinfoLab()
......@@ -8793,7 +8793,8 @@ void Dbtc::diFcountReqLab(Signal* signal, ScanRecordPtr scanptr)
;
} else {
abortScanLab(signal, scanptr,
tabPtr.p->getErrorCode(scanptr.p->scanSchemaVersion));
tabPtr.p->getErrorCode(scanptr.p->scanSchemaVersion),
true);
return;
}
......@@ -8831,13 +8832,13 @@ void Dbtc::execDI_FCOUNTCONF(Signal* signal)
ndbrequire(scanptr.p->scanState == ScanRecord::WAIT_FRAGMENT_COUNT);
if (apiConnectptr.p->apiFailState == ZTRUE) {
jam();
releaseScanResources(scanptr);
releaseScanResources(scanptr, true);
handleApiFailState(signal, apiConnectptr.i);
return;
}//if
if (tfragCount == 0) {
jam();
abortScanLab(signal, scanptr, ZNO_FRAGMENT_ERROR);
abortScanLab(signal, scanptr, ZNO_FRAGMENT_ERROR, true);
return;
}//if
......@@ -8851,7 +8852,8 @@ void Dbtc::execDI_FCOUNTCONF(Signal* signal)
;
} else {
abortScanLab(signal, scanptr,
tabPtr.p->getErrorCode(scanptr.p->scanSchemaVersion));
tabPtr.p->getErrorCode(scanptr.p->scanSchemaVersion),
true);
return;
}
......@@ -8906,20 +8908,22 @@ void Dbtc::execDI_FCOUNTREF(Signal* signal)
ndbrequire(scanptr.p->scanState == ScanRecord::WAIT_FRAGMENT_COUNT);
if (apiConnectptr.p->apiFailState == ZTRUE) {
jam();
releaseScanResources(scanptr);
releaseScanResources(scanptr, true);
handleApiFailState(signal, apiConnectptr.i);
return;
}//if
abortScanLab(signal, scanptr, errCode);
abortScanLab(signal, scanptr, errCode, true);
}//Dbtc::execDI_FCOUNTREF()
void Dbtc::abortScanLab(Signal* signal, ScanRecordPtr scanptr, Uint32 errCode)
void Dbtc::abortScanLab(Signal* signal, ScanRecordPtr scanptr, Uint32 errCode,
bool not_started)
{
scanTabRefLab(signal, errCode);
releaseScanResources(scanptr);
releaseScanResources(scanptr, not_started);
}//Dbtc::abortScanLab()
void Dbtc::releaseScanResources(ScanRecordPtr scanPtr)
void Dbtc::releaseScanResources(ScanRecordPtr scanPtr,
bool not_started)
{
if (apiConnectptr.p->cachePtr != RNIL) {
cachePtr.i = apiConnectptr.p->cachePtr;
......@@ -8931,6 +8935,15 @@ void Dbtc::releaseScanResources(ScanRecordPtr scanPtr)
ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
releaseTcCon();
if (not_started)
{
jam();
ScanFragList run(c_scan_frag_pool, scanPtr.p->m_running_scan_frags);
ScanFragList queue(c_scan_frag_pool, scanPtr.p->m_queued_scan_frags);
run.release();
queue.release();
}
ndbrequire(scanPtr.p->m_running_scan_frags.isEmpty());
ndbrequire(scanPtr.p->m_queued_scan_frags.isEmpty());
ndbrequire(scanPtr.p->m_delivered_scan_frags.isEmpty());
......
......@@ -1355,5 +1355,5 @@ NdbConnection::sendTC_COMMIT_ACK(NdbApiSignal * aSignal,
dataPtr[0] = transId1;
dataPtr[1] = transId2;
tp->sendSignal(aSignal, refToNode(aTCRef));
tp->sendSignalUnCond(aSignal, refToNode(aTCRef));
}
......@@ -817,7 +817,7 @@ TransporterFacade::sendSignal(NdbApiSignal * aSignal, NodeId aNode){
LinearSectionPtr ptr[3];
signalLogger.sendSignal(* aSignal,
1,
aSignal->getDataPtr(),
tDataPtr,
aNode, ptr, 0);
signalLogger.flushSignalLog();
aSignal->theSendersBlockRef = tmp;
......@@ -844,6 +844,7 @@ TransporterFacade::sendSignal(NdbApiSignal * aSignal, NodeId aNode){
int
TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){
Uint32* tDataPtr = aSignal->getDataPtrSend();
#ifdef API_TRACE
if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){
Uint32 tmp = aSignal->theSendersBlockRef;
......@@ -851,7 +852,7 @@ TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){
LinearSectionPtr ptr[3];
signalLogger.sendSignal(* aSignal,
0,
aSignal->getDataPtr(),
tDataPtr,
aNode, ptr, 0);
signalLogger.flushSignalLog();
aSignal->theSendersBlockRef = tmp;
......@@ -862,7 +863,7 @@ TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){
(aSignal->theReceiversBlockNumber != 0));
SendStatus ss = theTransporterRegistry->prepareSend(aSignal,
0,
aSignal->getDataPtr(),
tDataPtr,
aNode,
0);
......
......@@ -128,6 +128,7 @@ private:
friend class GrepSS;
friend class Ndb;
friend class Ndb_cluster_connection_impl;
friend class NdbConnection;
int sendSignalUnCond(NdbApiSignal *, NodeId nodeId);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment