Commit 1984babb authored by unknown's avatar unknown

Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb

into  dator3.(none):/home/mikael/mysql_clones/rt-5.1

parents 8d8a3205 0c3f4648
...@@ -28,6 +28,7 @@ EXTRA_DIST = FINISH.sh \ ...@@ -28,6 +28,7 @@ EXTRA_DIST = FINISH.sh \
compile-alpha-debug \ compile-alpha-debug \
compile-amd64-debug-max \ compile-amd64-debug-max \
compile-amd64-max \ compile-amd64-max \
compile-amd64-max-sci \
compile-darwin-mwcc \ compile-darwin-mwcc \
compile-dist \ compile-dist \
compile-hpux11-parisc2-aCC \ compile-hpux11-parisc2-aCC \
...@@ -52,6 +53,7 @@ EXTRA_DIST = FINISH.sh \ ...@@ -52,6 +53,7 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-valgrind-max \ compile-pentium-valgrind-max \
compile-pentium64-debug \ compile-pentium64-debug \
compile-pentium64-debug-max \ compile-pentium64-debug-max \
compile-pentium64-max-sci \
compile-pentium64-valgrind-max \ compile-pentium64-valgrind-max \
compile-ppc \ compile-ppc \
compile-ppc-debug \ compile-ppc-debug \
......
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $fast_cflags -g"
extra_configs="$amd64_configs $max_configs --with-ndb-sci=/opt/DIS"
. "$path/FINISH.sh"
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags -g"
extra_configs="$pentium_configs $max_configs --with-ndb-sci=/opt/DIS"
. "$path/FINISH.sh"
...@@ -43,7 +43,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ...@@ -43,7 +43,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
if test -f "$mysql_sci_dir/lib/libsisci.a" -a \ if test -f "$mysql_sci_dir/lib/libsisci.a" -a \
-f "$mysql_sci_dir/include/sisci_api.h"; then -f "$mysql_sci_dir/include/sisci_api.h"; then
NDB_SCI_INCLUDES="-I$mysql_sci_dir/include" NDB_SCI_INCLUDES="-I$mysql_sci_dir/include"
NDB_SCI_LIBS="-L$mysql_sci_dir/lib -lsisci" NDB_SCI_LIBS="$mysql_sci_dir/lib/libsisci.a"
AC_MSG_RESULT([-- including sci transporter]) AC_MSG_RESULT([-- including sci transporter])
AC_DEFINE([NDB_SCI_TRANSPORTER], [1], AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
[Including Ndb Cluster DB sci transporter]) [Including Ndb Cluster DB sci transporter])
......
...@@ -95,6 +95,7 @@ INC_LIB= $(top_builddir)/regex/libregex.a \ ...@@ -95,6 +95,7 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/strings/libmystrings.a \ $(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \ $(top_builddir)/dbug/libdbug.a \
$(top_builddir)/vio/libvio.a \ $(top_builddir)/vio/libvio.a \
@NDB_SCI_LIBS@ \
@mysql_plugin_libs@ \ @mysql_plugin_libs@ \
$(yassl_inc_libs) $(yassl_inc_libs)
......
...@@ -36,7 +36,8 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \ ...@@ -36,7 +36,8 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \ -I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
$(openssl_includes) $(openssl_includes)
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs) LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
@NDB_SCI_LIBS@
mysqltest_embedded_LINK = $(CXXLINK) mysqltest_embedded_LINK = $(CXXLINK)
mysqltest_embedded_SOURCES = mysqltest.c mysqltest_embedded_SOURCES = mysqltest.c
......
...@@ -33,7 +33,7 @@ SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \ ...@@ -33,7 +33,7 @@ SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \
$(top_builddir)/regex/libregex.a \ $(top_builddir)/regex/libregex.a \
$(top_builddir)/strings/libmystrings.a $(top_builddir)/strings/libmystrings.a
mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS) mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS)
LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \ mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
@pstack_libs@ \ @pstack_libs@ \
@mysql_plugin_libs@ \ @mysql_plugin_libs@ \
......
...@@ -621,6 +621,14 @@ const GsnName SignalNames [] = { ...@@ -621,6 +621,14 @@ const GsnName SignalNames [] = {
,{ GSN_LCP_PREPARE_REF, "LCP_PREPARE_REF" } ,{ GSN_LCP_PREPARE_REF, "LCP_PREPARE_REF" }
,{ GSN_LCP_PREPARE_CONF, "LCP_PREPARE_CONF" } ,{ GSN_LCP_PREPARE_CONF, "LCP_PREPARE_CONF" }
,{ GSN_DICT_ABORT_REQ, "DICT_ABORT_REQ" }
,{ GSN_DICT_ABORT_REF, "DICT_ABORT_REF" }
,{ GSN_DICT_ABORT_CONF, "DICT_ABORT_CONF" }
,{ GSN_DICT_COMMIT_REQ, "DICT_COMMIT_REQ" }
,{ GSN_DICT_COMMIT_REF, "DICT_COMMIT_REF" }
,{ GSN_DICT_COMMIT_CONF, "DICT_COMMIT_CONF" }
/* DICT LOCK */ /* DICT LOCK */
,{ GSN_DICT_LOCK_REQ, "DICT_LOCK_REQ" } ,{ GSN_DICT_LOCK_REQ, "DICT_LOCK_REQ" }
,{ GSN_DICT_LOCK_CONF, "DICT_LOCK_CONF" } ,{ GSN_DICT_LOCK_CONF, "DICT_LOCK_CONF" }
......
...@@ -65,13 +65,10 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg, ...@@ -65,13 +65,10 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg,
m_initLocal=false; m_initLocal=false;
m_swapCounter=0;
m_failCounter=0; m_failCounter=0;
m_remoteNodes[0]=remoteSciNodeId0; m_remoteNodes[0]=remoteSciNodeId0;
m_remoteNodes[1]=remoteSciNodeId1; m_remoteNodes[1]=remoteSciNodeId1;
m_adapters = nAdapters; m_adapters = nAdapters;
// The maximum number of times to try and create,
// start and destroy a sequence
m_ActiveAdapterId=0; m_ActiveAdapterId=0;
m_StandbyAdapterId=1; m_StandbyAdapterId=1;
...@@ -102,8 +99,6 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg, ...@@ -102,8 +99,6 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg,
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
void SCI_Transporter::disconnectImpl() void SCI_Transporter::disconnectImpl()
{ {
DBUG_ENTER("SCI_Transporter::disconnectImpl"); DBUG_ENTER("SCI_Transporter::disconnectImpl");
...@@ -129,7 +124,8 @@ void SCI_Transporter::disconnectImpl() ...@@ -129,7 +124,8 @@ void SCI_Transporter::disconnectImpl()
if(err != SCI_ERR_OK) { if(err != SCI_ERR_OK) {
report_error(TE_SCI_UNABLE_TO_CLOSE_CHANNEL); report_error(TE_SCI_UNABLE_TO_CLOSE_CHANNEL);
DBUG_PRINT("error", ("Cannot close channel to the driver. Error code 0x%x", DBUG_PRINT("error",
("Cannot close channel to the driver. Error code 0x%x",
err)); err));
} }
} }
...@@ -164,19 +160,18 @@ bool SCI_Transporter::initTransporter() { ...@@ -164,19 +160,18 @@ bool SCI_Transporter::initTransporter() {
m_sendBuffer.m_buffer = new Uint32[m_sendBuffer.m_sendBufferSize / 4]; m_sendBuffer.m_buffer = new Uint32[m_sendBuffer.m_sendBufferSize / 4];
m_sendBuffer.m_dataSize = 0; m_sendBuffer.m_dataSize = 0;
DBUG_PRINT("info", ("Created SCI Send Buffer with buffer size %d and packet size %d", DBUG_PRINT("info",
("Created SCI Send Buffer with buffer size %d and packet size %d",
m_sendBuffer.m_sendBufferSize, m_PacketSize * 4)); m_sendBuffer.m_sendBufferSize, m_PacketSize * 4));
if(!getLinkStatus(m_ActiveAdapterId) || if(!getLinkStatus(m_ActiveAdapterId) ||
(m_adapters > 1 && (m_adapters > 1 &&
!getLinkStatus(m_StandbyAdapterId))) { !getLinkStatus(m_StandbyAdapterId))) {
DBUG_PRINT("error", ("The link is not fully operational. Check the cables and the switches")); DBUG_PRINT("error",
//reportDisconnect(remoteNodeId, 0); ("The link is not fully operational. Check the cables and the switches"));
//doDisconnect();
//NDB should terminate //NDB should terminate
report_error(TE_SCI_LINK_ERROR); report_error(TE_SCI_LINK_ERROR);
DBUG_RETURN(false); DBUG_RETURN(false);
} }
DBUG_RETURN(true); DBUG_RETURN(true);
} // initTransporter() } // initTransporter()
...@@ -235,7 +230,8 @@ sci_error_t SCI_Transporter::initLocalSegment() { ...@@ -235,7 +230,8 @@ sci_error_t SCI_Transporter::initLocalSegment() {
DBUG_PRINT("info", ("SCInode iD %d adapter %d\n", DBUG_PRINT("info", ("SCInode iD %d adapter %d\n",
sciAdapters[i].localSciNodeId, i)); sciAdapters[i].localSciNodeId, i));
if(err != SCI_ERR_OK) { if(err != SCI_ERR_OK) {
DBUG_PRINT("error", ("Cannot open an SCI virtual device. Error code 0x%x", DBUG_PRINT("error",
("Cannot open an SCI virtual device. Error code 0x%x",
err)); err));
DBUG_RETURN(err); DBUG_RETURN(err);
} }
...@@ -269,7 +265,8 @@ sci_error_t SCI_Transporter::initLocalSegment() { ...@@ -269,7 +265,8 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&err); &err);
if(err != SCI_ERR_OK) { if(err != SCI_ERR_OK) {
DBUG_PRINT("error", ("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n", DBUG_PRINT("error",
("Local Segment is not accessible by an SCI adapter. Error code 0x%x\n",
err)); err));
DBUG_RETURN(err); DBUG_RETURN(err);
} }
...@@ -303,15 +300,13 @@ sci_error_t SCI_Transporter::initLocalSegment() { ...@@ -303,15 +300,13 @@ sci_error_t SCI_Transporter::initLocalSegment() {
&err); &err);
if(err != SCI_ERR_OK) { if(err != SCI_ERR_OK) {
DBUG_PRINT("error", ("Local Segment is not available for remote connections. Error code 0x%x\n", DBUG_PRINT("error",
("Local Segment is not available for remote connections. Error code 0x%x\n",
err)); err));
DBUG_RETURN(err); DBUG_RETURN(err);
} }
} }
setupLocalSegment(); setupLocalSegment();
DBUG_RETURN(err); DBUG_RETURN(err);
} // initLocalSegment() } // initLocalSegment()
...@@ -343,12 +338,6 @@ bool SCI_Transporter::doSend() { ...@@ -343,12 +338,6 @@ bool SCI_Transporter::doSend() {
if(sizeToSend==4097) if(sizeToSend==4097)
i4097++; i4097++;
#endif #endif
if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
DBUG_PRINT("error", ("Start sequence failed"));
report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
return false;
}
tryagain: tryagain:
retry++; retry++;
...@@ -374,26 +363,17 @@ bool SCI_Transporter::doSend() { ...@@ -374,26 +363,17 @@ bool SCI_Transporter::doSend() {
SCI_FLAG_ERROR_CHECK, SCI_FLAG_ERROR_CHECK,
&err); &err);
if (err != SCI_ERR_OK) { if (err != SCI_ERR_OK) {
if(err == SCI_ERR_OUT_OF_RANGE) { if (err == SCI_ERR_OUT_OF_RANGE ||
DBUG_PRINT("error", ("Data transfer : out of range error")); err == SCI_ERR_SIZE_ALIGNMENT ||
goto tryagain; err == SCI_ERR_OFFSET_ALIGNMENT) {
} DBUG_PRINT("error", ("Data transfer error = %d", err));
if(err == SCI_ERR_SIZE_ALIGNMENT) { report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
DBUG_PRINT("error", ("Data transfer : alignment error")); return false;
DBUG_PRINT("info", ("sendPtr 0x%x, sizeToSend = %d", sendPtr, sizeToSend));
goto tryagain;
}
if(err == SCI_ERR_OFFSET_ALIGNMENT) {
DBUG_PRINT("error", ("Data transfer : offset alignment"));
goto tryagain;
} }
if(err == SCI_ERR_TRANSFER_FAILED) { if(err == SCI_ERR_TRANSFER_FAILED) {
//(m_TargetSegm[m_StandbyAdapterId].writer)->heavyLock(); if(getLinkStatus(m_ActiveAdapterId))
if(getLinkStatus(m_ActiveAdapterId)) {
goto tryagain; goto tryagain;
}
if (m_adapters == 1) { if (m_adapters == 1) {
DBUG_PRINT("error", ("SCI Transfer failed")); DBUG_PRINT("error", ("SCI Transfer failed"));
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
...@@ -401,90 +381,16 @@ bool SCI_Transporter::doSend() { ...@@ -401,90 +381,16 @@ bool SCI_Transporter::doSend() {
} }
m_failCounter++; m_failCounter++;
Uint32 temp=m_ActiveAdapterId; Uint32 temp=m_ActiveAdapterId;
switch(m_swapCounter) { if (getLinkStatus(m_StandbyAdapterId)) {
case 0:
/**swap from active (0) to standby (1)*/
if(getLinkStatus(m_StandbyAdapterId)) {
DBUG_PRINT("error", ("Swapping from adapter 0 to 1"));
failoverShmWriter(); failoverShmWriter();
SCIStoreBarrier(m_TargetSegm[m_StandbyAdapterId].sequence,0); SCIStoreBarrier(m_TargetSegm[m_StandbyAdapterId].sequence,0);
m_ActiveAdapterId=m_StandbyAdapterId; m_ActiveAdapterId=m_StandbyAdapterId;
m_StandbyAdapterId=temp; m_StandbyAdapterId=temp;
SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence), DBUG_PRINT("error", ("Swapping from adapter %u to %u",
FLAGS, m_StandbyAdapterId, m_ActiveAdapterId));
&err);
if(err!=SCI_ERR_OK) {
report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE);
DBUG_PRINT("error", ("Unable to remove sequence"));
return false;
}
if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
DBUG_PRINT("error", ("Start sequence failed"));
report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
return false;
}
m_swapCounter++;
DBUG_PRINT("info", ("failover complete"));
goto tryagain;
} else { } else {
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR); report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
DBUG_PRINT("error", ("SCI Transfer failed")); DBUG_PRINT("error", ("SCI Transfer failed"));
return false;
}
return false;
break;
case 1:
/** swap back from 1 to 0
must check that the link is up */
if(getLinkStatus(m_StandbyAdapterId)) {
failoverShmWriter();
m_ActiveAdapterId=m_StandbyAdapterId;
m_StandbyAdapterId=temp;
DBUG_PRINT("info", ("Swapping from 1 to 0"));
if(createSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
DBUG_PRINT("error", ("Unable to create sequence"));
report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE);
return false;
}
if(startSequence(m_ActiveAdapterId)!=SCI_ERR_OK) {
DBUG_PRINT("error", ("startSequence failed... disconnecting"));
report_error(TE_SCI_UNABLE_TO_START_SEQUENCE);
return false;
}
SCIRemoveSequence((m_TargetSegm[m_StandbyAdapterId].sequence)
, FLAGS,
&err);
if(err!=SCI_ERR_OK) {
DBUG_PRINT("error", ("Unable to remove sequence"));
report_error(TE_SCI_UNABLE_TO_REMOVE_SEQUENCE);
return false;
}
if(createSequence(m_StandbyAdapterId)!=SCI_ERR_OK) {
DBUG_PRINT("error", ("Unable to create sequence on standby"));
report_error(TE_SCI_UNABLE_TO_CREATE_SEQUENCE);
return false;
}
m_swapCounter=0;
DBUG_PRINT("info", ("failover complete.."));
goto tryagain;
} else {
DBUG_PRINT("error", ("Unrecoverable data transfer error"));
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
return false;
}
break;
default:
DBUG_PRINT("error", ("Unrecoverable data transfer error"));
report_error(TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR);
return false;
break;
} }
} }
} else { } else {
...@@ -497,7 +403,6 @@ bool SCI_Transporter::doSend() { ...@@ -497,7 +403,6 @@ bool SCI_Transporter::doSend() {
m_sendBuffer.m_dataSize = 0; m_sendBuffer.m_dataSize = 0;
m_sendBuffer.m_forceSendLimit = sendLimit; m_sendBuffer.m_forceSendLimit = sendLimit;
} }
} else { } else {
/** /**
* If we end up here, the SCI segment is full. * If we end up here, the SCI segment is full.
...@@ -552,15 +457,12 @@ void SCI_Transporter::setupLocalSegment() ...@@ -552,15 +457,12 @@ void SCI_Transporter::setupLocalSegment()
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} //setupLocalSegment } //setupLocalSegment
void SCI_Transporter::setupRemoteSegment() void SCI_Transporter::setupRemoteSegment()
{ {
DBUG_ENTER("SCI_Transporter::setupRemoteSegment"); DBUG_ENTER("SCI_Transporter::setupRemoteSegment");
Uint32 sharedSize = 0; Uint32 sharedSize = 0;
sharedSize =4096; //start of the buffer is page aligned sharedSize =4096; //start of the buffer is page aligned
Uint32 sizeOfBuffer = m_BufferSize; Uint32 sizeOfBuffer = m_BufferSize;
const Uint32 slack = MAX_MESSAGE_SIZE; const Uint32 slack = MAX_MESSAGE_SIZE;
sizeOfBuffer -= sharedSize; sizeOfBuffer -= sharedSize;
...@@ -666,7 +568,6 @@ SCI_Transporter::init_remote() ...@@ -666,7 +568,6 @@ SCI_Transporter::init_remote()
DBUG_PRINT("error", ("Error connecting segment, err 0x%x", err)); DBUG_PRINT("error", ("Error connecting segment, err 0x%x", err));
DBUG_RETURN(false); DBUG_RETURN(false);
} }
} }
// Map the remote memory segment into program space // Map the remote memory segment into program space
for(Uint32 i=0; i < m_adapters ; i++) { for(Uint32 i=0; i < m_adapters ; i++) {
...@@ -679,9 +580,10 @@ SCI_Transporter::init_remote() ...@@ -679,9 +580,10 @@ SCI_Transporter::init_remote()
FLAGS, FLAGS,
&err); &err);
if(err!= SCI_ERR_OK) { if(err!= SCI_ERR_OK) {
DBUG_PRINT("error", ("Cannot map a segment to the remote node %d. Error code 0x%x",m_RemoteSciNodeId, err)); DBUG_PRINT("error",
("Cannot map a segment to the remote node %d. Error code 0x%x",
m_RemoteSciNodeId, err));
//NDB SHOULD TERMINATE AND COMPUTER REBOOTED! //NDB SHOULD TERMINATE AND COMPUTER REBOOTED!
report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT); report_error(TE_SCI_CANNOT_MAP_REMOTESEGMENT);
DBUG_RETURN(false); DBUG_RETURN(false);
...@@ -713,7 +615,6 @@ SCI_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) ...@@ -713,7 +615,6 @@ SCI_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
NDB_CLOSE_SOCKET(sockfd); NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false); DBUG_RETURN(false);
} }
if (!init_local()) { if (!init_local()) {
NDB_CLOSE_SOCKET(sockfd); NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false); DBUG_RETURN(false);
...@@ -788,29 +689,9 @@ sci_error_t SCI_Transporter::createSequence(Uint32 adapterid) { ...@@ -788,29 +689,9 @@ sci_error_t SCI_Transporter::createSequence(Uint32 adapterid) {
&(m_TargetSegm[adapterid].sequence), &(m_TargetSegm[adapterid].sequence),
SCI_FLAG_FAST_BARRIER, SCI_FLAG_FAST_BARRIER,
&err); &err);
return err; return err;
} // createSequence() } // createSequence()
sci_error_t SCI_Transporter::startSequence(Uint32 adapterid) {
sci_error_t err;
/** Perform preliminary error check on an SCI adapter before starting a
* sequence of read and write operations on the mapped segment.
*/
m_SequenceStatus = SCIStartSequence(
(m_TargetSegm[adapterid].sequence),
FLAGS, &err);
// If there still is an error then data cannot be safely send
return err;
} // startSequence()
bool SCI_Transporter::disconnectLocal() bool SCI_Transporter::disconnectLocal()
{ {
DBUG_ENTER("SCI_Transporter::disconnectLocal"); DBUG_ENTER("SCI_Transporter::disconnectLocal");
...@@ -878,9 +759,6 @@ SCI_Transporter::~SCI_Transporter() { ...@@ -878,9 +759,6 @@ SCI_Transporter::~SCI_Transporter() {
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} // ~SCI_Transporter() } // ~SCI_Transporter()
void SCI_Transporter::closeSCI() { void SCI_Transporter::closeSCI() {
// Termination of SCI // Termination of SCI
sci_error_t err; sci_error_t err;
...@@ -897,7 +775,8 @@ void SCI_Transporter::closeSCI() { ...@@ -897,7 +775,8 @@ void SCI_Transporter::closeSCI() {
SCIClose(activeSCIDescriptor, FLAGS, &err); SCIClose(activeSCIDescriptor, FLAGS, &err);
if(err != SCI_ERR_OK) { if(err != SCI_ERR_OK) {
DBUG_PRINT("error", ("Cannot close SCI channel to the driver. Error code 0x%x", DBUG_PRINT("error",
("Cannot close SCI channel to the driver. Error code 0x%x",
err)); err));
} }
SCITerminate(); SCITerminate();
...@@ -973,7 +852,6 @@ SCI_Transporter::getConnectionStatus() { ...@@ -973,7 +852,6 @@ SCI_Transporter::getConnectionStatus() {
return false; return false;
} }
void void
SCI_Transporter::setConnected() { SCI_Transporter::setConnected() {
*m_remoteStatusFlag = SCICONNECTED; *m_remoteStatusFlag = SCICONNECTED;
...@@ -983,7 +861,6 @@ SCI_Transporter::setConnected() { ...@@ -983,7 +861,6 @@ SCI_Transporter::setConnected() {
*m_localStatusFlag = SCICONNECTED; *m_localStatusFlag = SCICONNECTED;
} }
void void
SCI_Transporter::setDisconnect() { SCI_Transporter::setDisconnect() {
if(getLinkStatus(m_ActiveAdapterId)) if(getLinkStatus(m_ActiveAdapterId))
...@@ -994,7 +871,6 @@ SCI_Transporter::setDisconnect() { ...@@ -994,7 +871,6 @@ SCI_Transporter::setDisconnect() {
} }
} }
bool bool
SCI_Transporter::checkConnected() { SCI_Transporter::checkConnected() {
if (*m_localStatusFlag == SCIDISCONNECT) { if (*m_localStatusFlag == SCIDISCONNECT) {
...@@ -1015,7 +891,8 @@ SCI_Transporter::initSCI() { ...@@ -1015,7 +891,8 @@ SCI_Transporter::initSCI() {
SCIInitialize(0, &error); SCIInitialize(0, &error);
if(error != SCI_ERR_OK) { if(error != SCI_ERR_OK) {
DBUG_PRINT("error", ("Cannot initialize SISCI library.")); DBUG_PRINT("error", ("Cannot initialize SISCI library."));
DBUG_PRINT("error", ("Inconsistency between SISCI library and SISCI driver. Error code 0x%x", DBUG_PRINT("error",
("Inconsistency between SISCI library and SISCI driver. Error code 0x%x",
error)); error));
DBUG_RETURN(false); DBUG_RETURN(false);
} }
...@@ -1029,3 +906,4 @@ SCI_Transporter::get_free_buffer() const ...@@ -1029,3 +906,4 @@ SCI_Transporter::get_free_buffer() const
{ {
return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer(); return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer();
} }
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
* local segment, the SCI transporter connects to a segment created by another * local segment, the SCI transporter connects to a segment created by another
* transporter at a remote node, and the maps the remote segment into its * transporter at a remote node, and the maps the remote segment into its
* virtual address space. However, since NDB Cluster relies on redundancy * virtual address space. However, since NDB Cluster relies on redundancy
* at the network level, by using dual SCI adapters communica * at the network level, by using dual SCI adapters communication can be
* * maintained even if one of the adapter cards fails (or anything on the
* network this adapter card exists in e.g. an SCI switch failure).
* *
*/ */
/** /**
* class SCITransporter * class SCITransporter
* @brief - main class for the SCI transporter. * @brief - main class for the SCI transporter.
...@@ -84,16 +84,6 @@ public: ...@@ -84,16 +84,6 @@ public:
sci_error_t createSequence(Uint32 adapterid); sci_error_t createSequence(Uint32 adapterid);
/**
* starts a sequence for error checking.
* The actual checking that a sequence is correct is done implicitly
* in SCIMemCpy (in doSend).
* @param adapterid the adapter on which to start the sequence.
* @return SCI_ERR_OK if ok, otherwize something else.
*/
sci_error_t startSequence(Uint32 adapterid);
/** Initiate Local Segment: create a memory segment, /** Initiate Local Segment: create a memory segment,
* prepare a memory segment, map the local segment * prepare a memory segment, map the local segment
* into memory space and make segment available. * into memory space and make segment available.
...@@ -159,7 +149,6 @@ private: ...@@ -159,7 +149,6 @@ private:
bool m_mapped; bool m_mapped;
bool m_initLocal; bool m_initLocal;
bool m_sciinit; bool m_sciinit;
Uint32 m_swapCounter;
Uint32 m_failCounter; Uint32 m_failCounter;
/** /**
* For statistics on transfered packets * For statistics on transfered packets
...@@ -195,7 +184,6 @@ private: ...@@ -195,7 +184,6 @@ private:
*/ */
Uint32 m_reportFreq; Uint32 m_reportFreq;
Uint32 m_adapters; Uint32 m_adapters;
Uint32 m_numberOfRemoteNodes; Uint32 m_numberOfRemoteNodes;
......
...@@ -13968,7 +13968,8 @@ Dbdict::getTableEntry(XSchemaFile * xsf, Uint32 tableId) ...@@ -13968,7 +13968,8 @@ Dbdict::getTableEntry(XSchemaFile * xsf, Uint32 tableId)
//****************************************** //******************************************
void void
Dbdict::execCREATE_FILE_REQ(Signal* signal){ Dbdict::execCREATE_FILE_REQ(Signal* signal)
{
jamEntry(); jamEntry();
if(!assembleFragments(signal)){ if(!assembleFragments(signal)){
...@@ -14013,13 +14014,14 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){ ...@@ -14013,13 +14014,14 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr)){ if (! c_Trans.seize(trans_ptr)){
jam();
ref->errorCode = CreateFileRef::Busy; ref->errorCode = CreateFileRef::Busy;
ref->status = 0; ref->status = 0;
ref->errorKey = 0; ref->errorKey = 0;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
} }
jam();
const Uint32 trans_key = ++c_opRecordSequence; const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key; trans_ptr.p->key = trans_key;
trans_ptr.p->m_senderRef = senderRef; trans_ptr.p->m_senderRef = senderRef;
...@@ -14048,6 +14050,7 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){ ...@@ -14048,6 +14050,7 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
{ {
Uint32 objId = getFreeObjId(0); Uint32 objId = getFreeObjId(0);
if (objId == RNIL) { if (objId == RNIL) {
jam();
ref->errorCode = CreateFileRef::NoMoreObjectRecords; ref->errorCode = CreateFileRef::NoMoreObjectRecords;
ref->status = 0; ref->status = 0;
ref->errorKey = 0; ref->errorKey = 0;
...@@ -14072,7 +14075,6 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){ ...@@ -14072,7 +14075,6 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
CreateObjReq::SignalLength, JBB); CreateObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB; c_blockState = BS_CREATE_TAB;
return; return;
} while(0); } while(0);
...@@ -14083,7 +14085,8 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){ ...@@ -14083,7 +14085,8 @@ Dbdict::execCREATE_FILE_REQ(Signal* signal){
} }
void void
Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal)
{
jamEntry(); jamEntry();
if(!assembleFragments(signal)){ if(!assembleFragments(signal)){
...@@ -14127,13 +14130,14 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){ ...@@ -14127,13 +14130,14 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr)){ if (! c_Trans.seize(trans_ptr)){
jam();
ref->errorCode = CreateFilegroupRef::Busy; ref->errorCode = CreateFilegroupRef::Busy;
ref->status = 0; ref->status = 0;
ref->errorKey = 0; ref->errorKey = 0;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
} }
jam();
const Uint32 trans_key = ++c_opRecordSequence; const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key; trans_ptr.p->key = trans_key;
trans_ptr.p->m_senderRef = senderRef; trans_ptr.p->m_senderRef = senderRef;
...@@ -14159,6 +14163,7 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){ ...@@ -14159,6 +14163,7 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
{ {
Uint32 objId = getFreeObjId(0); Uint32 objId = getFreeObjId(0);
if (objId == RNIL) { if (objId == RNIL) {
jam();
ref->errorCode = CreateFilegroupRef::NoMoreObjectRecords; ref->errorCode = CreateFilegroupRef::NoMoreObjectRecords;
ref->status = 0; ref->status = 0;
ref->errorKey = 0; ref->errorKey = 0;
...@@ -14183,7 +14188,6 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){ ...@@ -14183,7 +14188,6 @@ Dbdict::execCREATE_FILEGROUP_REQ(Signal* signal){
CreateObjReq::SignalLength, JBB); CreateObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB; c_blockState = BS_CREATE_TAB;
return; return;
} while(0); } while(0);
...@@ -14219,7 +14223,8 @@ Dbdict::execDROP_FILE_REQ(Signal* signal) ...@@ -14219,7 +14223,8 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
break; break;
} }
if (c_blockState != BS_IDLE){ if (c_blockState != BS_IDLE)
{
jam(); jam();
ref->errorCode = DropFileRef::Busy; ref->errorCode = DropFileRef::Busy;
ref->errorKey = 0; ref->errorKey = 0;
...@@ -14229,6 +14234,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal) ...@@ -14229,6 +14234,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
if (checkSingleUserMode(senderRef)) if (checkSingleUserMode(senderRef))
{ {
jam();
ref->errorCode = DropFileRef::SingleUser; ref->errorCode = DropFileRef::SingleUser;
ref->errorKey = 0; ref->errorKey = 0;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
...@@ -14238,6 +14244,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal) ...@@ -14238,6 +14244,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
Ptr<File> file_ptr; Ptr<File> file_ptr;
if (!c_file_hash.find(file_ptr, objId)) if (!c_file_hash.find(file_ptr, objId))
{ {
jam();
ref->errorCode = DropFileRef::NoSuchFile; ref->errorCode = DropFileRef::NoSuchFile;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
...@@ -14245,6 +14252,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal) ...@@ -14245,6 +14252,7 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
if (file_ptr.p->m_version != version) if (file_ptr.p->m_version != version)
{ {
jam();
ref->errorCode = DropFileRef::InvalidSchemaObjectVersion; ref->errorCode = DropFileRef::InvalidSchemaObjectVersion;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
...@@ -14253,10 +14261,12 @@ Dbdict::execDROP_FILE_REQ(Signal* signal) ...@@ -14253,10 +14261,12 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr)) if (! c_Trans.seize(trans_ptr))
{ {
jam();
ref->errorCode = DropFileRef::Busy; ref->errorCode = DropFileRef::Busy;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
} }
jam();
const Uint32 trans_key = ++c_opRecordSequence; const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key; trans_ptr.p->key = trans_key;
...@@ -14292,7 +14302,6 @@ Dbdict::execDROP_FILE_REQ(Signal* signal) ...@@ -14292,7 +14302,6 @@ Dbdict::execDROP_FILE_REQ(Signal* signal)
DropObjReq::SignalLength, JBB); DropObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB; c_blockState = BS_CREATE_TAB;
return; return;
} while(0); } while(0);
...@@ -14320,7 +14329,8 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14320,7 +14329,8 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
Uint32 version = req->filegroup_version; Uint32 version = req->filegroup_version;
do { do {
if(getOwnNodeId() != c_masterNodeId){ if(getOwnNodeId() != c_masterNodeId)
{
jam(); jam();
ref->errorCode = DropFilegroupRef::NotMaster; ref->errorCode = DropFilegroupRef::NotMaster;
ref->errorKey = 0; ref->errorKey = 0;
...@@ -14328,7 +14338,8 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14328,7 +14338,8 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
break; break;
} }
if (c_blockState != BS_IDLE){ if (c_blockState != BS_IDLE)
{
jam(); jam();
ref->errorCode = DropFilegroupRef::Busy; ref->errorCode = DropFilegroupRef::Busy;
ref->errorKey = 0; ref->errorKey = 0;
...@@ -14338,6 +14349,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14338,6 +14349,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
if (checkSingleUserMode(senderRef)) if (checkSingleUserMode(senderRef))
{ {
jam();
ref->errorCode = DropFilegroupRef::SingleUser; ref->errorCode = DropFilegroupRef::SingleUser;
ref->errorKey = 0; ref->errorKey = 0;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
...@@ -14347,6 +14359,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14347,6 +14359,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
Ptr<Filegroup> filegroup_ptr; Ptr<Filegroup> filegroup_ptr;
if (!c_filegroup_hash.find(filegroup_ptr, objId)) if (!c_filegroup_hash.find(filegroup_ptr, objId))
{ {
jam();
ref->errorCode = DropFilegroupRef::NoSuchFilegroup; ref->errorCode = DropFilegroupRef::NoSuchFilegroup;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
...@@ -14354,6 +14367,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14354,6 +14367,7 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
if (filegroup_ptr.p->m_version != version) if (filegroup_ptr.p->m_version != version)
{ {
jam();
ref->errorCode = DropFilegroupRef::InvalidSchemaObjectVersion; ref->errorCode = DropFilegroupRef::InvalidSchemaObjectVersion;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
...@@ -14362,10 +14376,12 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14362,10 +14376,12 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
if (! c_Trans.seize(trans_ptr)) if (! c_Trans.seize(trans_ptr))
{ {
jam();
ref->errorCode = DropFilegroupRef::Busy; ref->errorCode = DropFilegroupRef::Busy;
ref->errorLine = __LINE__; ref->errorLine = __LINE__;
break; break;
} }
jam();
const Uint32 trans_key = ++c_opRecordSequence; const Uint32 trans_key = ++c_opRecordSequence;
trans_ptr.p->key = trans_key; trans_ptr.p->key = trans_key;
...@@ -14401,7 +14417,6 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14401,7 +14417,6 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
DropObjReq::SignalLength, JBB); DropObjReq::SignalLength, JBB);
c_blockState = BS_CREATE_TAB; c_blockState = BS_CREATE_TAB;
return; return;
} while(0); } while(0);
...@@ -14412,15 +14427,15 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -14412,15 +14427,15 @@ Dbdict::execDROP_FILEGROUP_REQ(Signal* signal)
} }
void void
Dbdict::execCREATE_OBJ_REF(Signal* signal){ Dbdict::execCREATE_OBJ_REF(Signal* signal)
jamEntry(); {
CreateObjRef * const ref = (CreateObjRef*)signal->getDataPtr(); CreateObjRef * const ref = (CreateObjRef*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
if(ref->errorCode != CreateObjRef::NF_FakeErrorREF){ if(ref->errorCode != CreateObjRef::NF_FakeErrorREF){
jam();
trans_ptr.p->setErrorCode(ref->errorCode); trans_ptr.p->setErrorCode(ref->errorCode);
} }
Uint32 node = refToNode(ref->senderRef); Uint32 node = refToNode(ref->senderRef);
...@@ -14428,12 +14443,12 @@ Dbdict::execCREATE_OBJ_REF(Signal* signal){ ...@@ -14428,12 +14443,12 @@ Dbdict::execCREATE_OBJ_REF(Signal* signal){
} }
void void
Dbdict::execCREATE_OBJ_CONF(Signal* signal){ Dbdict::execCREATE_OBJ_CONF(Signal* signal)
jamEntry(); {
Ptr<SchemaTransaction> trans_ptr;
CreateObjConf * const conf = (CreateObjConf*)signal->getDataPtr(); CreateObjConf * const conf = (CreateObjConf*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData)); ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef)); schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
} }
...@@ -14443,6 +14458,7 @@ Dbdict::schemaOp_reply(Signal* signal, ...@@ -14443,6 +14458,7 @@ Dbdict::schemaOp_reply(Signal* signal,
SchemaTransaction * trans_ptr_p, SchemaTransaction * trans_ptr_p,
Uint32 nodeId) Uint32 nodeId)
{ {
jam();
{ {
SafeCounter tmp(c_counterMgr, trans_ptr_p->m_counter); SafeCounter tmp(c_counterMgr, trans_ptr_p->m_counter);
if(!tmp.clearWaitingFor(nodeId)){ if(!tmp.clearWaitingFor(nodeId)){
...@@ -14453,10 +14469,8 @@ Dbdict::schemaOp_reply(Signal* signal, ...@@ -14453,10 +14469,8 @@ Dbdict::schemaOp_reply(Signal* signal,
switch(trans_ptr_p->m_op.m_state){ switch(trans_ptr_p->m_op.m_state){
case DictObjOp::Preparing:{ case DictObjOp::Preparing:{
if(trans_ptr_p->m_errorCode != 0) if(trans_ptr_p->m_errorCode != 0)
{ {
jam();
/** /**
* Failed to prepare on atleast one node -> abort on all * Failed to prepare on atleast one node -> abort on all
*/ */
...@@ -14466,10 +14480,16 @@ Dbdict::schemaOp_reply(Signal* signal, ...@@ -14466,10 +14480,16 @@ Dbdict::schemaOp_reply(Signal* signal,
safe_cast(&Dbdict::trans_abort_start_done); safe_cast(&Dbdict::trans_abort_start_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_start) if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_start)
{
jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_start) (this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_start)
(signal, trans_ptr_p); (signal, trans_ptr_p);
}
else else
{
jam();
execute(signal, trans_ptr_p->m_callback, 0); execute(signal, trans_ptr_p->m_callback, 0);
}
return; return;
} }
...@@ -14479,14 +14499,19 @@ Dbdict::schemaOp_reply(Signal* signal, ...@@ -14479,14 +14499,19 @@ Dbdict::schemaOp_reply(Signal* signal,
safe_cast(&Dbdict::trans_commit_start_done); safe_cast(&Dbdict::trans_commit_start_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_start) if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_start)
{
jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_start) (this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_start)
(signal, trans_ptr_p); (signal, trans_ptr_p);
}
else else
{
jam();
execute(signal, trans_ptr_p->m_callback, 0); execute(signal, trans_ptr_p->m_callback, 0);
}
return; return;
} }
case DictObjOp::Committing: { case DictObjOp::Committing: {
jam();
ndbrequire(trans_ptr_p->m_errorCode == 0); ndbrequire(trans_ptr_p->m_errorCode == 0);
trans_ptr_p->m_op.m_state = DictObjOp::Committed; trans_ptr_p->m_op.m_state = DictObjOp::Committed;
...@@ -14495,31 +14520,42 @@ Dbdict::schemaOp_reply(Signal* signal, ...@@ -14495,31 +14520,42 @@ Dbdict::schemaOp_reply(Signal* signal,
safe_cast(&Dbdict::trans_commit_complete_done); safe_cast(&Dbdict::trans_commit_complete_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_complete) if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_complete)
{
jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_complete) (this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_commit_complete)
(signal, trans_ptr_p); (signal, trans_ptr_p);
}
else else
{
jam();
execute(signal, trans_ptr_p->m_callback, 0); execute(signal, trans_ptr_p->m_callback, 0);
}
return; return;
} }
case DictObjOp::Aborting:{ case DictObjOp::Aborting:{
jam();
trans_ptr_p->m_op.m_state = DictObjOp::Committed; trans_ptr_p->m_op.m_state = DictObjOp::Committed;
trans_ptr_p->m_callback.m_callbackData = trans_ptr_p->key; trans_ptr_p->m_callback.m_callbackData = trans_ptr_p->key;
trans_ptr_p->m_callback.m_callbackFunction= trans_ptr_p->m_callback.m_callbackFunction=
safe_cast(&Dbdict::trans_abort_complete_done); safe_cast(&Dbdict::trans_abort_complete_done);
if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_complete) if(f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_complete)
{
jam();
(this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_complete) (this->*f_dict_op[trans_ptr_p->m_op.m_vt_index].m_trans_abort_complete)
(signal, trans_ptr_p); (signal, trans_ptr_p);
}
else else
{
jam();
execute(signal, trans_ptr_p->m_callback, 0); execute(signal, trans_ptr_p->m_callback, 0);
}
return; return;
} }
case DictObjOp::Defined: case DictObjOp::Defined:
case DictObjOp::Prepared: case DictObjOp::Prepared:
case DictObjOp::Committed: case DictObjOp::Committed:
case DictObjOp::Aborted: case DictObjOp::Aborted:
jam();
break; break;
} }
ndbrequire(false); ndbrequire(false);
...@@ -14528,14 +14564,13 @@ Dbdict::schemaOp_reply(Signal* signal, ...@@ -14528,14 +14564,13 @@ Dbdict::schemaOp_reply(Signal* signal,
void void
Dbdict::trans_commit_start_done(Signal* signal, Dbdict::trans_commit_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 retValue){ Uint32 retValue)
jamEntry(); {
Ptr<SchemaTransaction> trans_ptr;
jam();
ndbrequire(retValue == 0); ndbrequire(retValue == 0);
Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, callbackData)); ndbrequire(c_Trans.find(trans_ptr, callbackData));
NodeReceiverGroup rg(DBDICT, trans_ptr.p->m_nodes); NodeReceiverGroup rg(DBDICT, trans_ptr.p->m_nodes);
SafeCounter tmp(c_counterMgr, trans_ptr.p->m_counter); SafeCounter tmp(c_counterMgr, trans_ptr.p->m_counter);
tmp.init<DictCommitRef>(rg, GSN_DICT_COMMIT_REF, trans_ptr.p->key); tmp.init<DictCommitRef>(rg, GSN_DICT_COMMIT_REF, trans_ptr.p->key);
...@@ -14546,27 +14581,26 @@ Dbdict::trans_commit_start_done(Signal* signal, ...@@ -14546,27 +14581,26 @@ Dbdict::trans_commit_start_done(Signal* signal,
req->op_key = trans_ptr.p->m_op.m_key; req->op_key = trans_ptr.p->m_op.m_key;
sendSignal(rg, GSN_DICT_COMMIT_REQ, signal, DictCommitReq::SignalLength, sendSignal(rg, GSN_DICT_COMMIT_REQ, signal, DictCommitReq::SignalLength,
JBB); JBB);
trans_ptr.p->m_op.m_state = DictObjOp::Committing; trans_ptr.p->m_op.m_state = DictObjOp::Committing;
} }
void void
Dbdict::trans_commit_complete_done(Signal* signal, Dbdict::trans_commit_complete_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 retValue){ Uint32 retValue)
jamEntry(); {
Ptr<SchemaTransaction> trans_ptr;
jam();
ndbrequire(retValue == 0); ndbrequire(retValue == 0);
Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, callbackData)); ndbrequire(c_Trans.find(trans_ptr, callbackData));
switch(f_dict_op[trans_ptr.p->m_op.m_vt_index].m_gsn_user_req){ switch(f_dict_op[trans_ptr.p->m_op.m_vt_index].m_gsn_user_req){
case GSN_CREATE_FILEGROUP_REQ:{ case GSN_CREATE_FILEGROUP_REQ:{
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
jam();
ndbrequire(c_filegroup_hash.find(fg_ptr, trans_ptr.p->m_op.m_obj_id)); ndbrequire(c_filegroup_hash.find(fg_ptr, trans_ptr.p->m_op.m_obj_id));
//
CreateFilegroupConf * conf = (CreateFilegroupConf*)signal->getDataPtr(); CreateFilegroupConf * conf = (CreateFilegroupConf*)signal->getDataPtr();
conf->senderRef = reference(); conf->senderRef = reference();
conf->senderData = trans_ptr.p->m_senderData; conf->senderData = trans_ptr.p->m_senderData;
...@@ -14576,11 +14610,11 @@ Dbdict::trans_commit_complete_done(Signal* signal, ...@@ -14576,11 +14610,11 @@ Dbdict::trans_commit_complete_done(Signal* signal,
//@todo check api failed //@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILEGROUP_CONF, signal, sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILEGROUP_CONF, signal,
CreateFilegroupConf::SignalLength, JBB); CreateFilegroupConf::SignalLength, JBB);
break; break;
} }
case GSN_CREATE_FILE_REQ:{ case GSN_CREATE_FILE_REQ:{
FilePtr f_ptr; FilePtr f_ptr;
jam();
ndbrequire(c_file_hash.find(f_ptr, trans_ptr.p->m_op.m_obj_id)); ndbrequire(c_file_hash.find(f_ptr, trans_ptr.p->m_op.m_obj_id));
CreateFileConf * conf = (CreateFileConf*)signal->getDataPtr(); CreateFileConf * conf = (CreateFileConf*)signal->getDataPtr();
conf->senderRef = reference(); conf->senderRef = reference();
...@@ -14591,11 +14625,11 @@ Dbdict::trans_commit_complete_done(Signal* signal, ...@@ -14591,11 +14625,11 @@ Dbdict::trans_commit_complete_done(Signal* signal,
//@todo check api failed //@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_CONF, signal, sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_CONF, signal,
CreateFileConf::SignalLength, JBB); CreateFileConf::SignalLength, JBB);
break; break;
} }
case GSN_DROP_FILE_REQ:{ case GSN_DROP_FILE_REQ:{
DropFileConf * conf = (DropFileConf*)signal->getDataPtr(); DropFileConf * conf = (DropFileConf*)signal->getDataPtr();
jam();
conf->senderRef = reference(); conf->senderRef = reference();
conf->senderData = trans_ptr.p->m_senderData; conf->senderData = trans_ptr.p->m_senderData;
conf->fileId = trans_ptr.p->m_op.m_obj_id; conf->fileId = trans_ptr.p->m_op.m_obj_id;
...@@ -14607,6 +14641,7 @@ Dbdict::trans_commit_complete_done(Signal* signal, ...@@ -14607,6 +14641,7 @@ Dbdict::trans_commit_complete_done(Signal* signal,
} }
case GSN_DROP_FILEGROUP_REQ:{ case GSN_DROP_FILEGROUP_REQ:{
DropFilegroupConf * conf = (DropFilegroupConf*)signal->getDataPtr(); DropFilegroupConf * conf = (DropFilegroupConf*)signal->getDataPtr();
jam();
conf->senderRef = reference(); conf->senderRef = reference();
conf->senderData = trans_ptr.p->m_senderData; conf->senderData = trans_ptr.p->m_senderData;
conf->filegroupId = trans_ptr.p->m_op.m_obj_id; conf->filegroupId = trans_ptr.p->m_op.m_obj_id;
...@@ -14629,12 +14664,12 @@ Dbdict::trans_commit_complete_done(Signal* signal, ...@@ -14629,12 +14664,12 @@ Dbdict::trans_commit_complete_done(Signal* signal,
void void
Dbdict::trans_abort_start_done(Signal* signal, Dbdict::trans_abort_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 retValue){ Uint32 retValue)
jamEntry(); {
Ptr<SchemaTransaction> trans_ptr;
jam();
ndbrequire(retValue == 0); ndbrequire(retValue == 0);
Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, callbackData)); ndbrequire(c_Trans.find(trans_ptr, callbackData));
NodeReceiverGroup rg(DBDICT, trans_ptr.p->m_nodes); NodeReceiverGroup rg(DBDICT, trans_ptr.p->m_nodes);
...@@ -14652,12 +14687,12 @@ Dbdict::trans_abort_start_done(Signal* signal, ...@@ -14652,12 +14687,12 @@ Dbdict::trans_abort_start_done(Signal* signal,
void void
Dbdict::trans_abort_complete_done(Signal* signal, Dbdict::trans_abort_complete_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 retValue){ Uint32 retValue)
jamEntry(); {
Ptr<SchemaTransaction> trans_ptr;
jam();
ndbrequire(retValue == 0); ndbrequire(retValue == 0);
Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, callbackData)); ndbrequire(c_Trans.find(trans_ptr, callbackData));
switch(f_dict_op[trans_ptr.p->m_op.m_vt_index].m_gsn_user_req){ switch(f_dict_op[trans_ptr.p->m_op.m_vt_index].m_gsn_user_req){
...@@ -14665,6 +14700,7 @@ Dbdict::trans_abort_complete_done(Signal* signal, ...@@ -14665,6 +14700,7 @@ Dbdict::trans_abort_complete_done(Signal* signal,
{ {
// //
CreateFilegroupRef * ref = (CreateFilegroupRef*)signal->getDataPtr(); CreateFilegroupRef * ref = (CreateFilegroupRef*)signal->getDataPtr();
jam();
ref->senderRef = reference(); ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData; ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId; ref->masterNodeId = c_masterNodeId;
...@@ -14676,12 +14712,12 @@ Dbdict::trans_abort_complete_done(Signal* signal, ...@@ -14676,12 +14712,12 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed //@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILEGROUP_REF, signal, sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILEGROUP_REF, signal,
CreateFilegroupRef::SignalLength, JBB); CreateFilegroupRef::SignalLength, JBB);
break; break;
} }
case GSN_CREATE_FILE_REQ: case GSN_CREATE_FILE_REQ:
{ {
CreateFileRef * ref = (CreateFileRef*)signal->getDataPtr(); CreateFileRef * ref = (CreateFileRef*)signal->getDataPtr();
jam();
ref->senderRef = reference(); ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData; ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId; ref->masterNodeId = c_masterNodeId;
...@@ -14693,12 +14729,12 @@ Dbdict::trans_abort_complete_done(Signal* signal, ...@@ -14693,12 +14729,12 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed //@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_REF, signal, sendSignal(trans_ptr.p->m_senderRef, GSN_CREATE_FILE_REF, signal,
CreateFileRef::SignalLength, JBB); CreateFileRef::SignalLength, JBB);
break; break;
} }
case GSN_DROP_FILE_REQ: case GSN_DROP_FILE_REQ:
{ {
DropFileRef * ref = (DropFileRef*)signal->getDataPtr(); DropFileRef * ref = (DropFileRef*)signal->getDataPtr();
jam();
ref->senderRef = reference(); ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData; ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId; ref->masterNodeId = c_masterNodeId;
...@@ -14709,13 +14745,13 @@ Dbdict::trans_abort_complete_done(Signal* signal, ...@@ -14709,13 +14745,13 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed //@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_DROP_FILE_REF, signal, sendSignal(trans_ptr.p->m_senderRef, GSN_DROP_FILE_REF, signal,
DropFileRef::SignalLength, JBB); DropFileRef::SignalLength, JBB);
break; break;
} }
case GSN_DROP_FILEGROUP_REQ: case GSN_DROP_FILEGROUP_REQ:
{ {
// //
DropFilegroupRef * ref = (DropFilegroupRef*)signal->getDataPtr(); DropFilegroupRef * ref = (DropFilegroupRef*)signal->getDataPtr();
jam();
ref->senderRef = reference(); ref->senderRef = reference();
ref->senderData = trans_ptr.p->m_senderData; ref->senderData = trans_ptr.p->m_senderData;
ref->masterNodeId = c_masterNodeId; ref->masterNodeId = c_masterNodeId;
...@@ -14726,7 +14762,6 @@ Dbdict::trans_abort_complete_done(Signal* signal, ...@@ -14726,7 +14762,6 @@ Dbdict::trans_abort_complete_done(Signal* signal,
//@todo check api failed //@todo check api failed
sendSignal(trans_ptr.p->m_senderRef, GSN_DROP_FILEGROUP_REF, signal, sendSignal(trans_ptr.p->m_senderRef, GSN_DROP_FILEGROUP_REF, signal,
DropFilegroupRef::SignalLength, JBB); DropFilegroupRef::SignalLength, JBB);
break; break;
} }
default: default:
...@@ -14740,7 +14775,8 @@ Dbdict::trans_abort_complete_done(Signal* signal, ...@@ -14740,7 +14775,8 @@ Dbdict::trans_abort_complete_done(Signal* signal,
} }
void void
Dbdict::execCREATE_OBJ_REQ(Signal* signal){ Dbdict::execCREATE_OBJ_REQ(Signal* signal)
{
jamEntry(); jamEntry();
if(!assembleFragments(signal)){ if(!assembleFragments(signal)){
...@@ -14785,6 +14821,7 @@ Dbdict::execCREATE_OBJ_REQ(Signal* signal){ ...@@ -14785,6 +14821,7 @@ Dbdict::execCREATE_OBJ_REQ(Signal* signal){
switch(objType){ switch(objType){
case DictTabInfo::Tablespace: case DictTabInfo::Tablespace:
case DictTabInfo::LogfileGroup: case DictTabInfo::LogfileGroup:
jam();
createObjPtr.p->m_vt_index = 0; createObjPtr.p->m_vt_index = 0;
break; break;
case DictTabInfo::Datafile: case DictTabInfo::Datafile:
...@@ -14793,7 +14830,11 @@ Dbdict::execCREATE_OBJ_REQ(Signal* signal){ ...@@ -14793,7 +14830,11 @@ Dbdict::execCREATE_OBJ_REQ(Signal* signal){
* Use restart code to impl. ForceCreateFile * Use restart code to impl. ForceCreateFile
*/ */
if (requestInfo & CreateFileReq::ForceCreateFile) if (requestInfo & CreateFileReq::ForceCreateFile)
{
jam();
createObjPtr.p->m_restart= 2; createObjPtr.p->m_restart= 2;
}
jam();
createObjPtr.p->m_vt_index = 1; createObjPtr.p->m_vt_index = 1;
break; break;
default: default:
...@@ -14809,10 +14850,10 @@ void ...@@ -14809,10 +14850,10 @@ void
Dbdict::execDICT_COMMIT_REQ(Signal* signal) Dbdict::execDICT_COMMIT_REQ(Signal* signal)
{ {
DictCommitReq* req = (DictCommitReq*)signal->getDataPtr(); DictCommitReq* req = (DictCommitReq*)signal->getDataPtr();
Ptr<SchemaOp> op; Ptr<SchemaOp> op;
ndbrequire(c_schemaOp.find(op, req->op_key));
jamEntry();
ndbrequire(c_schemaOp.find(op, req->op_key));
(this->*f_dict_op[op.p->m_vt_index].m_commit)(signal, op.p); (this->*f_dict_op[op.p->m_vt_index].m_commit)(signal, op.p);
} }
...@@ -14820,23 +14861,23 @@ void ...@@ -14820,23 +14861,23 @@ void
Dbdict::execDICT_ABORT_REQ(Signal* signal) Dbdict::execDICT_ABORT_REQ(Signal* signal)
{ {
DictAbortReq* req = (DictAbortReq*)signal->getDataPtr(); DictAbortReq* req = (DictAbortReq*)signal->getDataPtr();
Ptr<SchemaOp> op; Ptr<SchemaOp> op;
ndbrequire(c_schemaOp.find(op, req->op_key));
jamEntry();
ndbrequire(c_schemaOp.find(op, req->op_key));
(this->*f_dict_op[op.p->m_vt_index].m_abort)(signal, op.p); (this->*f_dict_op[op.p->m_vt_index].m_abort)(signal, op.p);
} }
void void
Dbdict::execDICT_COMMIT_REF(Signal* signal){ Dbdict::execDICT_COMMIT_REF(Signal* signal)
jamEntry(); {
DictCommitRef * const ref = (DictCommitRef*)signal->getDataPtr(); DictCommitRef * const ref = (DictCommitRef*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
if(ref->errorCode != DictCommitRef::NF_FakeErrorREF){ if(ref->errorCode != DictCommitRef::NF_FakeErrorREF){
jam();
trans_ptr.p->setErrorCode(ref->errorCode); trans_ptr.p->setErrorCode(ref->errorCode);
} }
Uint32 node = refToNode(ref->senderRef); Uint32 node = refToNode(ref->senderRef);
...@@ -14844,26 +14885,26 @@ Dbdict::execDICT_COMMIT_REF(Signal* signal){ ...@@ -14844,26 +14885,26 @@ Dbdict::execDICT_COMMIT_REF(Signal* signal){
} }
void void
Dbdict::execDICT_COMMIT_CONF(Signal* signal){ Dbdict::execDICT_COMMIT_CONF(Signal* signal)
jamEntry(); {
Ptr<SchemaTransaction> trans_ptr;
DictCommitConf * const conf = (DictCommitConf*)signal->getDataPtr(); DictCommitConf * const conf = (DictCommitConf*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData)); ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef)); schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
} }
void void
Dbdict::execDICT_ABORT_REF(Signal* signal){ Dbdict::execDICT_ABORT_REF(Signal* signal)
jamEntry(); {
DictAbortRef * const ref = (DictAbortRef*)signal->getDataPtr(); DictAbortRef * const ref = (DictAbortRef*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
if(ref->errorCode != DictAbortRef::NF_FakeErrorREF){ if(ref->errorCode != DictAbortRef::NF_FakeErrorREF){
jam();
trans_ptr.p->setErrorCode(ref->errorCode); trans_ptr.p->setErrorCode(ref->errorCode);
} }
Uint32 node = refToNode(ref->senderRef); Uint32 node = refToNode(ref->senderRef);
...@@ -14871,31 +14912,28 @@ Dbdict::execDICT_ABORT_REF(Signal* signal){ ...@@ -14871,31 +14912,28 @@ Dbdict::execDICT_ABORT_REF(Signal* signal){
} }
void void
Dbdict::execDICT_ABORT_CONF(Signal* signal){ Dbdict::execDICT_ABORT_CONF(Signal* signal)
jamEntry(); {
DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr(); DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData)); ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef)); schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
} }
void void
Dbdict::createObj_prepare_start_done(Signal* signal, Dbdict::createObj_prepare_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
{
CreateObjRecordPtr createObjPtr;
SegmentedSectionPtr objInfoPtr;
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData)); ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
jam();
SegmentedSectionPtr objInfoPtr;
getSection(objInfoPtr, createObjPtr.p->m_obj_info_ptr_i); getSection(objInfoPtr, createObjPtr.p->m_obj_info_ptr_i);
if(createObjPtr.p->m_errorCode != 0){ if(createObjPtr.p->m_errorCode != 0){
jam(); jam();
createObjPtr.p->m_obj_info_ptr_i= RNIL; createObjPtr.p->m_obj_info_ptr_i= RNIL;
...@@ -14923,19 +14961,19 @@ Dbdict::createObj_prepare_start_done(Signal* signal, ...@@ -14923,19 +14961,19 @@ Dbdict::createObj_prepare_start_done(Signal* signal,
void void
Dbdict::createObj_writeSchemaConf1(Signal* signal, Dbdict::createObj_writeSchemaConf1(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
jam(); {
CreateObjRecordPtr createObjPtr;
Callback callback;
SegmentedSectionPtr objInfoPtr;
jam();
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData)); ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
Callback callback;
callback.m_callbackData = createObjPtr.p->key; callback.m_callbackData = createObjPtr.p->key;
callback.m_callbackFunction = safe_cast(&Dbdict::createObj_writeObjConf); callback.m_callbackFunction = safe_cast(&Dbdict::createObj_writeObjConf);
SegmentedSectionPtr objInfoPtr;
getSection(objInfoPtr, createObjPtr.p->m_obj_info_ptr_i); getSection(objInfoPtr, createObjPtr.p->m_obj_info_ptr_i);
writeTableFile(signal, createObjPtr.p->m_obj_id, objInfoPtr, &callback); writeTableFile(signal, createObjPtr.p->m_obj_id, objInfoPtr, &callback);
...@@ -14947,14 +14985,13 @@ Dbdict::createObj_writeSchemaConf1(Signal* signal, ...@@ -14947,14 +14985,13 @@ Dbdict::createObj_writeSchemaConf1(Signal* signal,
void void
Dbdict::createObj_writeObjConf(Signal* signal, Dbdict::createObj_writeObjConf(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
jam(); {
CreateObjRecordPtr createObjPtr;
jam();
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData)); ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
createObjPtr.p->m_callback.m_callbackFunction = createObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_prepare_complete_done); safe_cast(&Dbdict::createObj_prepare_complete_done);
(this->*f_dict_op[createObjPtr.p->m_vt_index].m_prepare_complete) (this->*f_dict_op[createObjPtr.p->m_vt_index].m_prepare_complete)
...@@ -14964,12 +15001,12 @@ Dbdict::createObj_writeObjConf(Signal* signal, ...@@ -14964,12 +15001,12 @@ Dbdict::createObj_writeObjConf(Signal* signal,
void void
Dbdict::createObj_prepare_complete_done(Signal* signal, Dbdict::createObj_prepare_complete_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
jam(); {
CreateObjRecordPtr createObjPtr;
jam();
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData)); ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
//@todo check for master failed //@todo check for master failed
...@@ -14998,28 +15035,33 @@ Dbdict::createObj_prepare_complete_done(Signal* signal, ...@@ -14998,28 +15035,33 @@ Dbdict::createObj_prepare_complete_done(Signal* signal,
} }
void void
Dbdict::createObj_commit(Signal * signal, SchemaOp * op){ Dbdict::createObj_commit(Signal * signal, SchemaOp * op)
jam(); {
OpCreateObj * createObj = (OpCreateObj*)op; OpCreateObj * createObj = (OpCreateObj*)op;
createObj->m_callback.m_callbackFunction = createObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_commit_start_done); safe_cast(&Dbdict::createObj_commit_start_done);
if (f_dict_op[createObj->m_vt_index].m_commit_start) if (f_dict_op[createObj->m_vt_index].m_commit_start)
{
jam();
(this->*f_dict_op[createObj->m_vt_index].m_commit_start)(signal, createObj); (this->*f_dict_op[createObj->m_vt_index].m_commit_start)(signal, createObj);
}
else else
{
jam();
execute(signal, createObj->m_callback, 0); execute(signal, createObj->m_callback, 0);
}
} }
void void
Dbdict::createObj_commit_start_done(Signal* signal, Dbdict::createObj_commit_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
{
CreateObjRecordPtr createObjPtr;
jam(); jam();
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData)); ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
Uint32 objId = createObjPtr.p->m_obj_id; Uint32 objId = createObjPtr.p->m_obj_id;
...@@ -15039,29 +15081,35 @@ Dbdict::createObj_commit_start_done(Signal* signal, ...@@ -15039,29 +15081,35 @@ Dbdict::createObj_commit_start_done(Signal* signal,
void void
Dbdict::createObj_writeSchemaConf2(Signal* signal, Dbdict::createObj_writeSchemaConf2(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
jam(); {
CreateObjRecordPtr createObjPtr; CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
createObjPtr.p->m_callback.m_callbackFunction = createObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_commit_complete_done); safe_cast(&Dbdict::createObj_commit_complete_done);
if (f_dict_op[createObjPtr.p->m_vt_index].m_commit_complete) if (f_dict_op[createObjPtr.p->m_vt_index].m_commit_complete)
{
jam();
(this->*f_dict_op[createObjPtr.p->m_vt_index].m_commit_complete) (this->*f_dict_op[createObjPtr.p->m_vt_index].m_commit_complete)
(signal, createObjPtr.p); (signal, createObjPtr.p);
}
else else
{
jam();
execute(signal, createObjPtr.p->m_callback, 0); execute(signal, createObjPtr.p->m_callback, 0);
}
} }
void void
Dbdict::createObj_commit_complete_done(Signal* signal, Dbdict::createObj_commit_complete_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
jam(); {
CreateObjRecordPtr createObjPtr; CreateObjRecordPtr createObjPtr;
jam();
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData)); ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
//@todo check error //@todo check error
...@@ -15079,27 +15127,31 @@ Dbdict::createObj_commit_complete_done(Signal* signal, ...@@ -15079,27 +15127,31 @@ Dbdict::createObj_commit_complete_done(Signal* signal,
void void
Dbdict::createObj_abort(Signal* signal, SchemaOp* op) Dbdict::createObj_abort(Signal* signal, SchemaOp* op)
{ {
jam();
OpCreateObj * createObj = (OpCreateObj*)op; OpCreateObj * createObj = (OpCreateObj*)op;
createObj->m_callback.m_callbackFunction = createObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_abort_start_done); safe_cast(&Dbdict::createObj_abort_start_done);
if (f_dict_op[createObj->m_vt_index].m_abort_start) if (f_dict_op[createObj->m_vt_index].m_abort_start)
{
jam();
(this->*f_dict_op[createObj->m_vt_index].m_abort_start)(signal, createObj); (this->*f_dict_op[createObj->m_vt_index].m_abort_start)(signal, createObj);
}
else else
{
jam();
execute(signal, createObj->m_callback, 0); execute(signal, createObj->m_callback, 0);
}
} }
void void
Dbdict::createObj_abort_start_done(Signal* signal, Dbdict::createObj_abort_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode){ Uint32 returnCode)
jam(); {
CreateObjRecordPtr createObjPtr; CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
jam();
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0]; XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
SchemaFile::TableEntry objEntry = * getTableEntry(xsf, SchemaFile::TableEntry objEntry = * getTableEntry(xsf,
createObjPtr.p->m_obj_id); createObjPtr.p->m_obj_id);
...@@ -15118,19 +15170,23 @@ Dbdict::createObj_abort_writeSchemaConf(Signal* signal, ...@@ -15118,19 +15170,23 @@ Dbdict::createObj_abort_writeSchemaConf(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
jam();
CreateObjRecordPtr createObjPtr; CreateObjRecordPtr createObjPtr;
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
createObjPtr.p->m_callback.m_callbackFunction = createObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::createObj_abort_complete_done); safe_cast(&Dbdict::createObj_abort_complete_done);
if (f_dict_op[createObjPtr.p->m_vt_index].m_abort_complete) if (f_dict_op[createObjPtr.p->m_vt_index].m_abort_complete)
{
jam();
(this->*f_dict_op[createObjPtr.p->m_vt_index].m_abort_complete) (this->*f_dict_op[createObjPtr.p->m_vt_index].m_abort_complete)
(signal, createObjPtr.p); (signal, createObjPtr.p);
}
else else
{
jam();
execute(signal, createObjPtr.p->m_callback, 0); execute(signal, createObjPtr.p->m_callback, 0);
}
} }
void void
...@@ -15138,9 +15194,9 @@ Dbdict::createObj_abort_complete_done(Signal* signal, ...@@ -15138,9 +15194,9 @@ Dbdict::createObj_abort_complete_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
jam();
CreateObjRecordPtr createObjPtr; CreateObjRecordPtr createObjPtr;
jam();
ndbrequire(c_opCreateObj.find(createObjPtr, callbackData)); ndbrequire(c_opCreateObj.find(createObjPtr, callbackData));
DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr(); DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr();
...@@ -15153,7 +15209,8 @@ Dbdict::createObj_abort_complete_done(Signal* signal, ...@@ -15153,7 +15209,8 @@ Dbdict::createObj_abort_complete_done(Signal* signal,
} }
void void
Dbdict::execDROP_OBJ_REQ(Signal* signal){ Dbdict::execDROP_OBJ_REQ(Signal* signal)
{
jamEntry(); jamEntry();
if(!assembleFragments(signal)){ if(!assembleFragments(signal)){
...@@ -15191,8 +15248,9 @@ Dbdict::execDROP_OBJ_REQ(Signal* signal){ ...@@ -15191,8 +15248,9 @@ Dbdict::execDROP_OBJ_REQ(Signal* signal){
case DictTabInfo::Tablespace: case DictTabInfo::Tablespace:
case DictTabInfo::LogfileGroup: case DictTabInfo::LogfileGroup:
{ {
dropObjPtr.p->m_vt_index = 3;
Ptr<Filegroup> fg_ptr; Ptr<Filegroup> fg_ptr;
jam();
dropObjPtr.p->m_vt_index = 3;
ndbrequire(c_filegroup_hash.find(fg_ptr, objId)); ndbrequire(c_filegroup_hash.find(fg_ptr, objId));
dropObjPtr.p->m_obj_ptr_i = fg_ptr.i; dropObjPtr.p->m_obj_ptr_i = fg_ptr.i;
break; break;
...@@ -15200,15 +15258,19 @@ Dbdict::execDROP_OBJ_REQ(Signal* signal){ ...@@ -15200,15 +15258,19 @@ Dbdict::execDROP_OBJ_REQ(Signal* signal){
} }
case DictTabInfo::Datafile: case DictTabInfo::Datafile:
{ {
dropObjPtr.p->m_vt_index = 2;
Ptr<File> file_ptr; Ptr<File> file_ptr;
jam();
dropObjPtr.p->m_vt_index = 2;
ndbrequire(c_file_hash.find(file_ptr, objId)); ndbrequire(c_file_hash.find(file_ptr, objId));
dropObjPtr.p->m_obj_ptr_i = file_ptr.i; dropObjPtr.p->m_obj_ptr_i = file_ptr.i;
break; break;
} }
case DictTabInfo::Undofile: case DictTabInfo::Undofile:
{
jam();
dropObjPtr.p->m_vt_index = 4; dropObjPtr.p->m_vt_index = 4;
return; return;
}
default: default:
ndbrequire(false); ndbrequire(false);
} }
...@@ -15223,12 +15285,12 @@ Dbdict::dropObj_prepare_start_done(Signal* signal, ...@@ -15223,12 +15285,12 @@ Dbdict::dropObj_prepare_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
ndbrequire(returnCode == 0);
DropObjRecordPtr dropObjPtr; DropObjRecordPtr dropObjPtr;
Callback cb;
ndbrequire(returnCode == 0);
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData)); ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
Callback cb;
cb.m_callbackData = callbackData; cb.m_callbackData = callbackData;
cb.m_callbackFunction = cb.m_callbackFunction =
safe_cast(&Dbdict::dropObj_prepare_writeSchemaConf); safe_cast(&Dbdict::dropObj_prepare_writeSchemaConf);
...@@ -15239,7 +15301,7 @@ Dbdict::dropObj_prepare_start_done(Signal* signal, ...@@ -15239,7 +15301,7 @@ Dbdict::dropObj_prepare_start_done(Signal* signal,
dropObj_prepare_complete_done(signal, callbackData, 0); dropObj_prepare_complete_done(signal, callbackData, 0);
return; return;
} }
jam();
Uint32 objId = dropObjPtr.p->m_obj_id; Uint32 objId = dropObjPtr.p->m_obj_id;
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0]; XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
SchemaFile::TableEntry objEntry = *getTableEntry(xsf, objId); SchemaFile::TableEntry objEntry = *getTableEntry(xsf, objId);
...@@ -15252,19 +15314,23 @@ Dbdict::dropObj_prepare_writeSchemaConf(Signal* signal, ...@@ -15252,19 +15314,23 @@ Dbdict::dropObj_prepare_writeSchemaConf(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
ndbrequire(returnCode == 0);
DropObjRecordPtr dropObjPtr; DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
ndbrequire(returnCode == 0);
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
dropObjPtr.p->m_callback.m_callbackFunction = dropObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_prepare_complete_done); safe_cast(&Dbdict::dropObj_prepare_complete_done);
if(f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete) if(f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete)
{
jam();
(this->*f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete) (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_prepare_complete)
(signal, dropObjPtr.p); (signal, dropObjPtr.p);
}
else else
{
jam();
execute(signal, dropObjPtr.p->m_callback, 0); execute(signal, dropObjPtr.p->m_callback, 0);
}
} }
void void
...@@ -15272,10 +15338,11 @@ Dbdict::dropObj_prepare_complete_done(Signal* signal, ...@@ -15272,10 +15338,11 @@ Dbdict::dropObj_prepare_complete_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
ndbrequire(returnCode == 0);
DropObjRecordPtr dropObjPtr; DropObjRecordPtr dropObjPtr;
ndbrequire(returnCode == 0);
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData)); ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
jam();
//@todo check for master failed //@todo check for master failed
...@@ -15301,16 +15368,22 @@ Dbdict::dropObj_prepare_complete_done(Signal* signal, ...@@ -15301,16 +15368,22 @@ Dbdict::dropObj_prepare_complete_done(Signal* signal,
} }
void void
Dbdict::dropObj_commit(Signal * signal, SchemaOp * op){ Dbdict::dropObj_commit(Signal * signal, SchemaOp * op)
jam(); {
OpDropObj * dropObj = (OpDropObj*)op; OpDropObj * dropObj = (OpDropObj*)op;
dropObj->m_callback.m_callbackFunction = dropObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_commit_start_done); safe_cast(&Dbdict::dropObj_commit_start_done);
if (f_dict_op[dropObj->m_vt_index].m_commit_start) if (f_dict_op[dropObj->m_vt_index].m_commit_start)
{
jam();
(this->*f_dict_op[dropObj->m_vt_index].m_commit_start)(signal, dropObj); (this->*f_dict_op[dropObj->m_vt_index].m_commit_start)(signal, dropObj);
}
else else
{
jam();
execute(signal, dropObj->m_callback, 0); execute(signal, dropObj->m_callback, 0);
}
} }
void void
...@@ -15318,10 +15391,10 @@ Dbdict::dropObj_commit_start_done(Signal* signal, ...@@ -15318,10 +15391,10 @@ Dbdict::dropObj_commit_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
DropObjRecordPtr dropObjPtr;
jam(); jam();
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData)); ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
Uint32 objId = dropObjPtr.p->m_obj_id; Uint32 objId = dropObjPtr.p->m_obj_id;
...@@ -15342,20 +15415,25 @@ Dbdict::dropObj_commit_writeSchemaConf(Signal* signal, ...@@ -15342,20 +15415,25 @@ Dbdict::dropObj_commit_writeSchemaConf(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
DropObjRecordPtr dropObjPtr;
jam(); jam();
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData)); ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
dropObjPtr.p->m_callback.m_callbackFunction = dropObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_commit_complete_done); safe_cast(&Dbdict::dropObj_commit_complete_done);
if(f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete) if(f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
{
jam();
(this->*f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete) (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_commit_complete)
(signal, dropObjPtr.p); (signal, dropObjPtr.p);
}
else else
{
jam();
execute(signal, dropObjPtr.p->m_callback, 0); execute(signal, dropObjPtr.p->m_callback, 0);
}
} }
void void
...@@ -15364,6 +15442,8 @@ Dbdict::dropObj_commit_complete_done(Signal* signal, ...@@ -15364,6 +15442,8 @@ Dbdict::dropObj_commit_complete_done(Signal* signal,
Uint32 returnCode) Uint32 returnCode)
{ {
DropObjRecordPtr dropObjPtr; DropObjRecordPtr dropObjPtr;
jam();
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData)); ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
//@todo check error //@todo check error
...@@ -15374,22 +15454,26 @@ Dbdict::dropObj_commit_complete_done(Signal* signal, ...@@ -15374,22 +15454,26 @@ Dbdict::dropObj_commit_complete_done(Signal* signal,
conf->senderData = dropObjPtr.p->m_senderData; conf->senderData = dropObjPtr.p->m_senderData;
sendSignal(dropObjPtr.p->m_senderRef, GSN_DICT_COMMIT_CONF, sendSignal(dropObjPtr.p->m_senderRef, GSN_DICT_COMMIT_CONF,
signal, DictCommitConf::SignalLength, JBB); signal, DictCommitConf::SignalLength, JBB);
c_opDropObj.release(dropObjPtr); c_opDropObj.release(dropObjPtr);
} }
void void
Dbdict::dropObj_abort(Signal * signal, SchemaOp * op){ Dbdict::dropObj_abort(Signal * signal, SchemaOp * op)
jam(); {
OpDropObj * dropObj = (OpDropObj*)op; OpDropObj * dropObj = (OpDropObj*)op;
dropObj->m_callback.m_callbackFunction = dropObj->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_abort_start_done); safe_cast(&Dbdict::dropObj_abort_start_done);
if (f_dict_op[dropObj->m_vt_index].m_abort_start) if (f_dict_op[dropObj->m_vt_index].m_abort_start)
{
jam();
(this->*f_dict_op[dropObj->m_vt_index].m_abort_start)(signal, dropObj); (this->*f_dict_op[dropObj->m_vt_index].m_abort_start)(signal, dropObj);
}
else else
{
jam();
execute(signal, dropObj->m_callback, 0); execute(signal, dropObj->m_callback, 0);
}
} }
void void
...@@ -15397,10 +15481,10 @@ Dbdict::dropObj_abort_start_done(Signal* signal, ...@@ -15397,10 +15481,10 @@ Dbdict::dropObj_abort_start_done(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
DropObjRecordPtr dropObjPtr;
jam(); jam();
ndbrequire(returnCode == 0); ndbrequire(returnCode == 0);
DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData)); ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0]; XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
...@@ -15421,6 +15505,7 @@ Dbdict::dropObj_abort_start_done(Signal* signal, ...@@ -15421,6 +15505,7 @@ Dbdict::dropObj_abort_start_done(Signal* signal,
} }
else else
{ {
jam();
execute(signal, callback, 0); execute(signal, callback, 0);
} }
} }
...@@ -15430,20 +15515,24 @@ Dbdict::dropObj_abort_writeSchemaConf(Signal* signal, ...@@ -15430,20 +15515,24 @@ Dbdict::dropObj_abort_writeSchemaConf(Signal* signal,
Uint32 callbackData, Uint32 callbackData,
Uint32 returnCode) Uint32 returnCode)
{ {
jam();
ndbrequire(returnCode == 0);
DropObjRecordPtr dropObjPtr; DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
ndbrequire(returnCode == 0);
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
dropObjPtr.p->m_callback.m_callbackFunction = dropObjPtr.p->m_callback.m_callbackFunction =
safe_cast(&Dbdict::dropObj_abort_complete_done); safe_cast(&Dbdict::dropObj_abort_complete_done);
if(f_dict_op[dropObjPtr.p->m_vt_index].m_abort_complete) if(f_dict_op[dropObjPtr.p->m_vt_index].m_abort_complete)
{
jam();
(this->*f_dict_op[dropObjPtr.p->m_vt_index].m_abort_complete) (this->*f_dict_op[dropObjPtr.p->m_vt_index].m_abort_complete)
(signal, dropObjPtr.p); (signal, dropObjPtr.p);
}
else else
{
jam();
execute(signal, dropObjPtr.p->m_callback, 0); execute(signal, dropObjPtr.p->m_callback, 0);
}
} }
void void
...@@ -15452,23 +15541,25 @@ Dbdict::dropObj_abort_complete_done(Signal* signal, ...@@ -15452,23 +15541,25 @@ Dbdict::dropObj_abort_complete_done(Signal* signal,
Uint32 returnCode) Uint32 returnCode)
{ {
DropObjRecordPtr dropObjPtr; DropObjRecordPtr dropObjPtr;
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr(); DictAbortConf * const conf = (DictAbortConf*)signal->getDataPtr();
ndbrequire(c_opDropObj.find(dropObjPtr, callbackData));
jam();
conf->senderRef = reference(); conf->senderRef = reference();
conf->senderData = dropObjPtr.p->m_senderData; conf->senderData = dropObjPtr.p->m_senderData;
sendSignal(dropObjPtr.p->m_senderRef, GSN_DICT_ABORT_CONF, sendSignal(dropObjPtr.p->m_senderRef, GSN_DICT_ABORT_CONF,
signal, DictAbortConf::SignalLength, JBB); signal, DictAbortConf::SignalLength, JBB);
c_opDropObj.release(dropObjPtr); c_opDropObj.release(dropObjPtr);
} }
void void
Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op)
{
/** /**
* Put data into table record * Put data into table record
*/ */
SegmentedSectionPtr objInfoPtr; SegmentedSectionPtr objInfoPtr;
jam();
getSection(objInfoPtr, ((OpCreateObj*)op)->m_obj_info_ptr_i); getSection(objInfoPtr, ((OpCreateObj*)op)->m_obj_info_ptr_i);
SimplePropertiesSectionReader it(objInfoPtr, getSectionSegmentPool()); SimplePropertiesSectionReader it(objInfoPtr, getSectionSegmentPool());
...@@ -15485,6 +15576,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15485,6 +15576,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
if(status != SimpleProperties::Eof) if(status != SimpleProperties::Eof)
{ {
jam();
op->m_errorCode = CreateTableRef::InvalidFormat; op->m_errorCode = CreateTableRef::InvalidFormat;
break; break;
} }
...@@ -15493,6 +15585,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15493,6 +15585,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
{ {
if(!fg.TS_ExtentSize) if(!fg.TS_ExtentSize)
{ {
jam();
op->m_errorCode = CreateFilegroupRef::InvalidExtentSize; op->m_errorCode = CreateFilegroupRef::InvalidExtentSize;
break; break;
} }
...@@ -15504,6 +15597,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15504,6 +15597,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
*/ */
if(fg.LF_UndoBufferSize < 3 * File_formats::NDB_PAGE_SIZE) if(fg.LF_UndoBufferSize < 3 * File_formats::NDB_PAGE_SIZE)
{ {
jam();
op->m_errorCode = CreateFilegroupRef::InvalidUndoBufferSize; op->m_errorCode = CreateFilegroupRef::InvalidUndoBufferSize;
break; break;
} }
...@@ -15512,16 +15606,19 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15512,16 +15606,19 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
Uint32 len = strlen(fg.FilegroupName) + 1; Uint32 len = strlen(fg.FilegroupName) + 1;
Uint32 hash = Rope::hash(fg.FilegroupName, len); Uint32 hash = Rope::hash(fg.FilegroupName, len);
if(get_object(fg.FilegroupName, len, hash) != 0){ if(get_object(fg.FilegroupName, len, hash) != 0){
jam();
op->m_errorCode = CreateTableRef::TableAlreadyExist; op->m_errorCode = CreateTableRef::TableAlreadyExist;
break; break;
} }
if(!c_obj_pool.seize(obj_ptr)){ if(!c_obj_pool.seize(obj_ptr)){
jam();
op->m_errorCode = CreateTableRef::NoMoreTableRecords; op->m_errorCode = CreateTableRef::NoMoreTableRecords;
break; break;
} }
if(!c_filegroup_pool.seize(fg_ptr)){ if(!c_filegroup_pool.seize(fg_ptr)){
jam();
op->m_errorCode = CreateTableRef::NoMoreTableRecords; op->m_errorCode = CreateTableRef::NoMoreTableRecords;
break; break;
} }
...@@ -15531,6 +15628,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15531,6 +15628,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
{ {
Rope name(c_rope_pool, obj_ptr.p->m_name); Rope name(c_rope_pool, obj_ptr.p->m_name);
if(!name.assign(fg.FilegroupName, len, hash)){ if(!name.assign(fg.FilegroupName, len, hash)){
jam();
op->m_errorCode = CreateTableRef::OutOfStringBuffer; op->m_errorCode = CreateTableRef::OutOfStringBuffer;
break; break;
} }
...@@ -15544,6 +15642,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15544,6 +15642,7 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
switch(fg.FilegroupType){ switch(fg.FilegroupType){
case DictTabInfo::Tablespace: case DictTabInfo::Tablespace:
{
//fg.TS_DataGrow = group.m_grow_spec; //fg.TS_DataGrow = group.m_grow_spec;
fg_ptr.p->m_tablespace.m_extent_size = fg.TS_ExtentSize; fg_ptr.p->m_tablespace.m_extent_size = fg.TS_ExtentSize;
fg_ptr.p->m_tablespace.m_default_logfile_group_id = fg.TS_LogfileGroupId; fg_ptr.p->m_tablespace.m_default_logfile_group_id = fg.TS_LogfileGroupId;
...@@ -15551,22 +15650,28 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15551,22 +15650,28 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
Ptr<Filegroup> lg_ptr; Ptr<Filegroup> lg_ptr;
if (!c_filegroup_hash.find(lg_ptr, fg.TS_LogfileGroupId)) if (!c_filegroup_hash.find(lg_ptr, fg.TS_LogfileGroupId))
{ {
jam();
op->m_errorCode = CreateFilegroupRef::NoSuchLogfileGroup; op->m_errorCode = CreateFilegroupRef::NoSuchLogfileGroup;
goto error; goto error;
} }
if (lg_ptr.p->m_version != fg.TS_LogfileGroupVersion) if (lg_ptr.p->m_version != fg.TS_LogfileGroupVersion)
{ {
jam();
op->m_errorCode = CreateFilegroupRef::InvalidFilegroupVersion; op->m_errorCode = CreateFilegroupRef::InvalidFilegroupVersion;
goto error; goto error;
} }
increase_ref_count(lg_ptr.p->m_obj_ptr_i); increase_ref_count(lg_ptr.p->m_obj_ptr_i);
break; break;
}
case DictTabInfo::LogfileGroup: case DictTabInfo::LogfileGroup:
{
jam();
fg_ptr.p->m_logfilegroup.m_undo_buffer_size = fg.LF_UndoBufferSize; fg_ptr.p->m_logfilegroup.m_undo_buffer_size = fg.LF_UndoBufferSize;
fg_ptr.p->m_logfilegroup.m_files.init(); fg_ptr.p->m_logfilegroup.m_files.init();
//fg.LF_UndoGrow = ; //fg.LF_UndoGrow = ;
break; break;
}
default: default:
ndbrequire(false); ndbrequire(false);
} }
...@@ -15601,13 +15706,14 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15601,13 +15706,14 @@ Dbdict::create_fg_prepare_start(Signal* signal, SchemaOp* op){
} }
void void
Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){ Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op)
{
/** /**
* CONTACT TSMAN LGMAN PGMAN * CONTACT TSMAN LGMAN PGMAN
*/ */
CreateFilegroupImplReq* req = CreateFilegroupImplReq* req =
(CreateFilegroupImplReq*)signal->getDataPtrSend(); (CreateFilegroupImplReq*)signal->getDataPtrSend();
jam();
req->senderData = op->key; req->senderData = op->key;
req->senderRef = reference(); req->senderRef = reference();
req->filegroup_id = op->m_obj_id; req->filegroup_id = op->m_obj_id;
...@@ -15620,18 +15726,24 @@ Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){ ...@@ -15620,18 +15726,24 @@ Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){
Uint32 len= 0; Uint32 len= 0;
switch(op->m_obj_type){ switch(op->m_obj_type){
case DictTabInfo::Tablespace: case DictTabInfo::Tablespace:
{
jam();
ref = TSMAN_REF; ref = TSMAN_REF;
len = CreateFilegroupImplReq::TablespaceLength; len = CreateFilegroupImplReq::TablespaceLength;
req->tablespace.extent_size = fg_ptr.p->m_tablespace.m_extent_size; req->tablespace.extent_size = fg_ptr.p->m_tablespace.m_extent_size;
req->tablespace.logfile_group_id = req->tablespace.logfile_group_id =
fg_ptr.p->m_tablespace.m_default_logfile_group_id; fg_ptr.p->m_tablespace.m_default_logfile_group_id;
break; break;
}
case DictTabInfo::LogfileGroup: case DictTabInfo::LogfileGroup:
{
jam();
ref = LGMAN_REF; ref = LGMAN_REF;
len = CreateFilegroupImplReq::LogfileGroupLength; len = CreateFilegroupImplReq::LogfileGroupLength;
req->logfile_group.buffer_size = req->logfile_group.buffer_size =
fg_ptr.p->m_logfilegroup.m_undo_buffer_size; fg_ptr.p->m_logfilegroup.m_undo_buffer_size;
break; break;
}
default: default:
ndbrequire(false); ndbrequire(false);
} }
...@@ -15640,12 +15752,11 @@ Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){ ...@@ -15640,12 +15752,11 @@ Dbdict::create_fg_prepare_complete(Signal* signal, SchemaOp* op){
} }
void void
Dbdict::execCREATE_FILEGROUP_REF(Signal* signal){ Dbdict::execCREATE_FILEGROUP_REF(Signal* signal)
jamEntry(); {
CreateFilegroupImplRef * ref = (CreateFilegroupImplRef*)signal->getDataPtr(); CreateFilegroupImplRef * ref = (CreateFilegroupImplRef*)signal->getDataPtr();
CreateObjRecordPtr op_ptr; CreateObjRecordPtr op_ptr;
jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, ref->senderData)); ndbrequire(c_opCreateObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode; op_ptr.p->m_errorCode = ref->errorCode;
...@@ -15653,13 +15764,12 @@ Dbdict::execCREATE_FILEGROUP_REF(Signal* signal){ ...@@ -15653,13 +15764,12 @@ Dbdict::execCREATE_FILEGROUP_REF(Signal* signal){
} }
void void
Dbdict::execCREATE_FILEGROUP_CONF(Signal* signal){ Dbdict::execCREATE_FILEGROUP_CONF(Signal* signal)
jamEntry(); {
CreateFilegroupImplConf * rep = CreateFilegroupImplConf * rep =
(CreateFilegroupImplConf*)signal->getDataPtr(); (CreateFilegroupImplConf*)signal->getDataPtr();
CreateObjRecordPtr op_ptr; CreateObjRecordPtr op_ptr;
jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, rep->senderData)); ndbrequire(c_opCreateObj.find(op_ptr, rep->senderData));
execute(signal, op_ptr.p->m_callback, 0); execute(signal, op_ptr.p->m_callback, 0);
...@@ -15675,13 +15785,13 @@ Dbdict::create_fg_abort_start(Signal* signal, SchemaOp* op){ ...@@ -15675,13 +15785,13 @@ Dbdict::create_fg_abort_start(Signal* signal, SchemaOp* op){
send_drop_fg(signal, op, DropFilegroupImplReq::Commit); send_drop_fg(signal, op, DropFilegroupImplReq::Commit);
return; return;
} }
jam();
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
void void
Dbdict::create_fg_abort_complete(Signal* signal, SchemaOp* op){ Dbdict::create_fg_abort_complete(Signal* signal, SchemaOp* op)
{
if (op->m_obj_ptr_i != RNIL) if (op->m_obj_ptr_i != RNIL)
{ {
jam(); jam();
...@@ -15691,12 +15801,13 @@ Dbdict::create_fg_abort_complete(Signal* signal, SchemaOp* op){ ...@@ -15691,12 +15801,13 @@ Dbdict::create_fg_abort_complete(Signal* signal, SchemaOp* op){
release_object(fg_ptr.p->m_obj_ptr_i); release_object(fg_ptr.p->m_obj_ptr_i);
c_filegroup_hash.release(fg_ptr); c_filegroup_hash.release(fg_ptr);
} }
jam();
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
void void
Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op)
{
/** /**
* Put data into table record * Put data into table record
*/ */
...@@ -15716,6 +15827,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15716,6 +15827,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
do { do {
if(status != SimpleProperties::Eof){ if(status != SimpleProperties::Eof){
jam();
op->m_errorCode = CreateFileRef::InvalidFormat; op->m_errorCode = CreateFileRef::InvalidFormat;
break; break;
} }
...@@ -15723,34 +15835,53 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15723,34 +15835,53 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
// Get Filegroup // Get Filegroup
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
if(!c_filegroup_hash.find(fg_ptr, f.FilegroupId)){ if(!c_filegroup_hash.find(fg_ptr, f.FilegroupId)){
jam();
op->m_errorCode = CreateFileRef::NoSuchFilegroup; op->m_errorCode = CreateFileRef::NoSuchFilegroup;
break; break;
} }
if(fg_ptr.p->m_version != f.FilegroupVersion){ if(fg_ptr.p->m_version != f.FilegroupVersion){
jam();
op->m_errorCode = CreateFileRef::InvalidFilegroupVersion; op->m_errorCode = CreateFileRef::InvalidFilegroupVersion;
break; break;
} }
switch(f.FileType){ switch(f.FileType){
case DictTabInfo::Datafile: case DictTabInfo::Datafile:
{
if(fg_ptr.p->m_type != DictTabInfo::Tablespace) if(fg_ptr.p->m_type != DictTabInfo::Tablespace)
{
jam();
op->m_errorCode = CreateFileRef::InvalidFileType; op->m_errorCode = CreateFileRef::InvalidFileType;
}
jam();
break; break;
}
case DictTabInfo::Undofile: case DictTabInfo::Undofile:
{
if(fg_ptr.p->m_type != DictTabInfo::LogfileGroup) if(fg_ptr.p->m_type != DictTabInfo::LogfileGroup)
{
jam();
op->m_errorCode = CreateFileRef::InvalidFileType; op->m_errorCode = CreateFileRef::InvalidFileType;
}
jam();
break; break;
}
default: default:
jam();
op->m_errorCode = CreateFileRef::InvalidFileType; op->m_errorCode = CreateFileRef::InvalidFileType;
} }
if(op->m_errorCode) if(op->m_errorCode)
{
jam();
break; break;
}
Uint32 len = strlen(f.FileName) + 1; Uint32 len = strlen(f.FileName) + 1;
Uint32 hash = Rope::hash(f.FileName, len); Uint32 hash = Rope::hash(f.FileName, len);
if(get_object(f.FileName, len, hash) != 0){ if(get_object(f.FileName, len, hash) != 0){
jam();
op->m_errorCode = CreateFileRef::FilenameAlreadyExists; op->m_errorCode = CreateFileRef::FilenameAlreadyExists;
break; break;
} }
...@@ -15761,6 +15892,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15761,6 +15892,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
m_ctx.m_config.getOwnConfigIterator(); m_ctx.m_config.getOwnConfigIterator();
if(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) && dl) if(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) && dl)
{ {
jam();
op->m_errorCode = CreateFileRef::NotSupportedWhenDiskless; op->m_errorCode = CreateFileRef::NotSupportedWhenDiskless;
break; break;
} }
...@@ -15768,11 +15900,13 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15768,11 +15900,13 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
// Loop through all filenames... // Loop through all filenames...
if(!c_obj_pool.seize(obj_ptr)){ if(!c_obj_pool.seize(obj_ptr)){
jam();
op->m_errorCode = CreateTableRef::NoMoreTableRecords; op->m_errorCode = CreateTableRef::NoMoreTableRecords;
break; break;
} }
if (! c_file_pool.seize(filePtr)){ if (! c_file_pool.seize(filePtr)){
jam();
op->m_errorCode = CreateFileRef::OutOfFileRecords; op->m_errorCode = CreateFileRef::OutOfFileRecords;
break; break;
} }
...@@ -15782,6 +15916,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15782,6 +15916,7 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
{ {
Rope name(c_rope_pool, obj_ptr.p->m_name); Rope name(c_rope_pool, obj_ptr.p->m_name);
if(!name.assign(f.FileName, len, hash)){ if(!name.assign(f.FileName, len, hash)){
jam();
op->m_errorCode = CreateTableRef::OutOfStringBuffer; op->m_errorCode = CreateTableRef::OutOfStringBuffer;
break; break;
} }
...@@ -15789,10 +15924,14 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15789,10 +15924,14 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
switch(fg_ptr.p->m_type){ switch(fg_ptr.p->m_type){
case DictTabInfo::Tablespace: case DictTabInfo::Tablespace:
{
jam();
increase_ref_count(fg_ptr.p->m_obj_ptr_i); increase_ref_count(fg_ptr.p->m_obj_ptr_i);
break; break;
}
case DictTabInfo::LogfileGroup: case DictTabInfo::LogfileGroup:
{ {
jam();
Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files); Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
list.add(filePtr); list.add(filePtr);
break; break;
...@@ -15836,37 +15975,46 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){ ...@@ -15836,37 +15975,46 @@ Dbdict::create_file_prepare_start(Signal* signal, SchemaOp* op){
c_obj_pool.release(obj_ptr); c_obj_pool.release(obj_ptr);
} }
} }
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
void void
Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){ Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op)
{
/** /**
* CONTACT TSMAN LGMAN PGMAN * CONTACT TSMAN LGMAN PGMAN
*/ */
CreateFileImplReq* req = (CreateFileImplReq*)signal->getDataPtrSend(); CreateFileImplReq* req = (CreateFileImplReq*)signal->getDataPtrSend();
FilePtr f_ptr; FilePtr f_ptr;
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
jam();
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id)); ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key; req->senderData = op->key;
req->senderRef = reference(); req->senderRef = reference();
switch(((OpCreateObj*)op)->m_restart){ switch(((OpCreateObj*)op)->m_restart){
case 0: case 0:
{
jam();
req->requestInfo = CreateFileImplReq::Create; req->requestInfo = CreateFileImplReq::Create;
break; break;
}
case 1: case 1:
{
jam();
req->requestInfo = CreateFileImplReq::Open; req->requestInfo = CreateFileImplReq::Open;
break; break;
}
case 2: case 2:
{
jam();
req->requestInfo = CreateFileImplReq::CreateForce; req->requestInfo = CreateFileImplReq::CreateForce;
break; break;
} }
}
req->file_id = f_ptr.p->key; req->file_id = f_ptr.p->key;
req->filegroup_id = f_ptr.p->m_filegroup_id; req->filegroup_id = f_ptr.p->m_filegroup_id;
...@@ -15878,14 +16026,20 @@ Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){ ...@@ -15878,14 +16026,20 @@ Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){
Uint32 len= 0; Uint32 len= 0;
switch(op->m_obj_type){ switch(op->m_obj_type){
case DictTabInfo::Datafile: case DictTabInfo::Datafile:
{
jam();
ref = TSMAN_REF; ref = TSMAN_REF;
len = CreateFileImplReq::DatafileLength; len = CreateFileImplReq::DatafileLength;
req->tablespace.extent_size = fg_ptr.p->m_tablespace.m_extent_size; req->tablespace.extent_size = fg_ptr.p->m_tablespace.m_extent_size;
break; break;
}
case DictTabInfo::Undofile: case DictTabInfo::Undofile:
{
jam();
ref = LGMAN_REF; ref = LGMAN_REF;
len = CreateFileImplReq::UndofileLength; len = CreateFileImplReq::UndofileLength;
break; break;
}
default: default:
ndbrequire(false); ndbrequire(false);
} }
...@@ -15900,42 +16054,41 @@ Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){ ...@@ -15900,42 +16054,41 @@ Dbdict::create_file_prepare_complete(Signal* signal, SchemaOp* op){
} }
void void
Dbdict::execCREATE_FILE_REF(Signal* signal){ Dbdict::execCREATE_FILE_REF(Signal* signal)
jamEntry(); {
CreateFileImplRef * ref = (CreateFileImplRef*)signal->getDataPtr(); CreateFileImplRef * ref = (CreateFileImplRef*)signal->getDataPtr();
CreateObjRecordPtr op_ptr; CreateObjRecordPtr op_ptr;
jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, ref->senderData)); ndbrequire(c_opCreateObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode; op_ptr.p->m_errorCode = ref->errorCode;
execute(signal, op_ptr.p->m_callback, 0); execute(signal, op_ptr.p->m_callback, 0);
} }
void void
Dbdict::execCREATE_FILE_CONF(Signal* signal){ Dbdict::execCREATE_FILE_CONF(Signal* signal)
jamEntry(); {
CreateFileImplConf * rep = CreateFileImplConf * rep =
(CreateFileImplConf*)signal->getDataPtr(); (CreateFileImplConf*)signal->getDataPtr();
CreateObjRecordPtr op_ptr; CreateObjRecordPtr op_ptr;
ndbrequire(c_opCreateObj.find(op_ptr, rep->senderData));
jamEntry();
ndbrequire(c_opCreateObj.find(op_ptr, rep->senderData));
execute(signal, op_ptr.p->m_callback, 0); execute(signal, op_ptr.p->m_callback, 0);
} }
void void
Dbdict::create_file_commit_start(Signal* signal, SchemaOp* op){ Dbdict::create_file_commit_start(Signal* signal, SchemaOp* op)
{
/** /**
* CONTACT TSMAN LGMAN PGMAN * CONTACT TSMAN LGMAN PGMAN
*/ */
CreateFileImplReq* req = (CreateFileImplReq*)signal->getDataPtrSend(); CreateFileImplReq* req = (CreateFileImplReq*)signal->getDataPtrSend();
FilePtr f_ptr; FilePtr f_ptr;
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
jam();
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id)); ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key; req->senderData = op->key;
...@@ -15949,15 +16102,20 @@ Dbdict::create_file_commit_start(Signal* signal, SchemaOp* op){ ...@@ -15949,15 +16102,20 @@ Dbdict::create_file_commit_start(Signal* signal, SchemaOp* op){
Uint32 ref= 0; Uint32 ref= 0;
switch(op->m_obj_type){ switch(op->m_obj_type){
case DictTabInfo::Datafile: case DictTabInfo::Datafile:
{
jam();
ref = TSMAN_REF; ref = TSMAN_REF;
break; break;
}
case DictTabInfo::Undofile: case DictTabInfo::Undofile:
{
jam();
ref = LGMAN_REF; ref = LGMAN_REF;
break; break;
}
default: default:
ndbrequire(false); ndbrequire(false);
} }
sendSignal(ref, GSN_CREATE_FILE_REQ, signal, sendSignal(ref, GSN_CREATE_FILE_REQ, signal,
CreateFileImplReq::CommitLength, JBB); CreateFileImplReq::CommitLength, JBB);
} }
...@@ -15970,9 +16128,11 @@ Dbdict::create_file_abort_start(Signal* signal, SchemaOp* op) ...@@ -15970,9 +16128,11 @@ Dbdict::create_file_abort_start(Signal* signal, SchemaOp* op)
if (op->m_obj_ptr_i != RNIL) if (op->m_obj_ptr_i != RNIL)
{ {
FilePtr f_ptr; FilePtr f_ptr;
FilegroupPtr fg_ptr;
jam();
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i); c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
FilegroupPtr fg_ptr;
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id)); ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key; req->senderData = op->key;
...@@ -15986,20 +16146,24 @@ Dbdict::create_file_abort_start(Signal* signal, SchemaOp* op) ...@@ -15986,20 +16146,24 @@ Dbdict::create_file_abort_start(Signal* signal, SchemaOp* op)
Uint32 ref= 0; Uint32 ref= 0;
switch(op->m_obj_type){ switch(op->m_obj_type){
case DictTabInfo::Datafile: case DictTabInfo::Datafile:
{
jam();
ref = TSMAN_REF; ref = TSMAN_REF;
break; break;
}
case DictTabInfo::Undofile: case DictTabInfo::Undofile:
{
jam();
ref = LGMAN_REF; ref = LGMAN_REF;
break; break;
}
default: default:
ndbrequire(false); ndbrequire(false);
} }
sendSignal(ref, GSN_CREATE_FILE_REQ, signal, sendSignal(ref, GSN_CREATE_FILE_REQ, signal,
CreateFileImplReq::AbortLength, JBB); CreateFileImplReq::AbortLength, JBB);
return; return;
} }
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
...@@ -16009,17 +16173,21 @@ Dbdict::create_file_abort_complete(Signal* signal, SchemaOp* op) ...@@ -16009,17 +16173,21 @@ Dbdict::create_file_abort_complete(Signal* signal, SchemaOp* op)
if (op->m_obj_ptr_i != RNIL) if (op->m_obj_ptr_i != RNIL)
{ {
FilePtr f_ptr; FilePtr f_ptr;
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
jam();
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
switch(fg_ptr.p->m_type){ switch(fg_ptr.p->m_type){
case DictTabInfo::Tablespace: case DictTabInfo::Tablespace:
{
jam();
decrease_ref_count(fg_ptr.p->m_obj_ptr_i); decrease_ref_count(fg_ptr.p->m_obj_ptr_i);
break; break;
}
case DictTabInfo::LogfileGroup: case DictTabInfo::LogfileGroup:
{ {
jam();
Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files); Local_file_list list(c_file_pool, fg_ptr.p->m_logfilegroup.m_files);
list.remove(f_ptr); list.remove(f_ptr);
break; break;
...@@ -16031,19 +16199,20 @@ Dbdict::create_file_abort_complete(Signal* signal, SchemaOp* op) ...@@ -16031,19 +16199,20 @@ Dbdict::create_file_abort_complete(Signal* signal, SchemaOp* op)
release_object(f_ptr.p->m_obj_ptr_i); release_object(f_ptr.p->m_obj_ptr_i);
c_file_hash.release(f_ptr); c_file_hash.release(f_ptr);
} }
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
void void
Dbdict::drop_file_prepare_start(Signal* signal, SchemaOp* op) Dbdict::drop_file_prepare_start(Signal* signal, SchemaOp* op)
{ {
jam();
send_drop_file(signal, op, DropFileImplReq::Prepare); send_drop_file(signal, op, DropFileImplReq::Prepare);
} }
void void
Dbdict::drop_undofile_prepare_start(Signal* signal, SchemaOp* op) Dbdict::drop_undofile_prepare_start(Signal* signal, SchemaOp* op)
{ {
jam();
op->m_errorCode = DropFileRef::DropUndoFileNotSupported; op->m_errorCode = DropFileRef::DropUndoFileNotSupported;
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
...@@ -16051,6 +16220,7 @@ Dbdict::drop_undofile_prepare_start(Signal* signal, SchemaOp* op) ...@@ -16051,6 +16220,7 @@ Dbdict::drop_undofile_prepare_start(Signal* signal, SchemaOp* op)
void void
Dbdict::drop_file_commit_start(Signal* signal, SchemaOp* op) Dbdict::drop_file_commit_start(Signal* signal, SchemaOp* op)
{ {
jam();
send_drop_file(signal, op, DropFileImplReq::Commit); send_drop_file(signal, op, DropFileImplReq::Commit);
} }
...@@ -16058,21 +16228,21 @@ void ...@@ -16058,21 +16228,21 @@ void
Dbdict::drop_file_commit_complete(Signal* signal, SchemaOp* op) Dbdict::drop_file_commit_complete(Signal* signal, SchemaOp* op)
{ {
FilePtr f_ptr; FilePtr f_ptr;
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
jam();
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
decrease_ref_count(fg_ptr.p->m_obj_ptr_i); decrease_ref_count(fg_ptr.p->m_obj_ptr_i);
release_object(f_ptr.p->m_obj_ptr_i); release_object(f_ptr.p->m_obj_ptr_i);
c_file_hash.release(f_ptr); c_file_hash.release(f_ptr);
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
void void
Dbdict::drop_file_abort_start(Signal* signal, SchemaOp* op) Dbdict::drop_file_abort_start(Signal* signal, SchemaOp* op)
{ {
jam();
send_drop_file(signal, op, DropFileImplReq::Abort); send_drop_file(signal, op, DropFileImplReq::Abort);
} }
...@@ -16081,11 +16251,11 @@ Dbdict::send_drop_file(Signal* signal, SchemaOp* op, ...@@ -16081,11 +16251,11 @@ Dbdict::send_drop_file(Signal* signal, SchemaOp* op,
DropFileImplReq::RequestInfo type) DropFileImplReq::RequestInfo type)
{ {
DropFileImplReq* req = (DropFileImplReq*)signal->getDataPtrSend(); DropFileImplReq* req = (DropFileImplReq*)signal->getDataPtrSend();
FilePtr f_ptr; FilePtr f_ptr;
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
jam();
c_file_pool.getPtr(f_ptr, op->m_obj_ptr_i);
ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id)); ndbrequire(c_filegroup_hash.find(fg_ptr, f_ptr.p->m_filegroup_id));
req->senderData = op->key; req->senderData = op->key;
...@@ -16099,29 +16269,34 @@ Dbdict::send_drop_file(Signal* signal, SchemaOp* op, ...@@ -16099,29 +16269,34 @@ Dbdict::send_drop_file(Signal* signal, SchemaOp* op,
Uint32 ref= 0; Uint32 ref= 0;
switch(op->m_obj_type){ switch(op->m_obj_type){
case DictTabInfo::Datafile: case DictTabInfo::Datafile:
{
jam();
ref = TSMAN_REF; ref = TSMAN_REF;
break; break;
}
case DictTabInfo::Undofile: case DictTabInfo::Undofile:
{
jam();
ref = LGMAN_REF; ref = LGMAN_REF;
break; break;
}
default: default:
ndbrequire(false); ndbrequire(false);
} }
sendSignal(ref, GSN_DROP_FILE_REQ, signal, sendSignal(ref, GSN_DROP_FILE_REQ, signal,
DropFileImplReq::SignalLength, JBB); DropFileImplReq::SignalLength, JBB);
} }
void void
Dbdict::execDROP_OBJ_REF(Signal* signal){ Dbdict::execDROP_OBJ_REF(Signal* signal)
jamEntry(); {
DropObjRef * const ref = (DropObjRef*)signal->getDataPtr(); DropObjRef * const ref = (DropObjRef*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
jamEntry();
ndbrequire(c_Trans.find(trans_ptr, ref->senderData));
if(ref->errorCode != DropObjRef::NF_FakeErrorREF){ if(ref->errorCode != DropObjRef::NF_FakeErrorREF){
jam();
trans_ptr.p->setErrorCode(ref->errorCode); trans_ptr.p->setErrorCode(ref->errorCode);
} }
Uint32 node = refToNode(ref->senderRef); Uint32 node = refToNode(ref->senderRef);
...@@ -16129,65 +16304,61 @@ Dbdict::execDROP_OBJ_REF(Signal* signal){ ...@@ -16129,65 +16304,61 @@ Dbdict::execDROP_OBJ_REF(Signal* signal){
} }
void void
Dbdict::execDROP_OBJ_CONF(Signal* signal){ Dbdict::execDROP_OBJ_CONF(Signal* signal)
jamEntry(); {
DropObjConf * const conf = (DropObjConf*)signal->getDataPtr(); DropObjConf * const conf = (DropObjConf*)signal->getDataPtr();
Ptr<SchemaTransaction> trans_ptr; Ptr<SchemaTransaction> trans_ptr;
jamEntry();
ndbrequire(c_Trans.find(trans_ptr, conf->senderData)); ndbrequire(c_Trans.find(trans_ptr, conf->senderData));
schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef)); schemaOp_reply(signal, trans_ptr.p, refToNode(conf->senderRef));
} }
void void
Dbdict::execDROP_FILE_REF(Signal* signal){ Dbdict::execDROP_FILE_REF(Signal* signal)
jamEntry(); {
DropFileImplRef * ref = (DropFileImplRef*)signal->getDataPtr(); DropFileImplRef * ref = (DropFileImplRef*)signal->getDataPtr();
DropObjRecordPtr op_ptr; DropObjRecordPtr op_ptr;
jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, ref->senderData)); ndbrequire(c_opDropObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode; op_ptr.p->m_errorCode = ref->errorCode;
execute(signal, op_ptr.p->m_callback, 0); execute(signal, op_ptr.p->m_callback, 0);
} }
void void
Dbdict::execDROP_FILE_CONF(Signal* signal){ Dbdict::execDROP_FILE_CONF(Signal* signal)
jamEntry(); {
DropFileImplConf * rep = DropFileImplConf * rep =
(DropFileImplConf*)signal->getDataPtr(); (DropFileImplConf*)signal->getDataPtr();
DropObjRecordPtr op_ptr; DropObjRecordPtr op_ptr;
ndbrequire(c_opDropObj.find(op_ptr, rep->senderData));
jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, rep->senderData));
execute(signal, op_ptr.p->m_callback, 0); execute(signal, op_ptr.p->m_callback, 0);
} }
void void
Dbdict::execDROP_FILEGROUP_REF(Signal* signal){ Dbdict::execDROP_FILEGROUP_REF(Signal* signal)
jamEntry(); {
DropFilegroupImplRef * ref = (DropFilegroupImplRef*)signal->getDataPtr(); DropFilegroupImplRef * ref = (DropFilegroupImplRef*)signal->getDataPtr();
DropObjRecordPtr op_ptr; DropObjRecordPtr op_ptr;
jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, ref->senderData)); ndbrequire(c_opDropObj.find(op_ptr, ref->senderData));
op_ptr.p->m_errorCode = ref->errorCode; op_ptr.p->m_errorCode = ref->errorCode;
execute(signal, op_ptr.p->m_callback, 0); execute(signal, op_ptr.p->m_callback, 0);
} }
void void
Dbdict::execDROP_FILEGROUP_CONF(Signal* signal){ Dbdict::execDROP_FILEGROUP_CONF(Signal* signal)
jamEntry(); {
DropFilegroupImplConf * rep = DropFilegroupImplConf * rep =
(DropFilegroupImplConf*)signal->getDataPtr(); (DropFilegroupImplConf*)signal->getDataPtr();
DropObjRecordPtr op_ptr; DropObjRecordPtr op_ptr;
ndbrequire(c_opDropObj.find(op_ptr, rep->senderData));
jamEntry();
ndbrequire(c_opDropObj.find(op_ptr, rep->senderData));
execute(signal, op_ptr.p->m_callback, 0); execute(signal, op_ptr.p->m_callback, 0);
} }
...@@ -16200,11 +16371,13 @@ Dbdict::drop_fg_prepare_start(Signal* signal, SchemaOp* op) ...@@ -16200,11 +16371,13 @@ Dbdict::drop_fg_prepare_start(Signal* signal, SchemaOp* op)
DictObject * obj = c_obj_pool.getPtr(fg_ptr.p->m_obj_ptr_i); DictObject * obj = c_obj_pool.getPtr(fg_ptr.p->m_obj_ptr_i);
if (obj->m_ref_count) if (obj->m_ref_count)
{ {
jam();
op->m_errorCode = DropFilegroupRef::FilegroupInUse; op->m_errorCode = DropFilegroupRef::FilegroupInUse;
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
else else
{ {
jam();
send_drop_fg(signal, op, DropFilegroupImplReq::Prepare); send_drop_fg(signal, op, DropFilegroupImplReq::Prepare);
} }
} }
...@@ -16216,7 +16389,7 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op) ...@@ -16216,7 +16389,7 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op)
c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i); c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i);
if (op->m_obj_type == DictTabInfo::LogfileGroup) if (op->m_obj_type == DictTabInfo::LogfileGroup)
{ {
jam();
/** /**
* Mark all undofiles as dropped * Mark all undofiles as dropped
*/ */
...@@ -16225,6 +16398,7 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op) ...@@ -16225,6 +16398,7 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op)
XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0]; XSchemaFile * xsf = &c_schemaFile[c_schemaRecord.schemaPage != 0];
for(list.first(filePtr); !filePtr.isNull(); list.next(filePtr)) for(list.first(filePtr); !filePtr.isNull(); list.next(filePtr))
{ {
jam();
Uint32 objId = filePtr.p->key; Uint32 objId = filePtr.p->key;
SchemaFile::TableEntry * tableEntry = getTableEntry(xsf, objId); SchemaFile::TableEntry * tableEntry = getTableEntry(xsf, objId);
tableEntry->m_tableState = SchemaFile::DROP_TABLE_COMMITTED; tableEntry->m_tableState = SchemaFile::DROP_TABLE_COMMITTED;
...@@ -16237,13 +16411,14 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op) ...@@ -16237,13 +16411,14 @@ Dbdict::drop_fg_commit_start(Signal* signal, SchemaOp* op)
else if(op->m_obj_type == DictTabInfo::Tablespace) else if(op->m_obj_type == DictTabInfo::Tablespace)
{ {
FilegroupPtr lg_ptr; FilegroupPtr lg_ptr;
jam();
ndbrequire(c_filegroup_hash. ndbrequire(c_filegroup_hash.
find(lg_ptr, find(lg_ptr,
fg_ptr.p->m_tablespace.m_default_logfile_group_id)); fg_ptr.p->m_tablespace.m_default_logfile_group_id));
decrease_ref_count(lg_ptr.p->m_obj_ptr_i); decrease_ref_count(lg_ptr.p->m_obj_ptr_i);
} }
jam();
send_drop_fg(signal, op, DropFilegroupImplReq::Commit); send_drop_fg(signal, op, DropFilegroupImplReq::Commit);
} }
...@@ -16253,15 +16428,16 @@ Dbdict::drop_fg_commit_complete(Signal* signal, SchemaOp* op) ...@@ -16253,15 +16428,16 @@ Dbdict::drop_fg_commit_complete(Signal* signal, SchemaOp* op)
FilegroupPtr fg_ptr; FilegroupPtr fg_ptr;
c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i); c_filegroup_pool.getPtr(fg_ptr, op->m_obj_ptr_i);
jam();
release_object(fg_ptr.p->m_obj_ptr_i); release_object(fg_ptr.p->m_obj_ptr_i);
c_filegroup_hash.release(fg_ptr); c_filegroup_hash.release(fg_ptr);
execute(signal, op->m_callback, 0); execute(signal, op->m_callback, 0);
} }
void void
Dbdict::drop_fg_abort_start(Signal* signal, SchemaOp* op) Dbdict::drop_fg_abort_start(Signal* signal, SchemaOp* op)
{ {
jam();
send_drop_fg(signal, op, DropFilegroupImplReq::Abort); send_drop_fg(signal, op, DropFilegroupImplReq::Abort);
} }
......
...@@ -462,7 +462,8 @@ Lgman::drop_filegroup_drop_files(Signal* signal, ...@@ -462,7 +462,8 @@ Lgman::drop_filegroup_drop_files(Signal* signal,
} }
void void
Lgman::execCREATE_FILE_REQ(Signal* signal){ Lgman::execCREATE_FILE_REQ(Signal* signal)
{
jamEntry(); jamEntry();
CreateFileImplReq* req= (CreateFileImplReq*)signal->getDataPtr(); CreateFileImplReq* req= (CreateFileImplReq*)signal->getDataPtr();
...@@ -491,6 +492,7 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){ ...@@ -491,6 +492,7 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){
switch(requestInfo){ switch(requestInfo){
case CreateFileImplReq::Commit: case CreateFileImplReq::Commit:
{ {
jam();
ndbrequire(find_file_by_id(file_ptr, ptr.p->m_meta_files, req->file_id)); ndbrequire(find_file_by_id(file_ptr, ptr.p->m_meta_files, req->file_id));
file_ptr.p->m_create.m_senderRef = req->senderRef; file_ptr.p->m_create.m_senderRef = req->senderRef;
file_ptr.p->m_create.m_senderData = req->senderData; file_ptr.p->m_create.m_senderData = req->senderData;
...@@ -503,6 +505,7 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){ ...@@ -503,6 +505,7 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){
Uint32 senderData = req->senderData; Uint32 senderData = req->senderData;
if (find_file_by_id(file_ptr, ptr.p->m_meta_files, req->file_id)) if (find_file_by_id(file_ptr, ptr.p->m_meta_files, req->file_id))
{ {
jam();
file_ptr.p->m_create.m_senderRef = senderRef; file_ptr.p->m_create.m_senderRef = senderRef;
file_ptr.p->m_create.m_senderData = senderData; file_ptr.p->m_create.m_senderData = senderData;
create_file_abort(signal, ptr, file_ptr); create_file_abort(signal, ptr, file_ptr);
...@@ -510,11 +513,11 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){ ...@@ -510,11 +513,11 @@ Lgman::execCREATE_FILE_REQ(Signal* signal){
else else
{ {
CreateFileImplConf* conf= (CreateFileImplConf*)signal->getDataPtr(); CreateFileImplConf* conf= (CreateFileImplConf*)signal->getDataPtr();
jam();
conf->senderData = senderData; conf->senderData = senderData;
conf->senderRef = reference(); conf->senderRef = reference();
sendSignal(senderRef, GSN_CREATE_FILE_CONF, signal, sendSignal(senderRef, GSN_CREATE_FILE_CONF, signal,
CreateFileImplConf::SignalLength, JBB); CreateFileImplConf::SignalLength, JBB);
return;
} }
return; return;
} }
......
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