Commit 7e89c72a authored by unknown's avatar unknown

Jammed Qmgr a bit more

Fixed Bug #4935, initialise before connecting again
Some lines removed
parent 66525627
......@@ -2585,7 +2585,6 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
Uint32 id1= 0, id2= 0;
require(ctx.m_currentSection->get("NodeId1", &id1));
require(ctx.m_currentSection->get("NodeId2", &id2));
id1 = id1 < id2 ? id1 : id2;
const Properties * node;
......@@ -2618,7 +2617,6 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
}
ctx.m_userProperties.put("ServerPortBase", base);
}
port= base + adder;
ctx.m_userProperties.put("ServerPort_", id1, port);
}
......
......@@ -445,7 +445,6 @@ IPCConfig::configureTransporters(Uint32 nodeId,
if(iter.get(CFG_TCP_RECEIVE_BUFFER_SIZE, &conf.maxReceiveSize)) break;
conf.port= tmp_server_port;
const char * proxy;
if (!iter.get(CFG_TCP_PROXY, &proxy)) {
if (strlen(proxy) > 0 && nodeId2 == nodeId) {
......
......@@ -93,7 +93,6 @@ bool
Transporter::connect_client() {
if(m_connected)
return true;
NDB_SOCKET_TYPE sockfd = m_socket_client->connect();
if (sockfd < 0)
......@@ -102,7 +101,6 @@ Transporter::connect_client() {
// send info about own id
SocketOutputStream s_output(sockfd);
s_output.println("%d", localNodeId);
// get remote id
int nodeId;
SocketInputStream s_input(sockfd);
......@@ -115,7 +113,6 @@ Transporter::connect_client() {
NDB_CLOSE_SOCKET(sockfd);
return false;
}
bool res = connect_client_impl(sockfd);
if(res){
m_connected = true;
......
......@@ -200,8 +200,7 @@ TransporterRegistry::createTransporter(TCP_TransporterConfiguration *config) {
if(theTransporters[config->remoteNodeId] != NULL)
return false;
TCP_Transporter * t = new TCP_Transporter(*this,
config->sendBufferSize,
config->maxReceiveSize,
......
......@@ -70,19 +70,21 @@ SocketClient::connect()
return -1;
}
}
const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr));
if (r == -1)
if (r == -1) {
NDB_CLOSE_SOCKET(m_sockfd);
m_sockfd= -1;
return -1;
}
if (m_auth)
if (m_auth) {
if (!m_auth->client_authenticate(m_sockfd))
{
NDB_CLOSE_SOCKET(m_sockfd);
m_sockfd= -1;
return -1;
}
}
NDB_SOCKET_TYPE sockfd= m_sockfd;
m_sockfd= -1;
......
......@@ -146,7 +146,6 @@ SocketServer::doAccept(){
ServiceInstance & si = m_services[i];
if(FD_ISSET(si.m_socket, &readSet)){
NDB_SOCKET_TYPE childSock = accept(si.m_socket, 0, 0);
if(childSock == NDB_INVALID_SOCKET){
continue;
......
......@@ -480,7 +480,6 @@ void Cmvmi::execDISCONNECT_REP(Signal *signal)
void Cmvmi::execCONNECT_REP(Signal *signal){
const Uint32 hostId = signal->theData[0];
jamEntry();
const NodeInfo::NodeType type = (NodeInfo::NodeType)getNodeInfo(hostId).m_type;
......
......@@ -554,11 +554,13 @@ Ndbcntr::execCNTR_START_REP(Signal* signal){
}
if(cmasterNodeId != getOwnNodeId()){
jam();
c_start.reset();
return;
}
if(c_start.m_waiting.isclear()){
jam();
c_start.reset();
return;
}
......@@ -597,6 +599,7 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){
ndbrequire(false);
case NodeState::SL_STARTING:
case NodeState::SL_STARTED:
jam();
break;
case NodeState::SL_STOPPING_1:
......@@ -616,9 +619,11 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){
c_start.m_waiting.set(nodeId);
switch(st){
case NodeState::ST_INITIAL_START:
jam();
c_start.m_withoutLog.set(nodeId);
break;
case NodeState::ST_SYSTEM_RESTART:
jam();
c_start.m_withLog.set(nodeId);
if(starting && lastGci > c_start.m_lastGci){
jam();
......@@ -631,6 +636,7 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){
return;
}
if(starting){
jam();
Uint32 i = c_start.m_logNodesCount++;
c_start.m_logNodes[i].m_nodeId = nodeId;
c_start.m_logNodes[i].m_lastGci = req->lastGci;
......@@ -652,11 +658,12 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){
}
if(starting){
jam();
trySystemRestart(signal);
} else {
jam();
startWaitingNodes(signal);
}
return;
}
......@@ -670,6 +677,7 @@ Ndbcntr::startWaitingNodes(Signal * signal){
NodeState::StartType nrType = NodeState::ST_NODE_RESTART;
if(c_start.m_withoutLog.get(nodeId)){
jam();
nrType = NodeState::ST_INITIAL_NODE_RESTART;
}
......@@ -706,6 +714,7 @@ Ndbcntr::startWaitingNodes(Signal * signal){
char buf[100];
if(!c_start.m_withLog.isclear()){
jam();
ndbout_c("Starting nodes w/ log: %s", c_start.m_withLog.getText(buf));
NodeReceiverGroup rg(NDBCNTR, c_start.m_withLog);
......@@ -716,6 +725,7 @@ Ndbcntr::startWaitingNodes(Signal * signal){
}
if(!c_start.m_withoutLog.isclear()){
jam();
ndbout_c("Starting nodes wo/ log: %s", c_start.m_withoutLog.getText(buf));
NodeReceiverGroup rg(NDBCNTR, c_start.m_withoutLog);
conf->startType = NodeState::ST_INITIAL_NODE_RESTART;
......@@ -777,6 +787,7 @@ Ndbcntr::trySystemRestart(Signal* signal){
jam();
return false;
}
jam();
srType = NodeState::ST_INITIAL_START;
c_start.m_starting = c_start.m_withoutLog; // Used for starting...
c_start.m_withoutLog.clear();
......@@ -793,13 +804,11 @@ Ndbcntr::trySystemRestart(Signal* signal){
// If we lose with all nodes, then we're in trouble
ndbrequire(!allNodes);
return false;
break;
case CheckNodeGroups::Partitioning:
jam();
bool allowPartition = (c_start.m_startPartitionedTimeout != (Uint64)~0);
if(allNodes){
jam();
if(allowPartition){
jam();
break;
......@@ -1043,8 +1052,10 @@ void Ndbcntr::ph5ALab(Signal* signal)
return;
case NodeState::ST_NODE_RESTART:
case NodeState::ST_INITIAL_NODE_RESTART:
jam();
break;
case NodeState::ST_ILLEGAL_TYPE:
jam();
break;
}
ndbrequire(false);
......
......@@ -258,7 +258,6 @@ void Qmgr::execCONNECT_REP(Signal* signal)
{
const Uint32 nodeId = signal->theData[0];
c_connectedNodes.set(nodeId);
NodeRecPtr nodePtr;
nodePtr.i = getOwnNodeId();
ptrCheckGuard(nodePtr, MAX_NODES, nodeRec);
......@@ -679,7 +678,6 @@ void Qmgr::execCM_REGREF(Signal* signal)
UintR TaddNodeno = signal->theData[1];
UintR TrefuseReason = signal->theData[2];
Uint32 candidate = signal->theData[3];
DEBUG_START3(signal, TrefuseReason);
if(candidate != cpresidentCandidate){
......@@ -768,7 +766,6 @@ void Qmgr::execCM_REGREF(Signal* signal)
Uint64 now = NdbTick_CurrentMillisecond();
if((c_regReqReqRecv == cnoOfNodes) || now > c_stopElectionTime){
jam();
electionWon();
sendSttorryLab(signal);
......
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