18 #include <ndb_global.h>
22 #include <ndb_version.h>
24 #include <signaldata/WaitGCP.hpp>
25 #include <signaldata/KeyInfo.hpp>
26 #include <signaldata/AttrInfo.hpp>
27 #include <signaldata/TcKeyConf.hpp>
28 #include <signaldata/TcKeyFailConf.hpp>
29 #include <signaldata/GetTabInfo.hpp>
30 #include <signaldata/DictTabInfo.hpp>
31 #include <signaldata/NodeFailRep.hpp>
33 #include <signaldata/UtilSequence.hpp>
34 #include <signaldata/UtilPrepare.hpp>
35 #include <signaldata/UtilRelease.hpp>
36 #include <signaldata/UtilExecute.hpp>
37 #include <signaldata/UtilLock.hpp>
39 #include <SectionReader.hpp>
40 #include <Interpreter.hpp>
41 #include <AttributeHeader.hpp>
45 #include <signaldata/DbinfoScan.hpp>
46 #include <signaldata/TransIdAI.hpp>
58 c_runningPrepares(c_preparePool),
59 c_seizingTransactions(c_transactionPool),
60 c_runningTransactions(c_transactionPool),
61 c_lockQueues(c_lockQueuePool)
68 addRecSignal(GSN_NDB_STTOR, &DbUtil::execNDB_STTOR);
69 addRecSignal(GSN_DUMP_STATE_ORD, &DbUtil::execDUMP_STATE_ORD);
70 addRecSignal(GSN_DBINFO_SCANREQ, &DbUtil::execDBINFO_SCANREQ);
71 addRecSignal(GSN_CONTINUEB, &DbUtil::execCONTINUEB);
72 addRecSignal(GSN_NODE_FAILREP, &DbUtil::execNODE_FAILREP);
77 addRecSignal(GSN_TCKEYREF, &DbUtil::execTCKEYREF);
78 addRecSignal(GSN_TCROLLBACKREP, &DbUtil::execTCROLLBACKREP);
89 addRecSignal(GSN_UTIL_SEQUENCE_REF, &DbUtil::execUTIL_SEQUENCE_REF);
90 addRecSignal(GSN_UTIL_SEQUENCE_CONF, &DbUtil::execUTIL_SEQUENCE_CONF);
95 addRecSignal(GSN_UTIL_CREATE_LOCK_REQ, &DbUtil::execUTIL_CREATE_LOCK_REQ);
97 addRecSignal(GSN_UTIL_LOCK_REQ, &DbUtil::execUTIL_LOCK_REQ);
110 addRecSignal(GSN_UTIL_PREPARE_CONF, &DbUtil::execUTIL_PREPARE_CONF);
111 addRecSignal(GSN_UTIL_PREPARE_REF, &DbUtil::execUTIL_PREPARE_REF);
114 addRecSignal(GSN_UTIL_EXECUTE_CONF, &DbUtil::execUTIL_EXECUTE_CONF);
115 addRecSignal(GSN_UTIL_EXECUTE_REF, &DbUtil::execUTIL_EXECUTE_REF);
118 addRecSignal(GSN_UTIL_RELEASE_CONF, &DbUtil::execUTIL_RELEASE_CONF);
119 addRecSignal(GSN_UTIL_RELEASE_REF, &DbUtil::execUTIL_RELEASE_REF);
129 DbUtil::releasePrepare(PreparePtr prepPtr) {
130 prepPtr.p->preparePages.release();
131 c_runningPrepares.release(prepPtr);
135 DbUtil::releasePreparedOperation(PreparedOperationPtr prepOpPtr) {
136 prepOpPtr.p->attrMapping.release();
137 prepOpPtr.p->attrInfo.release();
138 prepOpPtr.p->rsInfo.release();
139 prepOpPtr.p->pkBitmask.clear();
140 c_preparedOperationPool.
release(prepOpPtr);
144 DbUtil::releaseTransaction(TransactionPtr transPtr){
145 transPtr.p->executePages.release();
147 for(transPtr.p->operations.first(opPtr); opPtr.i != RNIL;
148 transPtr.p->operations.next(opPtr)){
149 opPtr.p->attrInfo.release();
150 opPtr.p->keyInfo.release();
151 opPtr.p->rs.release();
152 if (opPtr.p->prepOp != 0 && opPtr.p->prepOp_i != RNIL) {
153 if (opPtr.p->prepOp->releaseFlag) {
154 PreparedOperationPtr prepOpPtr;
155 prepOpPtr.i = opPtr.p->prepOp_i;
156 prepOpPtr.p = opPtr.p->prepOp;
157 releasePreparedOperation(prepOpPtr);
161 transPtr.p->operations.release();
162 c_runningTransactions.
release(transPtr);
172 Uint32 ref = req->senderRef;
173 Uint32 senderData = req->senderData;
176 m_ctx.m_config.getOwnConfigIterator();
181 c_preparedOperationPool.
setSize(6);
184 c_attrMappingPool.setSize(100);
185 c_dataBufPool.setSize(6000);
189 while(tmp.
seize(ptr))
190 new (ptr.p)
Prepare(c_pagePool);
196 while(tmp.
seize(ptr))
197 new (ptr.p)
Operation(c_dataBufPool, c_dataBufPool, c_dataBufPool);
203 while(tmp.
seize(ptr))
205 c_dataBufPool, c_dataBufPool);
211 while(tmp.
seize(ptr))
212 new (ptr.p)
Transaction(c_pagePool, c_operationPool);
217 c_lockElementPool.
setSize(4*MAX_NDB_NODES);
221 conf->senderRef = reference();
222 conf->senderData = senderData;
223 sendSignal(ref, GSN_READ_CONFIG_CONF, signal,
224 ReadConfigConf::SignalLength, JBB);
232 const Uint32 startphase = signal->theData[1];
235 c_transId[0] = (number() << 20) + (getOwnNodeId() << 8);
254 get_systab_tableid(signal);
259 signal->theData[0] = 0;
260 signal->theData[3] = 1;
261 signal->theData[4] = 6;
262 signal->theData[5] = 255;
263 sendSignal(NDBCNTR_REF, GSN_STTORRY, signal, 6, JBB);
269 DbUtil::get_systab_tableid(
Signal* signal)
271 static char NAME[] =
"sys/def/SYSTAB_0";
274 req->senderRef = reference();
275 req->senderData = RNIL;
276 req->schemaTransId = 0;
277 req->requestType = GetTabInfoReq::RequestByName |
278 GetTabInfoReq::LongSignalConf;
280 req->tableNameLen =
sizeof(NAME);
286 Uint32
buf[(
sizeof(NAME)+3)/4];
287 ndbrequire(
sizeof(buf) >=
sizeof(NAME));
288 memcpy(buf, NAME,
sizeof(NAME));
292 ptr[0].sz =
sizeof(NAME);
293 sendSignal(DBDICT_REF, GSN_GET_TABINFOREQ, signal,
294 GetTabInfoReq::SignalLength, JBB, ptr,1);
298 DbUtil::execNDB_STTOR(
Signal* signal)
312 DbUtil::connectTc(
Signal* signal){
315 while(c_seizingTransactions.
seize(ptr)){
316 signal->theData[0] = ptr.i << 1;
317 signal->theData[1] = reference();
318 sendSignal(DBTC_REF, GSN_TCSEIZEREQ, signal, 2, JBB);
327 ptr.i = signal->theData[0] >> 1;
328 c_seizingTransactions.
getPtr(ptr, signal->theData[0] >> 1);
329 ptr.p->connectPtr = signal->theData[1];
330 ptr.p->connectRef = signal->theData[2];
332 c_seizingTransactions.
release(ptr);
334 if (c_seizingTransactions.isEmpty())
337 signal->theData[0] = 0;
338 signal->theData[3] = 1;
339 signal->theData[4] = 6;
340 signal->theData[5] = 255;
341 sendSignal(NDBCNTR_REF, GSN_STTORRY, signal, 6, JBB);
355 DbUtil::execCONTINUEB(
Signal* signal){
363 DbUtil::execNODE_FAILREP(
Signal* signal){
367 failed.
assign(NdbNodeBitmask::Size, rep->theNodes);
370 for(
unsigned i = 1;
i < MAX_NDB_NODES;
i++) {
375 ndbassert(elementsCleaned == 0);
376 (void) elementsCleaned;
382 DbUtil::execDUMP_STATE_ORD(
Signal* signal){
392 const Uint32 tCase = signal->theData[0];
395 ndbout <<
"--------------------------------------------------" << endl;
398 Uint32 reqTy = UtilSequenceReq::CurrVal;
400 if(signal->
length() > 1) seqId = signal->theData[1];
401 if(signal->
length() > 2) reqTy = signal->theData[2];
403 req->senderData = 12;
404 req->sequenceId = seqId;
405 req->requestType = reqTy;
407 sendSignal(DBUTIL_REF, GSN_UTIL_SEQUENCE_REQ,
408 signal, UtilSequenceReq::SignalLength, JBB);
582 ndbout <<
"--------------------------------------------------" << endl;
583 if (signal->
length() <= 1) {
584 ndbout <<
"Usage: DUMP 230 <recordType> <recordNo>" << endl
585 <<
"[1] Print Prepare (running) records" << endl
586 <<
"[2] Print PreparedOperation records" << endl
587 <<
"[3] Print Transaction records" << endl
588 <<
"[4] Print Operation records" << endl
589 <<
"Ex. \"dump 230 1 2\" prints Prepare record no 2." << endl
591 <<
"210 : PREPARE_REQ DELETE SYSTAB_0 SYSKEY_0" << endl
592 <<
"211 : PREPARE_REQ INSERT SYSTAB_0 SYSKEY_0 NEXTID" << endl
593 <<
"212 : PREPARE_REQ UPDATE SYSTAB_0 SYSKEY_0 NEXTID" << endl
594 <<
"213 : PREPARE_REQ READ SYSTAB_0 SYSKEY_0" << endl
595 <<
"214 : PREPARE_REQ DELETE SYSTAB_0 SYSKEY_0 using id" << endl
596 <<
"215 : PREPARE_REQ INSERT SYSTAB_0 SYSKEY_0 NEXTID using id" << endl
597 <<
"216 : PREPARE_REQ UPDATE SYSTAB_0 SYSKEY_0 NEXTID using id" << endl
598 <<
"217 : PREPARE_REQ READ SYSTAB_0 SYSKEY_0 using id" << endl
599 <<
"220 : EXECUTE_REQ <PrepId> <Len> <Val1> <Val2a> <Val2b>" <<endl
600 <<
"299 : Crash system (using ndbrequire(0))"
602 <<
"Ex. \"dump 220 3 5 1 0 17 \" prints Prepare record no 2."
607 switch (signal->theData[1]) {
610 if (signal->
length() >= 3) {
612 if (!c_preparePool.isSeized(signal->theData[2])) {
613 ndbout <<
"Prepare Id: " << signal->theData[2]
614 <<
" (Not seized!)" << endl;
616 c_preparePool.
getPtr(prepPtr, signal->theData[2]);
624 if (!c_runningPrepares.
first(prepPtr)) {
625 ndbout <<
"No Prepare records exist" << endl;
629 while (!prepPtr.isNull()) {
631 c_runningPrepares.
next(prepPtr);
637 if (signal->
length() >= 3) {
638 if (!c_preparedOperationPool.isSeized(signal->theData[2])) {
639 ndbout <<
"PreparedOperation Id: " << signal->theData[2]
640 <<
" (Not seized!)" << endl;
643 ndbout <<
"PreparedOperation Id: " << signal->theData[2] << endl;
644 PreparedOperationPtr prepOpPtr;
645 c_preparedOperationPool.
getPtr(prepOpPtr, signal->theData[2]);
646 prepOpPtr.p->print();
651 #if 0 // not implemented
652 PreparedOperationPtr prepOpPtr;
653 if (!c_runningPreparedOperations.first(prepOpPtr)) {
654 ndbout <<
"No PreparedOperations exist" << endl;
657 while (!prepOpPtr.isNull()) {
658 ndbout <<
"[-PreparedOperation no " << prepOpPtr.i <<
":";
659 prepOpPtr.p->print();
661 c_runningPreparedOperations.next(prepOpPtr);
668 if (signal->
length() >= 3) {
669 ndbout <<
"Print specific record not implemented." << endl;
674 ndbout <<
"Print all records not implemented, specify an Id." << endl;
678 ndbout <<
"Not implemented" << endl;
682 ndbout <<
"Unknown input (try without any data)" << endl;
687 if(tCase == 240 && signal->getLength() == 2){
688 MutexManager::ActiveMutexPtr ptr;
689 ndbrequire(c_mutexMgr.seize(ptr));
690 ptr.p->m_mutexId = signal->theData[1];
691 Callback c = { safe_cast(&DbUtil::mutex_created), ptr.i };
692 ptr.p->m_callback = c;
693 c_mutexMgr.create(signal, ptr);
694 ndbout_c(
"c_mutexMgr.create ptrI=%d mutexId=%d", ptr.i, ptr.p->m_mutexId);
697 if(tCase == 241 && signal->getLength() == 2){
698 MutexManager::ActiveMutexPtr ptr;
699 ndbrequire(c_mutexMgr.seize(ptr));
700 ptr.p->m_mutexId = signal->theData[1];
701 Callback c = { safe_cast(&DbUtil::mutex_locked), ptr.i };
702 ptr.p->m_callback = c;
703 c_mutexMgr.lock(signal, ptr,
true);
704 ndbout_c(
"c_mutexMgr.lock ptrI=%d mutexId=%d", ptr.i, ptr.p->m_mutexId);
707 if(tCase == 242 && signal->getLength() == 2){
708 MutexManager::ActiveMutexPtr ptr;
709 ptr.i = signal->theData[1];
710 c_mutexMgr.getPtr(ptr);
711 Callback c = { safe_cast(&DbUtil::mutex_unlocked), ptr.i };
712 ptr.p->m_callback = c;
713 c_mutexMgr.unlock(signal, ptr);
714 ndbout_c(
"c_mutexMgr.unlock ptrI=%d mutexId=%d", ptr.i, ptr.p->m_mutexId);
717 if(tCase == 243 && signal->getLength() == 3){
718 MutexManager::ActiveMutexPtr ptr;
719 ndbrequire(c_mutexMgr.seize(ptr));
720 ptr.p->m_mutexId = signal->theData[1];
721 Callback c = { safe_cast(&DbUtil::mutex_destroyed), ptr.i };
722 ptr.p->m_callback = c;
723 c_mutexMgr.destroy(signal, ptr);
724 ndbout_c(
"c_mutexMgr.destroy ptrI=%d mutexId=%d",
725 ptr.i, ptr.p->m_mutexId);
732 Uint32
bucket = signal->theData[1];
733 if (signal->getLength() == 1)
736 infoEvent(
"Starting dumping of DbUtil::Locks");
738 c_lockQueues.
next(bucket, iter);
740 for (Uint32
i = 0;
i<32 || iter.bucket == bucket;
i++)
742 if (iter.curr.isNull())
744 infoEvent(
"Dumping of DbUtil::Locks - done");
748 infoEvent(
"LockQueue %u", iter.curr.p->m_lockId);
749 iter.curr.p->m_queue.dump_queue(c_lockElementPool,
this);
750 c_lockQueues.
next(iter);
752 signal->theData[0] = 244;
753 signal->theData[1] = iter.bucket;
754 sendSignal(reference(), GSN_DUMP_STATE_ORD, signal, 2, JBB);
759 void DbUtil::execDBINFO_SCANREQ(
Signal *signal)
769 case Ndbinfo::POOLS_TABLEID:
774 c_pagePool.getUsed(),
775 c_pagePool.getSize(),
776 c_pagePool.getEntrySize(),
777 c_pagePool.getUsedHi(),
780 c_preparePool.getUsed(),
781 c_preparePool.getSize(),
782 c_preparePool.getEntrySize(),
783 c_preparePool.getUsedHi(),
785 {
"Prepared Operation",
786 c_preparedOperationPool.getUsed(),
787 c_preparedOperationPool.getSize(),
788 c_preparedOperationPool.getEntrySize(),
789 c_preparedOperationPool.getUsedHi(),
792 c_operationPool.getUsed(),
793 c_operationPool.getSize(),
794 c_operationPool.getEntrySize(),
795 c_operationPool.getUsedHi(),
798 c_transactionPool.getUsed(),
799 c_transactionPool.getSize(),
800 c_transactionPool.getEntrySize(),
801 c_transactionPool.getUsedHi(),
803 {
"Attribute Mapping",
804 c_attrMappingPool.getUsed(),
806 c_attrMappingPool.getEntrySize(),
807 c_attrMappingPool.getUsedHi(),
810 c_dataBufPool.getUsed(),
812 c_dataBufPool.getEntrySize(),
813 c_dataBufPool.getUsedHi(),
815 { NULL, 0,0,0,0, { 0,0,0,0 }}
818 const size_t num_config_params =
819 sizeof(pools[0].config_params) /
sizeof(pools[0].config_params[0]);
820 Uint32 pool =
cursor->data[0];
821 BlockNumber bn = blockToMain(number());
822 while(pools[pool].poolname)
826 row.write_uint32(getOwnNodeId());
827 row.write_uint32(bn);
828 row.write_uint32(instance());
829 row.write_string(pools[pool].poolname);
830 row.write_uint64(pools[pool].used);
831 row.write_uint64(pools[pool].total);
832 row.write_uint64(pools[pool].used_hi);
833 row.write_uint64(pools[pool].entry_size);
834 for (
size_t i = 0;
i < num_config_params;
i++)
835 row.write_uint32(pools[pool].config_params[
i]);
836 ndbinfo_send_row(signal, req, row, rl);
838 if (rl.need_break(req))
841 ndbinfo_send_scan_break(signal, req, rl, pool);
851 ndbinfo_send_scan_conf(signal, req, rl);
855 DbUtil::mutex_created(
Signal* signal, Uint32 ptrI, Uint32 retVal){
856 MutexManager::ActiveMutexPtr ptr; ptr.i = ptrI;
857 c_mutexMgr.getPtr(ptr);
858 ndbout_c(
"mutex_created - mutexId=%d, retVal=%d",
859 ptr.p->m_mutexId, retVal);
860 c_mutexMgr.release(ptrI);
864 DbUtil::mutex_destroyed(
Signal* signal, Uint32 ptrI, Uint32 retVal){
865 MutexManager::ActiveMutexPtr ptr; ptr.i = ptrI;
866 c_mutexMgr.getPtr(ptr);
867 ndbout_c(
"mutex_destroyed - mutexId=%d, retVal=%d",
868 ptr.p->m_mutexId, retVal);
869 c_mutexMgr.release(ptrI);
873 DbUtil::mutex_locked(
Signal* signal, Uint32 ptrI, Uint32 retVal){
874 MutexManager::ActiveMutexPtr ptr; ptr.i = ptrI;
875 c_mutexMgr.getPtr(ptr);
876 ndbout_c(
"mutex_locked - mutexId=%d, retVal=%d ptrI=%d",
877 ptr.p->m_mutexId, retVal, ptrI);
879 c_mutexMgr.release(ptrI);
883 DbUtil::mutex_unlocked(
Signal* signal, Uint32 ptrI, Uint32 retVal){
884 MutexManager::ActiveMutexPtr ptr; ptr.i = ptrI;
885 c_mutexMgr.getPtr(ptr);
886 ndbout_c(
"mutex_unlocked - mutexId=%d, retVal=%d",
887 ptr.p->m_mutexId, retVal);
889 c_mutexMgr.release(ptrI);
893 DbUtil::execUTIL_SEQUENCE_REF(
Signal* signal){
895 ndbout <<
"UTIL_SEQUENCE_REF" << endl;
896 printUTIL_SEQUENCE_REF(stdout, signal->getDataPtrSend(), signal->
length(), 0);
900 DbUtil::execUTIL_SEQUENCE_CONF(
Signal* signal){
902 ndbout <<
"UTIL_SEQUENCE_CONF" << endl;
903 printUTIL_SEQUENCE_CONF(stdout, signal->getDataPtrSend(), signal->
length(),0);
907 DbUtil::execUTIL_PREPARE_CONF(
Signal* signal){
909 ndbout <<
"UTIL_PREPARE_CONF" << endl;
910 printUTIL_PREPARE_CONF(stdout, signal->getDataPtrSend(), signal->
length(), 0);
914 DbUtil::execUTIL_PREPARE_REF(
Signal* signal){
916 ndbout <<
"UTIL_PREPARE_REF" << endl;
917 printUTIL_PREPARE_REF(stdout, signal->getDataPtrSend(), signal->
length(), 0);
921 DbUtil::execUTIL_EXECUTE_CONF(
Signal* signal) {
923 ndbout <<
"UTIL_EXECUTE_CONF" << endl;
924 printUTIL_EXECUTE_CONF(stdout, signal->getDataPtrSend(), signal->
length(), 0);
928 DbUtil::execUTIL_EXECUTE_REF(
Signal* signal) {
931 ndbout <<
"UTIL_EXECUTE_REF" << endl;
932 printUTIL_EXECUTE_REF(stdout, signal->getDataPtrSend(), signal->
length(), 0);
936 DbUtil::execUTIL_RELEASE_CONF(
Signal* signal) {
938 ndbout <<
"UTIL_RELEASE_CONF" << endl;
942 DbUtil::execUTIL_RELEASE_REF(
Signal* signal) {
945 ndbout <<
"UTIL_RELEASE_REF" << endl;
949 DbUtil::sendUtilPrepareRef(
Signal* signal, UtilPrepareRef::ErrorCode error,
950 Uint32 recipient, Uint32 senderData,
953 ref->errorCode = error;
954 ref->senderData = senderData;
955 ref->dictErrCode = errCode2;
957 sendSignal(recipient, GSN_UTIL_PREPARE_REF, signal,
958 UtilPrepareRef::SignalLength, JBB);
962 DbUtil::sendUtilExecuteRef(
Signal* signal, UtilExecuteRef::ErrorCode error,
963 Uint32 TCerror, Uint32 recipient, Uint32 senderData){
966 ref->senderData = senderData;
967 ref->errorCode = error;
968 ref->TCErrorCode = TCerror;
970 sendSignal(recipient, GSN_UTIL_EXECUTE_REF, signal,
971 UtilPrepareRef::SignalLength, JBB);
992 const Uint32 senderRef = req->senderRef;
993 const Uint32 senderData = req->senderData;
994 const Uint32 schemaTransId= req->schemaTransId;
996 if(signal->getNoOfSections() == 0) {
999 sendUtilPrepareRef(signal, UtilPrepareRef::MISSING_PROPERTIES_SECTION,
1000 senderRef, senderData);
1009 if(!c_runningPrepares.
seize(prepPtr)) {
1011 releaseSections(handle);
1012 sendUtilPrepareRef(signal, UtilPrepareRef::PREPARE_SEIZE_ERROR,
1013 senderRef, senderData);
1016 handle.getSection(ptr, UtilPrepareReq::PROPERTIES_SECTION);
1017 const Uint32 noPages = (ptr.sz +
sizeof(
Page32)) /
sizeof(
Page32);
1018 ndbassert(noPages > 0);
1019 if (!prepPtr.p->preparePages.seize(noPages)) {
1021 releaseSections(handle);
1022 sendUtilPrepareRef(signal, UtilPrepareRef::PREPARE_PAGES_SEIZE_ERROR,
1023 senderRef, senderData);
1024 c_preparePool.
release(prepPtr);
1028 Uint32* target = &prepPtr.p->preparePages.getPtr(0)->data[0];
1030 prepPtr.p->prepDataLen = ptr.sz;
1032 releaseSections(handle);
1035 prepPtr.p->clientRef = senderRef;
1036 prepPtr.p->clientData = senderData;
1037 prepPtr.p->schemaTransId = schemaTransId;
1039 readPrepareProps(signal, &reader, prepPtr);
1042 void DbUtil::readPrepareProps(
Signal* signal,
1048 printf(
"DbUtil::readPrepareProps: Received SimpleProperties:\n");
1051 ndbrequire(reader->
first());
1055 ndbrequire(reader->
next());
1056 ndbrequire(reader->
getKey() == UtilPrepareReq::OperationType);
1058 ndbrequire(reader->
next());
1061 if (tableKey == UtilPrepareReq::ScanTakeOverInd)
1066 if (tableKey == UtilPrepareReq::ReorgInd)
1073 (tableKey == UtilPrepareReq::TableId));
1080 req->senderRef = reference();
1081 req->senderData = prepPtr.i;
1082 req->schemaTransId = prepPtr.p->schemaTransId;
1085 char tableName[MAX_TAB_NAME_SIZE];
1086 req->requestType = GetTabInfoReq::RequestByName |
1087 GetTabInfoReq::LongSignalConf;
1095 ndbrequire(req->tableNameLen < MAX_TAB_NAME_SIZE);
1096 reader->getString((
char*)tableName);
1098 ptr[0].p = (Uint32*)tableName;
1099 ptr[0].sz = req->tableNameLen;
1100 sendSignal(DBDICT_REF, GSN_GET_TABINFOREQ, signal,
1101 GetTabInfoReq::SignalLength, JBB, ptr,1);
1106 req->requestType = GetTabInfoReq::RequestById |
1107 GetTabInfoReq::LongSignalConf;
1109 sendSignal(DBDICT_REF, GSN_GET_TABINFOREQ, signal,
1110 GetTabInfoReq::SignalLength, JBB);
1134 const Uint32 prepI = conf->senderData;
1135 const Uint32 totalLen = conf->totalLen;
1139 handle.getSection(dictTabInfoPtr, GetTabInfoConf::DICT_TAB_INFO);
1140 ndbrequire(dictTabInfoPtr.sz == totalLen);
1146 c_runningPrepares.
getPtr(prepPtr, prepI);
1147 prepareOperation(signal, prepPtr, dictTabInfoPtr);
1148 releaseSections(handle);
1155 releaseSections(handle);
1166 Uint32 prepI = ref->senderData;
1168 #if 0 //def EVENT_DEBUG
1169 ndbout <<
"Signal GET_TABINFOREF received." << endl;
1170 ndbout <<
"Error Code: " << ref->errorCode << endl;
1172 switch (ref->errorCode) {
1173 case GetTabInfoRef::InvalidTableId:
1174 ndbout <<
" Msg: Invalid table id" << endl;
1176 case GetTabInfoRef::TableNotDefined:
1177 ndbout <<
" Msg: Table not defined" << endl;
1179 case GetTabInfoRef::TableNameToLong:
1180 ndbout <<
" Msg: Table node too long" << endl;
1183 ndbout <<
" Msg: Unknown error returned from Dict" << endl;
1189 c_runningPrepares.
getPtr(prepPtr, prepI);
1191 sendUtilPrepareRef(signal, UtilPrepareRef::DICT_TAB_INFO_ERROR,
1192 prepPtr.p->clientRef, prepPtr.p->clientData,
1195 releasePrepare(prepPtr);
1216 DbUtil::prepareOperation(
Signal* signal,
1225 PreparedOperationPtr prepOpPtr;
1226 if(!c_preparedOperationPool.
seize(prepOpPtr)) {
1228 sendUtilPrepareRef(signal, UtilPrepareRef::PREPARED_OPERATION_SEIZE_ERROR,
1229 prepPtr.p->clientRef, prepPtr.p->clientData);
1230 releasePrepare(prepPtr);
1233 prepPtr.p->prepOpPtr = prepOpPtr;
1239 prepPtr.p->prepDataLen);
1241 ndbrequire(prepPagesReader.first());
1243 const Uint32 noOfOperations = prepPagesReader.getUint32();
1244 ndbrequire(noOfOperations == 1);
1246 ndbrequire(prepPagesReader.next());
1247 ndbrequire(prepPagesReader.getKey() == UtilPrepareReq::OperationType);
1248 const Uint32 operationType = prepPagesReader.getUint32();
1250 ndbrequire(prepPagesReader.next());
1252 char tableName[MAX_TAB_NAME_SIZE];
1257 bool scanTakeOver =
false;
1259 if (tableKey == UtilPrepareReq::ScanTakeOverInd)
1261 scanTakeOver =
true;
1262 prepPagesReader.next();
1266 if (tableKey == UtilPrepareReq::ReorgInd)
1269 prepPagesReader.next();
1273 if (tableKey == UtilPrepareReq::TableId) {
1275 tableId = prepPagesReader.getUint32();
1280 ndbrequire(prepPagesReader.getValueLen() <= MAX_TAB_NAME_SIZE);
1281 prepPagesReader.getString(tableName);
1286 Uint32 noOfAttributes = 0;
1287 while(prepPagesReader.next()) {
1293 ndbrequire(prepPagesReader.getKey() == UtilPrepareReq::AttributeId);
1297 ndbrequire(prepPtr.p->prepOpPtr.p->attrMapping.seize(noOfAttributes));
1298 if (operationType == UtilPrepareReq::Read) {
1299 ndbrequire(prepPtr.p->prepOpPtr.p->rsInfo.seize(noOfAttributes));
1305 ndbrequire(prepPagesReader.first() && prepPagesReader.next() &&
1306 prepPagesReader.next());
1309 prepPagesReader.next();
1312 prepPagesReader.next();
1315 AttrMappingBuffer::DataBufferIterator attrMappingIt;
1316 ndbrequire(prepPtr.p->prepOpPtr.p->attrMapping.first(attrMappingIt));
1318 ResultSetBuffer::DataBufferIterator rsInfoIt;
1319 if (operationType == UtilPrepareReq::Read) {
1320 ndbrequire(prepPtr.p->prepOpPtr.p->rsInfo.first(rsInfoIt));
1323 Uint32 noOfPKAttribsStored = 0;
1324 Uint32 noOfNonPKAttribsStored = 0;
1325 Uint32 attrLength = 0;
1326 char attrNameRequested[MAX_ATTR_NAME_SIZE];
1327 Uint32 attrIdRequested;
1329 while(prepPagesReader.next()) {
1334 (attributeKey == UtilPrepareReq::AttributeId));
1337 ndbrequire(prepPagesReader.getValueLen() <= MAX_ATTR_NAME_SIZE);
1339 prepPagesReader.getString(attrNameRequested);
1340 attrIdRequested= ~0u;
1343 attrIdRequested = prepPagesReader.getUint32();
1351 unpackStatus = SimpleProperties::unpack(dictInfoReader, &tableDesc,
1352 DictTabInfo::TableMapping,
1353 DictTabInfo::TableMappingSize,
1355 ndbrequire(unpackStatus == SimpleProperties::Break);
1361 char attrName[MAX_ATTR_NAME_SIZE];
1362 Uint32 attrId= ~(Uint32)0;
1363 bool attributeFound =
false;
1364 Uint32 noOfKeysFound = 0;
1365 Uint32 noOfNonKeysFound = 0;
1366 for (Uint32
i=0;
i<tableDesc.NoOfAttributes;
i++) {
1369 ndbrequire(dictInfoReader.getKey() == DictTabInfo::AttributeName);
1370 ndbrequire(dictInfoReader.getValueLen() <= MAX_ATTR_NAME_SIZE);
1371 dictInfoReader.getString(attrName);
1375 dictInfoReader.next();
1376 ndbrequire(dictInfoReader.getKey() == DictTabInfo::AttributeId);
1377 attrId = dictInfoReader.getUint32();
1380 unpackStatus = SimpleProperties::unpack(dictInfoReader, &attrDesc,
1381 DictTabInfo::AttributeMapping,
1382 DictTabInfo::AttributeMappingSize,
1384 ndbrequire(unpackStatus == SimpleProperties::Break);
1387 if (attrDesc.AttributeKeyFlag) { jam(); noOfKeysFound++; }
1388 else { jam(); noOfNonKeysFound++; }
1390 if (strcmp(attrName, attrNameRequested) == 0) {
1391 attributeFound =
true;
1396 if (attrId == attrIdRequested) {
1397 attributeFound =
true;
1402 ndbassert(dictInfoReader.getKey() == DictTabInfo::AttributeEnd);
1403 dictInfoReader.next();
1409 if (!attributeFound) {
1411 sendUtilPrepareRef(signal,
1412 UtilPrepareRef::DICT_TAB_INFO_ERROR,
1413 prepPtr.p->clientRef, prepPtr.p->clientData);
1414 infoEvent(
"UTIL: Unknown attribute requested: %s in table: %s",
1415 attrNameRequested, tableName);
1416 releasePreparedOperation(prepOpPtr);
1417 releasePrepare(prepPtr);
1427 if (attrDesc.AttributeKeyFlag) {
1429 prepOpPtr.p->pkBitmask.set(attrDesc.AttributeId);
1430 attrMap.setDataSize(noOfKeysFound - 1);
1431 noOfPKAttribsStored++;
1433 attrMap.setDataSize(0x3fff);
1434 noOfNonPKAttribsStored++;
1439 if (noOfPKAttribsStored != tableDesc.NoOfKeyAttr) {
1441 sendUtilPrepareRef(signal,
1442 UtilPrepareRef::DICT_TAB_INFO_ERROR,
1443 prepPtr.p->clientRef, prepPtr.p->clientData);
1444 infoEvent(
"UTIL: Non-PK attr not allowed before "
1445 "all PK attrs have been defined, table: %s",
1447 releasePreparedOperation(prepOpPtr);
1448 releasePrepare(prepPtr);
1452 *(attrMappingIt.data) = attrMap.m_value;
1454 ndbout <<
"BEFORE: attrLength: " << attrLength << endl;
1458 switch (attrDesc.AttributeSize) {
1459 case DictTabInfo::an8Bit:
1460 len = (attrDesc.AttributeArraySize + 3)/ 4;
1462 case DictTabInfo::a16Bit:
1463 len = (attrDesc.AttributeArraySize + 1) / 2;
1465 case DictTabInfo::a32Bit:
1466 len = attrDesc.AttributeArraySize;
1468 case DictTabInfo::a64Bit:
1469 len = attrDesc.AttributeArraySize * 2;
1471 case DictTabInfo::a128Bit:
1472 len = attrDesc.AttributeArraySize * 4;
1477 if (operationType == UtilPrepareReq::Read) {
1479 attrDesc.AttributeId,
1481 prepOpPtr.p->rsInfo.next(rsInfoIt, 1);
1485 ndbout <<
": AttributeSize: " << attrDesc.AttributeSize << endl;
1486 ndbout <<
": AttributeArraySize: " << attrDesc.AttributeArraySize << endl;
1487 ndbout <<
"AFTER: attrLength: " << attrLength << endl;
1491 prepPtr.p->prepOpPtr.p->attrMapping.next(attrMappingIt, 1);
1497 if (noOfPKAttribsStored != tableDesc.NoOfKeyAttr) {
1499 sendUtilPrepareRef(signal,
1500 UtilPrepareRef::DICT_TAB_INFO_ERROR,
1501 prepPtr.p->clientRef, prepPtr.p->clientData);
1502 infoEvent(
"UTIL: Not all primary key attributes requested for table: %s",
1504 releasePreparedOperation(prepOpPtr);
1505 releasePrepare(prepPtr);
1510 AttrMappingBuffer::ConstDataBufferIterator tmpIt;
1511 for (prepPtr.p->prepOpPtr.p->attrMapping.first(tmpIt); tmpIt.curr.i != RNIL;
1512 prepPtr.p->prepOpPtr.p->attrMapping.next(tmpIt)) {
1521 Uint32 static_len = TcKeyReq::StaticLength;
1522 Uint32 requestInfo = 0;
1526 TcKeyReq::setScanIndFlag(requestInfo, 1);
1530 TcKeyReq::setReorgFlag(requestInfo, 1);
1532 prepOpPtr.p->tckey.tableId = tableDesc.TableId;
1533 prepOpPtr.p->tckey.tableSchemaVersion = tableDesc.TableVersion;
1534 prepOpPtr.p->noOfKeyAttr = tableDesc.NoOfKeyAttr;
1535 prepOpPtr.p->tckeyLen = static_len;
1536 prepOpPtr.p->keyDataPos = static_len;
1538 TcKeyReq::setAbortOption(requestInfo, TcKeyReq::AbortOnError);
1539 TcKeyReq::setKeyLength(requestInfo, tableDesc.KeyLength);
1540 switch(operationType) {
1541 case(UtilPrepareReq::Read):
1542 prepOpPtr.p->rsLen =
1544 tableDesc.NoOfKeyAttr +
1545 noOfNonPKAttribsStored;
1546 prepOpPtr.p->noOfAttr = tableDesc.NoOfKeyAttr + noOfNonPKAttribsStored;
1547 prepOpPtr.p->tckey.attrLen = prepOpPtr.p->noOfAttr;
1548 TcKeyReq::setOperationType(requestInfo, ZREAD);
1550 case(UtilPrepareReq::Update):
1551 prepOpPtr.p->rsLen = 0;
1552 prepOpPtr.p->noOfAttr = tableDesc.NoOfKeyAttr + noOfNonPKAttribsStored;
1553 prepOpPtr.p->tckey.attrLen = attrLength + prepOpPtr.p->noOfAttr;
1554 TcKeyReq::setOperationType(requestInfo, ZUPDATE);
1556 case(UtilPrepareReq::Insert):
1557 prepOpPtr.p->rsLen = 0;
1558 prepOpPtr.p->noOfAttr = tableDesc.NoOfKeyAttr + noOfNonPKAttribsStored;
1559 prepOpPtr.p->tckey.attrLen = attrLength + prepOpPtr.p->noOfAttr;
1560 TcKeyReq::setOperationType(requestInfo, ZINSERT);
1562 case(UtilPrepareReq::Delete):
1564 ndbrequire(tableDesc.KeyLength == attrLength);
1565 prepOpPtr.p->rsLen = 0;
1566 prepOpPtr.p->noOfAttr = tableDesc.NoOfKeyAttr;
1567 prepOpPtr.p->tckey.attrLen = 0;
1568 TcKeyReq::setOperationType(requestInfo, ZDELETE);
1570 case(UtilPrepareReq::Write):
1571 prepOpPtr.p->rsLen = 0;
1572 prepOpPtr.p->noOfAttr = tableDesc.NoOfKeyAttr + noOfNonPKAttribsStored;
1573 prepOpPtr.p->tckey.attrLen = attrLength + prepOpPtr.p->noOfAttr;
1574 TcKeyReq::setOperationType(requestInfo, ZWRITE);
1577 TcKeyReq::setAIInTcKeyReq(requestInfo, 0);
1578 prepOpPtr.p->tckey.requestInfo = requestInfo;
1584 conf->senderData = prepPtr.p->clientData;
1585 conf->prepareId = prepPtr.p->prepOpPtr.i;
1587 sendSignal(prepPtr.p->clientRef, GSN_UTIL_PREPARE_CONF, signal,
1588 UtilPrepareConf::SignalLength, JBB);
1591 prepPtr.p->prepOpPtr.p->print();
1593 releasePrepare(prepPtr);
1602 const Uint32 clientRef = signal->senderBlockRef();
1603 const Uint32 prepareId = req->prepareId;
1604 const Uint32 senderData = req->senderData;
1610 if (!c_preparedOperationPool.isSeized(prepareId)) {
1612 ref->prepareId = prepareId;
1613 ref->errorCode = UtilReleaseRef::NO_SUCH_PREPARE_SEIZED;
1614 sendSignal(clientRef, GSN_UTIL_RELEASE_REF, signal,
1615 UtilReleaseRef::SignalLength, JBB);
1619 c_preparedOperationPool.
getPtr(prepOpPtr, prepareId);
1621 releasePreparedOperation(prepOpPtr);
1624 conf->senderData = senderData;
1625 sendSignal(clientRef, GSN_UTIL_RELEASE_CONF, signal,
1626 UtilReleaseConf::SignalLength, JBB);
1646 ndbrequire(c_preparedOperationPool.
seizeId(ptr, 0));
1647 ptr.p->tckey.attrLen = 1;
1649 ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + ptr.p->tckey.attrLen;
1650 ptr.p->keyDataPos = TcKeyReq::StaticLength;
1651 ptr.p->tckey.tableId = SYSTAB_0;
1652 Uint32 requestInfo = 0;
1653 TcKeyReq::setAbortOption(requestInfo, TcKeyReq::CommitIfFailFree);
1654 TcKeyReq::setOperationType(requestInfo, ZREAD);
1655 TcKeyReq::setKeyLength(requestInfo, 1);
1656 TcKeyReq::setAIInTcKeyReq(requestInfo, 1);
1657 ptr.p->tckey.requestInfo = requestInfo;
1658 ptr.p->tckey.tableSchemaVersion = 1;
1663 ndbrequire(ptr.p->rsInfo.
seize(1));
1664 ResultSetInfoBuffer::DataBufferIterator it;
1665 ptr.p->rsInfo.
first(it);
1674 ndbrequire(c_preparedOperationPool.
seizeId(ptr, 1));
1676 ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + 5;
1677 ptr.p->keyDataPos = TcKeyReq::StaticLength;
1678 ptr.p->tckey.attrLen = 11;
1679 ptr.p->tckey.tableId = SYSTAB_0;
1680 Uint32 requestInfo = 0;
1681 TcKeyReq::setAbortOption(requestInfo, TcKeyReq::CommitIfFailFree);
1682 TcKeyReq::setOperationType(requestInfo, ZUPDATE);
1683 TcKeyReq::setKeyLength(requestInfo, 1);
1684 TcKeyReq::setAIInTcKeyReq(requestInfo, 5);
1685 TcKeyReq::setInterpretedFlag(requestInfo, 1);
1686 ptr.p->tckey.requestInfo = requestInfo;
1687 ptr.p->tckey.tableSchemaVersion = 1;
1691 Uint32 * attrInfo = &ptr.p->tckey.distrGroupHashValue;
1699 ndbrequire(ptr.p->attrInfo.
seize(6));
1700 AttrInfoBuffer::DataBufferIterator it;
1701 ptr.p->attrInfo.
first(it);
1703 ndbrequire(ptr.p->attrInfo.next(it));
1704 * it.data = Interpreter::LoadConst16(7, 1);
1705 ndbrequire(ptr.p->attrInfo.next(it));
1706 * it.data = Interpreter::Add(7, 6, 7);
1707 ndbrequire(ptr.p->attrInfo.next(it));
1708 * it.data = Interpreter::Write(1, 7);
1709 ndbrequire(ptr.p->attrInfo.next(it));
1710 * it.data = Interpreter::ExitOK();
1712 ndbrequire(ptr.p->attrInfo.next(it));
1717 ndbrequire(ptr.p->rsInfo.
seize(1));
1718 ResultSetInfoBuffer::DataBufferIterator it;
1719 ptr.p->rsInfo.
first(it);
1729 ndbrequire(c_preparedOperationPool.
seizeId(ptr, 2));
1730 ptr.p->tckey.attrLen = 5;
1732 ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + ptr.p->tckey.attrLen;
1733 ptr.p->keyDataPos = TcKeyReq::StaticLength;
1734 ptr.p->tckey.tableId = SYSTAB_0;
1735 Uint32 requestInfo = 0;
1736 TcKeyReq::setAbortOption(requestInfo, TcKeyReq::CommitIfFailFree);
1737 TcKeyReq::setOperationType(requestInfo, ZINSERT);
1738 TcKeyReq::setKeyLength(requestInfo, 1);
1739 TcKeyReq::setAIInTcKeyReq(requestInfo, 0);
1740 ptr.p->tckey.requestInfo = requestInfo;
1741 ptr.p->tckey.tableSchemaVersion = 1;
1749 ndbrequire(c_preparedOperationPool.
seizeId(ptr, 3));
1751 ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + 5;
1752 ptr.p->keyDataPos = TcKeyReq::StaticLength;
1753 ptr.p->tckey.attrLen = 9;
1754 ptr.p->tckey.tableId = SYSTAB_0;
1755 Uint32 requestInfo = 0;
1756 TcKeyReq::setAbortOption(requestInfo, TcKeyReq::CommitIfFailFree);
1757 TcKeyReq::setOperationType(requestInfo, ZUPDATE);
1758 TcKeyReq::setKeyLength(requestInfo, 1);
1759 TcKeyReq::setAIInTcKeyReq(requestInfo, 5);
1760 TcKeyReq::setInterpretedFlag(requestInfo, 1);
1761 ptr.p->tckey.requestInfo = requestInfo;
1762 ptr.p->tckey.tableSchemaVersion = 1;
1764 Uint32 * attrInfo = &ptr.p->tckey.distrGroupHashValue;
1783 switch(req->requestType){
1784 case UtilSequenceReq::CurrVal:
1785 prepOp = c_preparedOperationPool.
getPtr(0);
1787 case UtilSequenceReq::NextVal:
1788 prepOp = c_preparedOperationPool.
getPtr(1);
1790 case UtilSequenceReq::Create:
1791 prepOp = c_preparedOperationPool.
getPtr(2);
1793 case UtilSequenceReq::SetVal:{
1794 prepOp = c_preparedOperationPool.
getPtr(3);
1806 ndbrequire(c_runningTransactions.
seize(transPtr));
1809 ndbrequire(transPtr.p->operations.seize(opPtr));
1811 ndbrequire(opPtr.p->keyInfo.seize(1));
1813 transPtr.p->gci_hi = 0;
1814 transPtr.p->gci_lo = 0;
1815 transPtr.p->gsn = GSN_UTIL_SEQUENCE_REQ;
1816 transPtr.p->clientRef = signal->senderBlockRef();
1817 transPtr.p->clientData = req->senderData;
1818 transPtr.p->sequence.sequenceId = req->sequenceId;
1819 transPtr.p->sequence.requestType = req->requestType;
1821 opPtr.p->prepOp = prepOp;
1822 opPtr.p->prepOp_i = RNIL;
1824 KeyInfoBuffer::DataBufferIterator it;
1825 opPtr.p->keyInfo.first(it);
1826 it.data[0] = transPtr.p->sequence.sequenceId;
1828 if(req->requestType == UtilSequenceReq::Create){
1829 ndbrequire(opPtr.p->attrInfo.seize(5));
1830 AttrInfoBuffer::DataBufferIterator it;
1832 opPtr.p->attrInfo.first(it);
1835 ndbrequire(opPtr.p->attrInfo.next(it));
1836 * it.data = transPtr.p->sequence.sequenceId;
1838 ndbrequire(opPtr.p->attrInfo.next(it));
1841 ndbrequire(opPtr.p->attrInfo.next(it));
1844 ndbrequire(opPtr.p->attrInfo.next(it));
1848 if(req->requestType == UtilSequenceReq::SetVal)
1850 ndbrequire(opPtr.p->attrInfo.seize(4));
1851 AttrInfoBuffer::DataBufferIterator it;
1852 opPtr.p->attrInfo.first(it);
1853 * it.data = Interpreter::LoadConst32(7);
1854 ndbrequire(opPtr.p->attrInfo.next(it));
1855 * it.data = req->value;
1856 ndbrequire(opPtr.p->attrInfo.next(it));
1857 * it.data = Interpreter::Write(1, 7);
1858 ndbrequire(opPtr.p->attrInfo.next(it))
1859 * it.data = Interpreter::ExitOK();
1862 transPtr.p->noOfRetries = 3;
1863 runTransaction(signal, transPtr);
1867 DbUtil::getResultSet(
Signal* signal,
const Transaction * transP,
1870 ndbrequire(transP->operations.first(opPtr));
1871 ndbrequire(transP->operations.hasNext(opPtr) ==
false);
1875 Uint32* tmpBuf = signal->theData + 25;
1876 const Uint32* headerBuffer = tmpBuf;
1878 const ResultSetBuffer & rs = opPtr.p->rs;
1879 ResultSetInfoBuffer::ConstDataBufferIterator it;
1882 for(rs.first(it); it.curr.i != RNIL; ) {
1883 *tmpBuf++ = it.data[0];
1884 rs.next(it, AttributeHeader::getDataSize(it.data[0]) + 1);
1891 const Uint32* dataBuffer = tmpBuf;
1894 for(rs.first(it); it.curr.i != RNIL; )
1897 int sz = AttributeHeader::getDataSize(it.data[0]);
1899 for (
int i = 0;
i < sz;
i++)
1901 *tmpBuf++ = *it.data;
1907 sectionsPtr[UtilExecuteReq::HEADER_SECTION].p = (Uint32 *)headerBuffer;
1908 sectionsPtr[UtilExecuteReq::HEADER_SECTION].sz = noAttr;
1909 sectionsPtr[UtilExecuteReq::DATA_SECTION].p = (Uint32 *)dataBuffer;
1910 sectionsPtr[UtilExecuteReq::DATA_SECTION].sz = dataSz;
1916 DbUtil::reportSequence(
Signal* signal,
const Transaction * transP){
1918 ndbrequire(transP->operations.first(opPtr));
1919 ndbrequire(transP->operations.hasNext(opPtr) ==
false);
1921 if(transP->errorCode == 0){
1925 ret->senderData = transP->clientData;
1926 ret->sequenceId = transP->sequence.sequenceId;
1927 ret->requestType = transP->sequence.requestType;
1930 switch(transP->sequence.requestType){
1931 case UtilSequenceReq::CurrVal:
1932 case UtilSequenceReq::NextVal:{
1934 ndbrequire(opPtr.p->rsRecv == 3);
1936 ResultSetBuffer::DataBufferIterator rsit;
1937 ndbrequire(opPtr.p->rs.first(rsit));
1939 ret->sequenceValue[0] = rsit.data[1];
1940 ret->sequenceValue[1] = rsit.data[2];
1943 case UtilSequenceReq::SetVal:
1945 case UtilSequenceReq::Create:
1947 ret->sequenceValue[0] = 0;
1948 ret->sequenceValue[1] = 0;
1952 sendSignal(transP->clientRef, GSN_UTIL_SEQUENCE_CONF, signal,
1953 UtilSequenceConf::SignalLength, JBB);
1957 UtilSequenceRef::ErrorCode errCode = UtilSequenceRef::TCError;
1959 switch(transP->sequence.requestType)
1961 case UtilSequenceReq::SetVal:
1962 case UtilSequenceReq::CurrVal:
1963 case UtilSequenceReq::NextVal:{
1964 if (transP->errorCode == 626)
1965 errCode = UtilSequenceRef::NoSuchSequence;
1968 case UtilSequenceReq::Create:
1973 ret->senderData = transP->clientData;
1974 ret->sequenceId = transP->sequence.sequenceId;
1975 ret->requestType = transP->sequence.requestType;
1976 ret->errorCode = (Uint32)errCode;
1977 ret->TCErrorCode = transP->errorCode;
1978 sendSignal(transP->clientRef, GSN_UTIL_SEQUENCE_REF, signal,
1979 UtilSequenceRef::SignalLength, JBB);
1982 Ndb ndb(
"ndb",
"def");
1987 if( tOperation != NULL ) {
1989 tOperation->
equal((U_Int32)0, keyValue );
1990 tNextId_Result = tOperation->
getValue((U_Int32)1);
1991 tOperation->
incValue((U_Int32)1, (U_Int32)8192);
1993 if (tConnection->
execute( Commit ) != -1 ) {
1994 U_Int64 tValue = tNextId_Result->u_64_value();
1995 theFirstTransId = tValue;
1996 theLastTransId = tValue + 8191;
1997 closeTransaction(tConnection);
1998 return startTransactionLocal(aPriority, nodeId);
2025 const Uint32 clientRef = req->senderRef;
2026 const Uint32 clientData = req->senderData;
2027 const Uint32 prepareId = req->getPrepareId();
2028 const bool releaseFlag = req->getReleaseFlag();
2029 const Uint32 scanTakeOver = req->scanTakeOver;
2031 if(signal->getNoOfSections() == 0) {
2034 sendUtilExecuteRef(signal, UtilExecuteRef::MissingDataSection,
2035 0, clientRef, clientData);
2042 c_preparedOperationPool.
getPtr(prepOpPtr, prepareId);
2044 prepOpPtr.p->releaseFlag = releaseFlag;
2051 handle.getSection(headerPtr, UtilExecuteReq::HEADER_SECTION);
2052 SectionReader headerReader(headerPtr, getSectionSegmentPool());
2053 handle.getSection(dataPtr, UtilExecuteReq::DATA_SECTION);
2056 #if 0 //def EVENT_DEBUG
2058 printf(
"DbUtil::execUTIL_EXECUTEL_REQ: Headers (%u): ", headerPtr.sz);
2060 while(headerReader.getWord(&word))
2061 printf(
"H'%.8x ", word);
2063 printf(
"DbUtil::execUTIL_EXECUTEL_REQ: Data (%u): ", dataPtr.sz);
2064 headerReader.reset();
2065 while(dataReader.getWord(&word))
2066 printf(
"H'%.8x ", word);
2076 ndbrequire(c_runningTransactions.
seize(transPtr));
2077 transPtr.p->gci_hi = 0;
2078 transPtr.p->gci_lo = 0;
2079 transPtr.p->gsn = GSN_UTIL_EXECUTE_REQ;
2080 transPtr.p->clientRef = clientRef;
2081 transPtr.p->clientData = clientData;
2082 ndbrequire(transPtr.p->operations.seize(opPtr));
2083 opPtr.p->prepOp = prepOpPtr.p;
2084 opPtr.p->prepOp_i = prepOpPtr.i;
2085 opPtr.p->m_scanTakeOver = scanTakeOver;
2093 Uint32* tempBuf = signal->theData + 25;
2094 bool dataComplete =
true;
2096 while(headerReader.getWord((Uint32 *)&header)) {
2097 Uint32* bufStart = tempBuf;
2099 for(
unsigned int i = 0;
i < header.getDataSize();
i++) {
2100 if (!dataReader.getWord(tempBuf++)) {
2101 dataComplete =
false;
2107 #if 0 //def EVENT_DEBUG
2108 if (TcKeyReq::getOperationType(prepOpPtr.p->tckey.requestInfo) ==
2111 printf(
"PrimaryKey\n");
2113 printf(
"AttrId %u Hdrsz %d Datasz %u \n",
2116 header.getDataSize());
2122 header.getDataSize());
2124 switch (TcKeyReq::getOperationType(prepOpPtr.p->tckey.requestInfo)) {
2132 res &= attrInfo->
append(bufStart,
2139 releaseSections(handle);
2140 sendUtilExecuteRef(signal, UtilExecuteRef::AllocationError,
2141 0, clientRef, clientData);
2142 releaseTransaction(transPtr);
2146 if (!dataComplete) {
2149 releaseSections(handle);
2150 sendUtilExecuteRef(signal, UtilExecuteRef::MissingData,
2151 0, clientRef, clientData);
2152 releaseTransaction(transPtr);
2157 const Uint32 l1 = prepOpPtr.p->tckey.attrLen;
2159 prepOpPtr.p->attrInfo.
getSize() + opPtr.p->attrInfo.getSize();
2161 if (TcKeyReq::getOperationType(prepOpPtr.p->tckey.requestInfo) != ZREAD){
2162 ndbrequire(l1 == l2);
2164 ndbout_c(
"TcKeyReq::Read");
2168 releaseSections(handle);
2169 transPtr.p->noOfRetries = 3;
2170 runTransaction(signal, transPtr);
2180 DbUtil::runTransaction(
Signal* signal, TransactionPtr transPtr){
2183 transPtr.p->sent = 0;
2184 transPtr.p->recv = 0;
2185 transPtr.p->errorCode = 0;
2186 getTransId(transPtr.p);
2189 ndbrequire(transPtr.p->operations.first(opPtr));
2193 TcKeyReq::setStartFlag(start, 1);
2195 transPtr.p->sent ++;
2199 while(opPtr.i != RNIL){
2201 transPtr.p->sent ++;
2209 Uint32 opI = opPtr.i;
2213 if(!transPtr.p->operations.next(opPtr)){
2214 TcKeyReq::setCommitFlag(start, 1);
2215 TcKeyReq::setExecuteFlag(start, 1);
2218 #if 0 //def EVENT_DEBUG
2219 if (TcKeyReq::getOperationType(pop->tckey.requestInfo) ==
2221 printf(
"TcKeyReq::Read runOperation\n");
2229 #if 0 //def EVENT_DEBUG
2230 printf(
"pop->rsLen %u\n", pop->rsLen);
2233 op->transPtrI = transPtr.i;
2237 memcpy(tcKey, &pop->tckey, 4*pop->tckeyLen);
2241 tcKey->apiConnectPtr = transPtr.p->connectPtr;
2242 tcKey->senderData = opI;
2243 tcKey->transId1 = transPtr.p->transId[0];
2244 tcKey->transId2 = transPtr.p->transId[1];
2245 tcKey->requestInfo |= start;
2247 if (TcKeyReq::getScanIndFlag(tcKey->requestInfo))
2249 tcKey->scanInfo = op->m_scanTakeOver;
2252 #if 0 //def EVENT_DEBUG
2254 printf(
"DbUtil::runOperation: KEYINFO\n");
2255 op->keyInfo.print(stdout);
2256 printf(
"DbUtil::runOperation: ATTRINFO\n");
2257 op->attrInfo.print(stdout);
2260 Uint32 attrLen = pop->attrInfo.
getSize() + op->attrInfo.
getSize();
2261 Uint32 keyLen = op->keyInfo.
getSize();
2262 tcKey->attrLen = attrLen + TcKeyReq::getAIInTcKeyReq(tcKey->requestInfo);
2263 TcKeyReq::setKeyLength(tcKey->requestInfo, keyLen);
2269 KeyInfoIterator kit;
2270 op->keyInfo.
first(kit);
2271 Uint32 *keyDst = ((Uint32*)tcKey) + pop->keyDataPos;
2272 for(Uint32
i = 0;
i<8 && kit.curr.i != RNIL;
i++, op->keyInfo.next(kit)){
2273 keyDst[
i] = * kit.data;
2279 #if 0 //def EVENT_DEBUG
2280 printf(
"DbUtil::runOperation: sendSignal(DBTC_REF, GSN_TCKEYREQ, signal, %d , JBB)\n", pop->tckeyLenInBytes >> 2);
2281 printTCKEYREQ(stdout, signal->getDataPtr(), pop->tckeyLenInBytes >> 2,0);
2283 Uint32 sigLen = pop->tckeyLen + (keyLen > 8 ? 8 : keyLen);
2284 sendSignal(transPtr.p->connectRef, GSN_TCKEYREQ, signal, sigLen, JBB);
2295 keyInfo->connectPtr = transPtr.p->connectPtr;
2296 keyInfo->transId[0] = transPtr.p->transId[0];
2297 keyInfo->transId[1] = transPtr.p->transId[1];
2298 sendKeyInfo(signal, transPtr.p->connectRef,
2299 keyInfo, op->keyInfo, kit);
2305 attrInfo->connectPtr = transPtr.p->connectPtr;
2306 attrInfo->transId[0] = transPtr.p->transId[0];
2307 attrInfo->transId[1] = transPtr.p->transId[1];
2309 AttrInfoIterator ait;
2310 pop->attrInfo.
first(ait);
2311 sendAttrInfo(signal, transPtr.p->connectRef,
2312 attrInfo, pop->attrInfo, ait);
2314 op->attrInfo.
first(ait);
2315 sendAttrInfo(signal, transPtr.p->connectRef,
2316 attrInfo, op->attrInfo, ait);
2320 DbUtil::sendKeyInfo(
Signal* signal,
2323 const KeyInfoBuffer & keyBuf,
2324 KeyInfoIterator & kit)
2326 while(kit.curr.i != RNIL) {
2327 Uint32 *keyDst = keyInfo->keyData;
2328 Uint32 keyDataLen = 0;
2329 for(Uint32
i = 0;
i<KeyInfo::DataLength && kit.curr.i != RNIL;
2330 i++, keyBuf.next(kit)){
2331 keyDst[
i] = * kit.data;
2334 #if 0 //def EVENT_DEBUG
2335 printf(
"DbUtil::sendKeyInfo: sendSignal(DBTC_REF, GSN_KEYINFO, signal, %d , JBB)\n", KeyInfo::HeaderLength + keyDataLen);
2337 sendSignal(tcRef, GSN_KEYINFO, signal,
2338 KeyInfo::HeaderLength + keyDataLen, JBB);
2343 DbUtil::sendAttrInfo(
Signal* signal,
2346 const AttrInfoBuffer & attrBuf,
2347 AttrInfoIterator & ait)
2349 while(ait.curr.i != RNIL) {
2350 Uint32 *attrDst = attrInfo->attrData;
2352 for(i = 0; i<AttrInfo::DataLength && ait.curr.i != RNIL;
2353 i++, attrBuf.next(ait)){
2354 attrDst[
i] = * ait.data;
2356 #if 0 //def EVENT_DEBUG
2357 printf(
"DbUtil::sendAttrInfo: sendSignal(DBTC_REF, GSN_ATTRINFO, signal, %d , JBB)\n", AttrInfo::HeaderLength + i);
2359 sendSignal(tcRef, GSN_ATTRINFO, signal,
2360 AttrInfo::HeaderLength + i, JBB);
2365 DbUtil::getTransId(Transaction * transP){
2368 tmp[0] = c_transId[0];
2369 tmp[1] = c_transId[1];
2371 transP->transId[0] = tmp[0];
2372 transP->transId[1] = tmp[1];
2374 c_transId[1] = tmp[1] + 1;
2398 #if 0 //def EVENT_DEBUG
2399 ndbout_c(
"File: %s line: %u",__FILE__,__LINE__);
2402 const Uint32 opI = signal->theData[0];
2403 const Uint32 transId1 = signal->theData[1];
2404 const Uint32 transId2 = signal->theData[2];
2407 bool longSignal = (handle.m_cnt == 1);
2412 ndbrequire(handle.getSection(dataPtr, 0));
2413 dataLen = dataPtr.sz;
2417 dataLen = signal->
length() - 3;
2422 c_runningTransactions.
getPtr(transPtr, opP->transPtrI);
2424 ndbrequire(transId1 == transPtr.p->transId[0] &&
2425 transId2 == transPtr.p->transId[1]);
2426 opP->rsRecv += dataLen;
2434 while (dataLen > NDB_SECTION_SEGMENT_SZ)
2436 ndbrequire(opP->rs.
append(ptrP->theData, NDB_SECTION_SEGMENT_SZ));
2437 dataLen -= NDB_SECTION_SEGMENT_SZ;
2438 ptrP = g_sectionSegmentPool.
getPtr(ptrP->m_nextSegment);
2440 ndbrequire(opP->rs.
append(ptrP->theData, dataLen));
2442 releaseSections(handle);
2446 const Uint32 *src = &signal->theData[3];
2447 ndbrequire(opP->rs.
append(src, dataLen));
2450 if(!opP->complete()){
2456 if(!transPtr.p->complete()){
2461 finishTransaction(signal, transPtr);
2467 #if 0 //def EVENT_DEBUG
2468 ndbout_c(
"File: %s line: %u",__FILE__,__LINE__);
2474 const Uint32 gci_hi = keyConf->gci_hi;
2475 const Uint32 transI = keyConf->apiConnectPtr >> 1;
2476 const Uint32 confInfo = keyConf->confInfo;
2477 const Uint32 transId1 = keyConf->transId1;
2478 const Uint32 transId2 = keyConf->transId2;
2481 const Uint32 ops = TcKeyConf::getNoOfOperations(confInfo);
2482 for(Uint32 i = 0; i<ops; i++){
2484 c_operationPool.
getPtr(opPtr, keyConf->operations[i].apiOperationPtr);
2486 ndbrequire(opPtr.p->transPtrI == transI);
2487 opPtr.p->rsExpect += keyConf->operations[
i].attrInfoLen;
2488 if(opPtr.p->complete()){
2493 if (TcKeyConf::getCommitFlag(confInfo))
2496 gci_lo = keyConf->operations[ops].apiOperationPtr;
2500 c_runningTransactions.
getPtr(transPtr, transI);
2505 if (TcKeyConf::getMarkerFlag(confInfo))
2508 signal->theData[0] = transId1;
2509 signal->theData[1] = transId2;
2510 sendSignal(transPtr.p->connectRef, GSN_TC_COMMIT_ACK, signal, 2, JBB);
2513 ndbrequire(transId1 == transPtr.p->transId[0] &&
2514 transId2 == transPtr.p->transId[1]);
2516 if (TcKeyConf::getCommitFlag(confInfo))
2519 transPtr.p->gci_hi = gci_hi;
2520 transPtr.p->gci_lo = gci_lo;
2523 transPtr.p->recv += recv;
2524 if(!transPtr.p->complete()){
2528 finishTransaction(signal, transPtr);
2532 DbUtil::execTCKEYREF(
Signal* signal){
2534 #if 0 //def EVENT_DEBUG
2535 ndbout_c(
"File: %s line: %u",__FILE__,__LINE__);
2538 const Uint32 transI = signal->theData[0] >> 1;
2539 const Uint32 transId1 = signal->theData[1];
2540 const Uint32 transId2 = signal->theData[2];
2541 const Uint32 errCode = signal->theData[3];
2543 TransactionPtr transPtr;
2544 c_runningTransactions.
getPtr(transPtr, transI);
2545 ndbrequire(transId1 == transPtr.p->transId[0] &&
2546 transId2 == transPtr.p->transId[1]);
2553 transPtr.p->errorCode = errCode;
2554 finishTransaction(signal, transPtr);
2558 DbUtil::execTCROLLBACKREP(
Signal* signal){
2560 #if 0 //def EVENT_DEBUG
2561 ndbout_c(
"File: %s line: %u",__FILE__,__LINE__);
2564 const Uint32 transI = signal->theData[0] >> 1;
2565 const Uint32 transId1 = signal->theData[1];
2566 const Uint32 transId2 = signal->theData[2];
2567 const Uint32 errCode = signal->theData[3];
2569 TransactionPtr transPtr;
2570 c_runningTransactions.
getPtr(transPtr, transI);
2571 ndbrequire(transId1 == transPtr.p->transId[0] &&
2572 transId2 == transPtr.p->transId[1]);
2577 #if 0 //def EVENT_DEBUG
2578 ndbout <<
"Transaction error (code: " << errCode <<
")" << endl;
2581 if(transPtr.p->noOfRetries > 0){
2582 transPtr.p->noOfRetries--;
2588 ndbout_c(
"errCode: %d noOfRetries: %d -> retry",
2589 errCode, transPtr.p->noOfRetries);
2591 runTransaction(signal, transPtr);
2596 transPtr.p->errorCode = errCode;
2597 finishTransaction(signal, transPtr);
2601 DbUtil::finishTransaction(
Signal* signal, TransactionPtr transPtr){
2602 #if 0 //def EVENT_DEBUG
2603 ndbout_c(
"Transaction %x %x completed %s",
2604 transPtr.p->transId[0],
2605 transPtr.p->transId[1],
2606 transPtr.p->errorCode == 0 ?
"OK" :
"FAILED");
2623 switch(transPtr.p->gsn){
2624 case GSN_UTIL_SEQUENCE_REQ:
2626 reportSequence(signal, transPtr.p);
2628 case GSN_UTIL_EXECUTE_REQ:
2629 if (transPtr.p->errorCode) {
2631 ret->senderData = transPtr.p->clientData;
2632 ret->errorCode = UtilExecuteRef::TCError;
2633 ret->TCErrorCode = transPtr.p->errorCode;
2634 sendSignal(transPtr.p->clientRef, GSN_UTIL_EXECUTE_REF, signal,
2635 UtilExecuteRef::SignalLength, JBB);
2639 ret->senderData = transPtr.p->clientData;
2640 ret->gci_hi = transPtr.p->gci_hi;
2641 ret->gci_lo = transPtr.p->gci_lo;
2642 if (getResultSet(signal, transPtr.p, sectionsPtr)) {
2643 #if 0 //def EVENT_DEBUG
2644 for (
int j = 0; j < 2; j++) {
2645 printf(
"Result set %u %u\n", j,sectionsPtr[j].sz);
2646 for (
int i=0; i < sectionsPtr[j].sz; i++)
2647 printf(
"H'%.8x ", sectionsPtr[j].p[i]);
2651 sendSignal(transPtr.p->clientRef, GSN_UTIL_EXECUTE_CONF, signal,
2652 UtilExecuteConf::SignalLength, JBB,
2653 sectionsPtr, UtilExecuteReq::NoOfSections);
2655 sendSignal(transPtr.p->clientRef, GSN_UTIL_EXECUTE_CONF, signal,
2656 UtilExecuteConf::SignalLength, JBB);
2663 releaseTransaction(transPtr);
2667 DbUtil::execUTIL_LOCK_REQ(
Signal * signal){
2672 LockQueuePtr lockQPtr;
2673 if(!c_lockQueues.
find(lockQPtr, req.lockId))
2676 sendLOCK_REF(signal, &req, UtilLockRef::NoSuchLock);
2680 const Uint32 senderNode = refToNode(req.senderRef);
2681 if(senderNode != getOwnNodeId() && senderNode != 0)
2684 sendLOCK_REF(signal, &req, UtilLockRef::DistributedLockNotSupported);
2688 Uint32 res = lockQPtr.p->m_queue.lock(
this, c_lockElementPool, &req);
2690 case UtilLockRef::OK:
2692 sendLOCK_CONF(signal, &req);
2694 case UtilLockRef::OutOfLockRecords:
2696 sendLOCK_REF(signal, &req, UtilLockRef::OutOfLockRecords);
2698 case UtilLockRef::InLockQueue:
2700 if (req.requestInfo & UtilLockReq::Notify)
2703 sendLOCK_REF(signal, &req, UtilLockRef::InLockQueue);
2706 case UtilLockRef::LockAlreadyHeld:
2708 ndbassert(req.requestInfo & UtilLockReq::TryLock);
2709 sendLOCK_REF(signal, &req, UtilLockRef::LockAlreadyHeld);
2714 sendLOCK_REF(signal, &req, (UtilLockRef::ErrorCode)res);
2727 if(!c_lockQueues.
find(lockQPtr, req.lockId))
2730 sendUNLOCK_REF(signal, &req, UtilUnlockRef::NoSuchLock);
2734 Uint32 res = lockQPtr.p->m_queue.unlock(
this, c_lockElementPool, &req);
2736 case UtilUnlockRef::OK:
2738 case UtilUnlockRef::NotLockOwner: {
2741 conf->senderData = req.senderData;
2742 conf->senderRef = reference();
2743 conf->lockId = req.lockId;
2744 sendSignal(req.senderRef, GSN_UTIL_UNLOCK_CONF, signal,
2745 UtilUnlockConf::SignalLength, JBB);
2748 case UtilUnlockRef::NotInLockQueue:
2753 sendUNLOCK_REF(signal, &req, (UtilUnlockRef::ErrorCode)res);
2762 if (lockQPtr.p->m_queue.first(
this, c_lockElementPool, iter))
2765 while ((res = lockQPtr.p->m_queue.checkLockGrant(iter, &lockReq)) > 0)
2774 sendLOCK_CONF(signal, &lockReq);
2777 if (!lockQPtr.p->m_queue.next(iter))
2784 DbUtil::sendLOCK_REF(
Signal* signal,
2785 const UtilLockReq * req, UtilLockRef::ErrorCode err)
2787 const Uint32 senderData = req->senderData;
2788 const Uint32 senderRef = req->senderRef;
2789 const Uint32 lockId = req->lockId;
2790 const Uint32
extra = req->extra;
2793 ref->senderData = senderData;
2794 ref->senderRef = reference();
2795 ref->lockId = lockId;
2796 ref->errorCode = err;
2798 sendSignal(senderRef, GSN_UTIL_LOCK_REF, signal,
2799 UtilLockRef::SignalLength, JBB);
2805 const Uint32 senderData = req->senderData;
2806 const Uint32 senderRef = req->senderRef;
2807 const Uint32 lockId = req->lockId;
2808 const Uint32
extra = req->extra;
2811 conf->senderData = senderData;
2812 conf->senderRef = reference();
2813 conf->lockId = lockId;
2814 conf->extra = extra;
2815 sendSignal(senderRef, GSN_UTIL_LOCK_CONF, signal,
2816 UtilLockConf::SignalLength, JBB);
2820 DbUtil::sendUNLOCK_REF(
Signal* signal,
2823 const Uint32 senderData = req->senderData;
2824 const Uint32 senderRef = req->senderRef;
2825 const Uint32 lockId = req->lockId;
2828 ref->senderData = senderData;
2829 ref->senderRef = reference();
2830 ref->lockId = lockId;
2831 ref->errorCode = err;
2832 sendSignal(senderRef, GSN_UTIL_UNLOCK_REF, signal,
2833 UtilUnlockRef::SignalLength, JBB);
2837 DbUtil::execUTIL_CREATE_LOCK_REQ(
Signal* signal){
2841 UtilCreateLockRef::ErrorCode err = UtilCreateLockRef::OK;
2844 LockQueuePtr lockQPtr;
2845 if(c_lockQueues.
find(lockQPtr, req.lockId)){
2847 err = UtilCreateLockRef::LockIdAlreadyUsed;
2851 if(req.lockType != UtilCreateLockReq::Mutex){
2853 err = UtilCreateLockRef::UnsupportedLockType;
2857 if(!c_lockQueues.
seize(lockQPtr)){
2859 err = UtilCreateLockRef::OutOfLockQueueRecords;
2863 new (lockQPtr.p) LockQueueInstance(req.lockId);
2864 c_lockQueues.
add(lockQPtr);
2867 conf->senderData = req.senderData;
2868 conf->senderRef = reference();
2869 conf->lockId = req.lockId;
2871 sendSignal(req.senderRef, GSN_UTIL_CREATE_LOCK_CONF, signal,
2872 UtilCreateLockConf::SignalLength, JBB);
2877 ref->senderData = req.senderData;
2878 ref->senderRef = reference();
2879 ref->lockId = req.lockId;
2880 ref->errorCode = err;
2882 sendSignal(req.senderRef, GSN_UTIL_CREATE_LOCK_REF, signal,
2883 UtilCreateLockRef::SignalLength, JBB);
2891 UtilDestroyLockRef::ErrorCode err = UtilDestroyLockRef::OK;
2894 if(!c_lockQueues.
find(lockQPtr, req.lockId))
2897 err = UtilDestroyLockRef::NoSuchLock;
2902 if (lockQPtr.p->m_queue.first(
this, c_lockElementPool, iter) ==
false)
2905 err = UtilDestroyLockRef::NotLockOwner;
2909 if (! (iter.m_curr.p->m_req.senderData == req.senderData &&
2910 iter.m_curr.p->m_req.senderRef == req.senderRef &&
2911 (! (iter.m_curr.p->m_req.requestInfo & UtilLockReq::SharedLock)) &&
2912 iter.m_curr.p->m_req.requestInfo & UtilLockReq::Granted))
2915 err = UtilDestroyLockRef::NotLockOwner;
2923 while (lockQPtr.p->m_queue.next(iter))
2926 sendLOCK_REF(signal, &iter.m_curr.p->m_req, UtilLockRef::NoSuchLock);
2929 lockQPtr.p->m_queue.clear(c_lockElementPool);
2930 c_lockQueues.
release(lockQPtr);
2934 conf->senderData = req.senderData;
2935 conf->senderRef = reference();
2936 conf->lockId = req.lockId;
2937 sendSignal(req.senderRef, GSN_UTIL_DESTROY_LOCK_CONF, signal,
2938 UtilDestroyLockConf::SignalLength, JBB);
2943 ref->senderData = req.senderData;
2944 ref->senderRef = reference();
2945 ref->lockId = req.lockId;
2946 ref->errorCode = err;
2947 sendSignal(req.senderRef, GSN_UTIL_DESTROY_LOCK_REF, signal,
2948 UtilDestroyLockRef::SignalLength, JBB);