Commit e4903c29 authored by unknown's avatar unknown

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb


storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
parents fd2996ad 04c8e7e4
......@@ -35,8 +35,8 @@ if [ -d ../sql ] ; then
exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd
exec_waiter=$ndbtop/tools/ndb_waiter
exec_test=$ndbtop/tools/ndb_test_platform
exec_test_ndberror=
exec_test_ndberror=$ndbtop/src/ndbapi/ndberror_check
exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm
else
BINARY_DIST=1
if test -x "$BASEDIR/libexec/ndbd"
......
......@@ -1008,7 +1008,7 @@ int ha_ndbcluster::get_metadata(const char *path)
DBUG_ASSERT(m_table == NULL);
DBUG_ASSERT(m_table_info == NULL);
const void *data, *pack_data;
const void *data= NULL, *pack_data= NULL;
uint length, pack_length;
/*
......@@ -4732,7 +4732,7 @@ int ha_ndbcluster::create(const char *name,
NDBTAB tab;
NDBCOL col;
uint pack_length, length, i, pk_length= 0;
const void *data, *pack_data;
const void *data= NULL, *pack_data= NULL;
bool create_from_engine= (create_info->table_options & HA_OPTION_CREATE_FROM_ENGINE);
bool is_truncate= (thd->lex->sql_command == SQLCOM_TRUNCATE);
char tablespace[FN_LEN];
......@@ -5065,7 +5065,7 @@ int ha_ndbcluster::create_handler_files(const char *file,
{
Ndb* ndb;
const NDBTAB *tab;
const void *data, *pack_data;
const void *data= NULL, *pack_data= NULL;
uint length, pack_length;
int error= 0;
......@@ -6108,7 +6108,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db,
int error= 0;
NdbError ndb_error;
uint len;
const void* data;
const void* data= NULL;
Ndb* ndb;
char key[FN_REFLEN];
DBUG_ENTER("ndbcluster_discover");
......@@ -6187,6 +6187,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db,
DBUG_RETURN(0);
err:
my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
if (share)
{
/* ndb_share reference temporary free */
......
......@@ -744,9 +744,9 @@ void getTextEventBufferStatus(QQQQ) {
"Event buffer status: used=%d%s(%d%) alloc=%d%s(%d%) "
"max=%d%s apply_gci=%lld latest_gci=%lld",
used, used_unit,
theData[2] ? (theData[1]*100)/theData[2] : 0,
theData[2] ? (Uint32)((((Uint64)theData[1])*100)/theData[2]) : 0,
alloc, alloc_unit,
theData[3] ? (theData[2]*100)/theData[3] : 0,
theData[3] ? (Uint32)((((Uint64)theData[2])*100)/theData[3]) : 0,
max_, max_unit,
theData[4]+(((Uint64)theData[5])<<32),
theData[6]+(((Uint64)theData[7])<<32));
......
......@@ -1645,6 +1645,8 @@ private:
// NR
Uint32 c_dictLockSlavePtrI_nodeRestart; // userPtr for NR
void recvDictLockConf_nodeRestart(Signal* signal, Uint32 data, Uint32 ret);
Uint32 c_error_7181_ref;
};
#if (DIH_CDATA_SIZE < _SYSFILE_SIZE32)
......
......@@ -5101,6 +5101,7 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal)
{
ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ");
CLEAR_ERROR_INSERT_VALUE;
signal->theData[0] = c_error_7181_ref;
signal->theData[1] = coldgcp;
execGCP_TCFINISHED(signal);
}
......@@ -5176,6 +5177,7 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal)
{
ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ");
CLEAR_ERROR_INSERT_VALUE;
signal->theData[0] = c_error_7181_ref;
signal->theData[1] = coldgcp;
execGCP_TCFINISHED(signal);
}
......@@ -8078,6 +8080,7 @@ void Dbdih::execGCP_COMMIT(Signal* signal)
cgckptflag = false;
emptyverificbuffer(signal, true);
cgcpParticipantState = GCP_PARTICIPANT_COMMIT_RECEIVED;
signal->theData[0] = calcDihBlockRef(masterNodeId);
signal->theData[1] = coldgcp;
sendSignal(clocaltcblockref, GSN_GCP_NOMORETRANS, signal, 2, JBB);
return;
......@@ -8087,11 +8090,13 @@ void Dbdih::execGCP_TCFINISHED(Signal* signal)
{
jamEntry();
CRASH_INSERTION(7007);
Uint32 retRef = signal->theData[0];
Uint32 gci = signal->theData[1];
ndbrequire(gci == coldgcp);
if (ERROR_INSERTED(7181) || ERROR_INSERTED(7182))
{
c_error_7181_ref = retRef; // Save ref
ndbout_c("killing %d", refToNode(cmasterdihref));
signal->theData[0] = 9999;
sendSignal(numberToRef(CMVMI, refToNode(cmasterdihref)),
......@@ -8103,7 +8108,7 @@ void Dbdih::execGCP_TCFINISHED(Signal* signal)
signal->theData[0] = cownNodeId;
signal->theData[1] = coldgcp;
signal->theData[2] = cfailurenr;
sendSignal(cmasterdihref, GSN_GCP_NODEFINISH, signal, 3, JBB);
sendSignal(retRef, GSN_GCP_NODEFINISH, signal, 3, JBB);
}//Dbdih::execGCP_TCFINISHED()
/*****************************************************************************/
......
......@@ -1955,5 +1955,8 @@ private:
// those variables should be removed and exchanged for stack
// variable communication.
/**************************************************************************/
Uint32 c_gcp_ref;
};
#endif
......@@ -6886,6 +6886,7 @@ void Dbtc::timeOutFoundFragLab(Signal* signal, UintR TscanConPtr)
void Dbtc::execGCP_NOMORETRANS(Signal* signal)
{
jamEntry();
c_gcp_ref = signal->theData[0];
tcheckGcpId = signal->theData[1];
if (cfirstgcp != RNIL) {
jam();
......@@ -9934,6 +9935,7 @@ void Dbtc::sendScanTabConf(Signal* signal, ScanRecordPtr scanPtr) {
void Dbtc::gcpTcfinished(Signal* signal)
{
signal->theData[0] = c_gcp_ref;
signal->theData[1] = tcheckGcpId;
sendSignal(cdihblockref, GSN_GCP_TCFINISHED, signal, 2, JBB);
}//Dbtc::gcpTcfinished()
......
......@@ -2136,6 +2136,8 @@ MgmtSrvr::alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type)
{
do_send = 1;
nodeId = refToNode(ref->masterRef);
if (!theFacade->get_node_alive(nodeId))
nodeId = 0;
continue;
}
return ref->errorCode;
......@@ -2626,6 +2628,8 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted)
ndbout_c("I'm not master resending to %d", nodeId);
#endif
do_send = 1; // try again
if (!theFacade->get_node_alive(nodeId))
m_master_node = nodeId = 0;
continue;
}
event.Event = BackupEvent::BackupFailedToStart;
......
......@@ -2101,15 +2101,17 @@ NdbEventBuffer::alloc_mem(EventBufData* data,
NdbMem_Free((char*)data->memory);
assert(m_total_alloc >= data->sz);
m_total_alloc -= data->sz;
data->memory = 0;
data->sz = 0;
data->memory = (Uint32*)NdbMem_Allocate(alloc_size);
if (data->memory == 0)
{
m_total_alloc -= data->sz;
DBUG_RETURN(-1);
}
data->sz = alloc_size;
m_total_alloc += data->sz;
m_total_alloc += add_sz;
if (change_sz != NULL)
*change_sz += add_sz;
......@@ -2781,7 +2783,7 @@ NdbEventBuffer::reportStatus()
else
apply_gci= latest_gci;
if (100*m_free_data_sz < m_min_free_thresh*m_total_alloc &&
if (100*(Uint64)m_free_data_sz < m_min_free_thresh*(Uint64)m_total_alloc &&
m_total_alloc > 1024*1024)
{
/* report less free buffer than m_free_thresh,
......@@ -2792,7 +2794,7 @@ NdbEventBuffer::reportStatus()
goto send_report;
}
if (100*m_free_data_sz > m_max_free_thresh*m_total_alloc &&
if (100*(Uint64)m_free_data_sz > m_max_free_thresh*(Uint64)m_total_alloc &&
m_total_alloc > 1024*1024)
{
/* report more free than 2 * m_free_thresh
......
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