diff options
author | joreland@mysql.com <> | 2005-06-07 10:50:27 +0200 |
---|---|---|
committer | joreland@mysql.com <> | 2005-06-07 10:50:27 +0200 |
commit | 7050d08f1810faf12d1499a06e3f9a50cddbbac2 (patch) | |
tree | a4d3f67f8605866eb8c07f60229a4785be7f445c /ndb/src | |
parent | ac76e6db6a89a5cad767bd1e2c6a39df82790ee6 (diff) | |
parent | 7e031804e45baaf1f9dd1f75934e8fba6620e237 (diff) | |
download | mariadb-git-7050d08f1810faf12d1499a06e3f9a50cddbbac2.tar.gz |
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0
Diffstat (limited to 'ndb/src')
-rw-r--r-- | ndb/src/common/transporter/SCI_Transporter.cpp | 9 | ||||
-rw-r--r-- | ndb/src/common/transporter/SCI_Transporter.hpp | 3 | ||||
-rw-r--r-- | ndb/src/common/transporter/SHM_Buffer.hpp | 17 | ||||
-rw-r--r-- | ndb/src/common/transporter/SHM_Transporter.cpp | 6 | ||||
-rw-r--r-- | ndb/src/common/transporter/SHM_Transporter.hpp | 2 | ||||
-rw-r--r-- | ndb/src/common/transporter/SendBuffer.cpp | 2 | ||||
-rw-r--r-- | ndb/src/common/transporter/SendBuffer.hpp | 2 | ||||
-rw-r--r-- | ndb/src/common/transporter/TCP_Transporter.cpp | 5 | ||||
-rw-r--r-- | ndb/src/common/transporter/TCP_Transporter.hpp | 1 | ||||
-rw-r--r-- | ndb/src/common/transporter/Transporter.hpp | 2 | ||||
-rw-r--r-- | ndb/src/common/transporter/TransporterRegistry.cpp | 12 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 1 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp | 3 | ||||
-rw-r--r-- | ndb/src/mgmsrv/ConfigInfo.cpp | 4 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.cpp | 8 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperationExec.cpp | 16 |
16 files changed, 77 insertions, 16 deletions
diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp index 506140a887f..c96f84a4f4f 100644 --- a/ndb/src/common/transporter/SCI_Transporter.cpp +++ b/ndb/src/common/transporter/SCI_Transporter.cpp @@ -1025,7 +1025,8 @@ SCI_Transporter::initSCI() { DBUG_RETURN(true); } - - - - +Uint32 +SCI_Transporter::get_free_buffer() const +{ + return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer(); +} diff --git a/ndb/src/common/transporter/SCI_Transporter.hpp b/ndb/src/common/transporter/SCI_Transporter.hpp index 8d263f32a57..cb42e437118 100644 --- a/ndb/src/common/transporter/SCI_Transporter.hpp +++ b/ndb/src/common/transporter/SCI_Transporter.hpp @@ -133,7 +133,8 @@ public: * remote segment is mapped. Otherwize false. */ bool getConnectionStatus(); - + + virtual Uint32 get_free_buffer() const; private: SCI_Transporter(TransporterRegistry &t_reg, const char *local_host, diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp index f49b4fe73cb..27321a3191f 100644 --- a/ndb/src/common/transporter/SHM_Buffer.hpp +++ b/ndb/src/common/transporter/SHM_Buffer.hpp @@ -157,6 +157,7 @@ public: inline Uint32 getWriteIndex() const { return m_writeIndex;} inline Uint32 getBufferSize() const { return m_bufferSize;} + inline Uint32 get_free_buffer() const; inline void copyIndexes(SHM_Writer * standbyWriter); @@ -212,5 +213,21 @@ SHM_Writer::updateWritePtr(Uint32 sz){ m_writeIndex = tWriteIndex; * m_sharedWriteIndex = tWriteIndex; } + +inline +Uint32 +SHM_Writer::get_free_buffer() const +{ + Uint32 tReadIndex = * m_sharedReadIndex; + Uint32 tWriteIndex = m_writeIndex; + + Uint32 free; + if(tReadIndex <= tWriteIndex){ + free = m_bufferSize + tReadIndex - tWriteIndex; + } else { + free = tReadIndex - tWriteIndex; + } + return free; +} #endif diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index e2d23cf94e2..a225988d37f 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -365,3 +365,9 @@ SHM_Transporter::doSend() kill(m_remote_pid, g_ndb_shm_signum); } } + +Uint32 +SHM_Transporter::get_free_buffer() const +{ + return writer->get_free_buffer(); +} diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp index 677bd6efc37..e7a76225471 100644 --- a/ndb/src/common/transporter/SHM_Transporter.hpp +++ b/ndb/src/common/transporter/SHM_Transporter.hpp @@ -139,6 +139,8 @@ protected: int m_remote_pid; Uint32 m_last_signal; Uint32 m_signal_threshold; + + virtual Uint32 get_free_buffer() const; private: bool _shmSegCreated; diff --git a/ndb/src/common/transporter/SendBuffer.cpp b/ndb/src/common/transporter/SendBuffer.cpp index 58cad96931f..8f69eb4bd40 100644 --- a/ndb/src/common/transporter/SendBuffer.cpp +++ b/ndb/src/common/transporter/SendBuffer.cpp @@ -60,7 +60,7 @@ SendBuffer::bufferSize() { } Uint32 -SendBuffer::bufferSizeRemaining() { +SendBuffer::bufferSizeRemaining() const { return (sizeOfBuffer - dataSize); } diff --git a/ndb/src/common/transporter/SendBuffer.hpp b/ndb/src/common/transporter/SendBuffer.hpp index 63a01f3de24..7ebeb6d890e 100644 --- a/ndb/src/common/transporter/SendBuffer.hpp +++ b/ndb/src/common/transporter/SendBuffer.hpp @@ -51,7 +51,7 @@ public: bool initBuffer(Uint32 aRemoteNodeId); // Number of bytes remaining in the buffer - Uint32 bufferSizeRemaining(); + Uint32 bufferSizeRemaining() const; // Number of bytes of data in the buffer int bufferSize(); diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index fd71cf71cd9..5db12d3985c 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -253,6 +253,11 @@ TCP_Transporter::sendIsPossible(struct timeval * timeout) { #endif } +Uint32 +TCP_Transporter::get_free_buffer() const +{ + return m_sendBuffer.bufferSizeRemaining(); +} Uint32 * TCP_Transporter::getWritePtr(Uint32 lenBytes, Uint32 prio){ diff --git a/ndb/src/common/transporter/TCP_Transporter.hpp b/ndb/src/common/transporter/TCP_Transporter.hpp index 9cd174150c1..df4149531b4 100644 --- a/ndb/src/common/transporter/TCP_Transporter.hpp +++ b/ndb/src/common/transporter/TCP_Transporter.hpp @@ -101,6 +101,7 @@ private: */ virtual void updateReceiveDataPtr(Uint32 bytesRead); + virtual Uint32 get_free_buffer() const; protected: /** * Setup client/server and perform connect/accept diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp index 53414f1179d..8c5e96226a3 100644 --- a/ndb/src/common/transporter/Transporter.hpp +++ b/ndb/src/common/transporter/Transporter.hpp @@ -86,6 +86,8 @@ public: m_socket_client->set_port(port); }; + virtual Uint32 get_free_buffer() const = 0; + protected: Transporter(TransporterRegistry &, TransporterType, diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index f331b1660c1..5ffd3ac334e 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -558,6 +558,18 @@ TransporterRegistry::removeTransporter(NodeId nodeId) { theTransporters[nodeId] = NULL; } +Uint32 +TransporterRegistry::get_free_buffer(Uint32 node) const +{ + Transporter *t; + if(likely((t = theTransporters[node]) != 0)) + { + return t->get_free_buffer(); + } + return 0; +} + + SendStatus TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, Uint8 prio, diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index b2ed7acd347..03309f3ac67 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -5072,6 +5072,7 @@ Dbdih::invalidateNodeLCP(Signal* signal, Uint32 nodeId, TabRecordPtr tabPtr) * And reset nextLcp */ replicaPtr.p->nextLcp = 0; + replicaPtr.p->noCrashedReplicas = 0; }//if }//for }//for diff --git a/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp b/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp index 6527864135b..6a478bea917 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp @@ -133,6 +133,9 @@ void Dbtup::sendReadAttrinfo(Signal* signal, Uint32 ToutBufIndex, const Operationrec * const regOperPtr) { + if(ToutBufIndex == 0) + return; + const BlockReference recBlockref = regOperPtr->recBlockref; const Uint32 sig0 = regOperPtr->tcOperationPtr; const Uint32 sig1 = regOperPtr->transid1; diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 67bf09fab10..b1fe0735612 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -1668,7 +1668,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { false, ConfigInfo::CI_INT, "256K", - "16K", + "64K", STR_VALUE(MAX_INT_RNIL) }, { @@ -1856,7 +1856,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { false, ConfigInfo::CI_INT, "1M", - "4K", + "64K", STR_VALUE(MAX_INT_RNIL) }, { diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index baf5c7e5c83..28e585b65b8 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1649,7 +1649,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, abort(); } - int distKeys= impl.m_noOfDistributionKeys; + int distKeys= impl.m_noOfDistributionKeys && + impl.m_noOfDistributionKeys < impl.m_noOfKeys; + + assert(distKeys == 0 || distKeys == 1); + for(i = 0; i<sz; i++){ const NdbColumnImpl * col = impl.m_columns[i]; if(col == 0) @@ -1661,7 +1665,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, tmpAttr.AttributeId = i; tmpAttr.AttributeKeyFlag = col->m_pk; tmpAttr.AttributeNullableFlag = col->m_nullable; - tmpAttr.AttributeDKey = col->m_distributionKey; + tmpAttr.AttributeDKey = distKeys * col->m_distributionKey; tmpAttr.AttributeExtType = (Uint32)col->m_type; tmpAttr.AttributeExtPrecision = ((unsigned)col->m_precision & 0xFFFF); diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index 4200300615d..58a816e3c1a 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -104,8 +104,9 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) { Uint32 tTransId1, tTransId2; Uint32 tReqInfo; - Uint32 tInterpretInd = theInterpretIndicator; - + Uint8 tInterpretInd = theInterpretIndicator; + Uint8 tDirtyIndicator = theDirtyIndicator; + Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len; theErrorLine = 0; if (tInterpretInd != 1) { @@ -123,7 +124,13 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) if (tStatus != GetValue) { setErrorCodeAbort(4116); return -1; - }//if + } + else if(unlikely(tDirtyIndicator && tTotalCurrAI_Len == 0)) + { + getValue(NdbDictionary::Column::FRAGMENT); + tTotalCurrAI_Len = theTotalCurrAI_Len; + assert(theTotalCurrAI_Len); + } } else { setErrorCodeAbort(4005); return -1; @@ -132,6 +139,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) if (prepareSendInterpreted() == -1) { return -1; }//if + tTotalCurrAI_Len = theTotalCurrAI_Len; }//if //------------------------------------------------------------- @@ -140,7 +148,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) //------------------------------------------------------------- TcKeyReq * const tcKeyReq = CAST_PTR(TcKeyReq, theTCREQ->getDataPtrSend()); - Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len; Uint32 tTableId = m_currentTable->m_tableId; Uint32 tSchemaVersion = m_currentTable->m_version; @@ -188,7 +195,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) tcKeyReq->setStartFlag(tReqInfo, tStartIndicator); tcKeyReq->setInterpretedFlag(tReqInfo, tInterpretIndicator); - Uint8 tDirtyIndicator = theDirtyIndicator; OperationType tOperationType = theOperationType; Uint32 tTupKeyLen = theTupKeyLen; Uint8 abortOption = |