Skip to content

Commit 08f9666

Browse files
committed
wl#9819 Version 2. Patch #4: ClusterMgr
1 parent 9843dd2 commit 08f9666

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

storage/ndb/src/ndbapi/ClusterMgr.cpp

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -669,27 +669,33 @@ void
669669
ClusterMgr::sendProcessInfoReport(NodeId nodeId)
670670
{
671671
LinearSectionPtr ptr[3];
672-
LinearSectionPtr & nameSection = ptr[ProcessInfoRep::ConnNameSectionNum];
673-
LinearSectionPtr & addrSection = ptr[ProcessInfoRep::HostAddrSectionNum];
672+
LinearSectionPtr & pathSection = ptr[ProcessInfoRep::PathSectionNum];
673+
LinearSectionPtr & hostSection = ptr[ProcessInfoRep::HostSectionNum];
674674
BlockReference ownRef = numberToRef(API_CLUSTERMGR, theFacade.ownId());
675675
NdbApiSignal signal(ownRef);
676-
int nsections = 1;
676+
int nsections = 0;
677677
signal.theVerId_signalNumber = GSN_PROCESSINFO_REP;
678678
signal.theReceiversBlockNumber = QMGR;
679679
signal.theTrace = 0;
680680
signal.theLength = ProcessInfoRep::SignalLength;
681681

682682
ProcessInfoRep * report = CAST_PTR(ProcessInfoRep, signal.getDataPtrSend());
683683
m_process_info->buildProcessInfoReport(report);
684-
nameSection.p = (Uint32 *) m_process_info->getConnectionName();
685-
nameSection.sz = ProcessInfo::ConnectionNameLengthInWords;
684+
685+
const char * uri_path = m_process_info->getUriPath();
686+
pathSection.p = (Uint32 *) uri_path;
687+
pathSection.sz = ProcessInfo::UriPathLengthInWords;
688+
if(uri_path[0])
689+
{
690+
nsections = 1;
691+
}
692+
686693
const char * hostAddress = m_process_info->getHostAddress();
687694
if(hostAddress[0])
688695
{
689-
// report->flags = ProcessInfoRep::HostAddressFlag;
690696
nsections = 2;
691-
addrSection.p = (Uint32 *) hostAddress;
692-
addrSection.sz = ProcessInfo::AddressStringLengthInWords;
697+
hostSection.p = (Uint32 *) hostAddress;
698+
hostSection.sz = ProcessInfo::AddressStringLengthInWords;
693699
}
694700
raw_sendSignal(&signal, nodeId, ptr, nsections);
695701
}
@@ -1295,12 +1301,22 @@ ClusterMgr::print_nodes(const char* where, NdbOut& out)
12951301
}
12961302

12971303
void
1298-
ClusterMgr::setProcessInfo(const char * connection_name,
1299-
const char * address_string, int port)
1304+
ClusterMgr::setProcessInfoUri(const char * scheme, const char * address_string,
1305+
int port, const char * path)
13001306
{
1301-
m_process_info->setConnectionName(connection_name);
1307+
Guard g(clusterMgrThreadMutex);
1308+
1309+
m_process_info->setUriScheme(scheme);
13021310
m_process_info->setHostAddress(address_string);
13031311
m_process_info->setPort(port);
1312+
m_process_info->setUriPath(path);
1313+
1314+
/* Set flag to resend ProcessInfo Report */
1315+
for(int i = 1; i < MAX_NODES ; i++)
1316+
{
1317+
Node & node = theNodes[i];
1318+
if(node.is_connected()) node.processInfoSent = false;
1319+
}
13041320
}
13051321

13061322
/******************************************************************************

storage/ndb/src/ndbapi/ClusterMgr.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -57,10 +57,8 @@ class ClusterMgr : public trp_client
5757

5858
void reportConnected(NodeId nodeId);
5959
void reportDisconnected(NodeId nodeId);
60-
void setProcessInfo(const char * connection_name,
61-
const char * application_address,
62-
int application_port);
63-
void sendProcessInfoReport(NodeId nodeId);
60+
void setProcessInfoUri(const char * scheme, const char * host,
61+
int port, const char * path);
6462
void doStop();
6563
void startThread();
6664

@@ -219,6 +217,7 @@ class ClusterMgr : public trp_client
219217

220218
void print_nodes(const char* where, NdbOut& out = ndbout);
221219
void recalcMinDbVersion();
220+
void sendProcessInfoReport(NodeId nodeId);
222221

223222
public:
224223
/**

0 commit comments

Comments
 (0)