Skip to content

Commit e7a0d99

Browse files
committed
wl#9819 Version 2. Patch #5: Qmgr
1 parent 08f9666 commit e7a0d99

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

storage/ndb/include/ndb_version.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2004, 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
@@ -899,7 +899,7 @@ ndbd_multi_tc_instance_takeover(Uint32 x)
899899
* Support for wl#9819 ndbinfo.processes
900900
* FIXME adjust this when actually merging
901901
*/
902-
#define NDBD_PROCESSINFO_VERSION NDB_MAKE_VERSION(7,5,5)
902+
#define NDBD_PROCESSINFO_VERSION NDB_MAKE_VERSION(7,5,7)
903903

904904
#define NDBD_ISOLATE_ORD_72 NDB_MAKE_VERSION(7,2,19)
905905
#define NDBD_ISOLATE_ORD_73 NDB_MAKE_VERSION(7,3,8)

storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp

Lines changed: 17 additions & 16 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
@@ -7612,38 +7612,37 @@ Qmgr::execDBINFO_SCANREQ(Signal *signal)
76127612
ProcessInfo *processInfo = getProcessInfo(i);
76137613
if(processInfo && processInfo->isValid())
76147614
{
7615+
char uri_buffer[512];
7616+
processInfo->getServiceUri(uri_buffer, sizeof(uri_buffer));
76157617
Ndbinfo::Row row(signal, req);
76167618
row.write_uint32(getOwnNodeId()); // reporting_node_id
76177619
row.write_uint32(i); // node_id
76187620
row.write_uint32(nodeInfo.getType()); // node_type
7619-
row.write_string(processInfo->getHostAddress()); // host_addr
76207621
row.write_string(version_buffer); // node_version
76217622
row.write_uint32(processInfo->getPid()); // process_id
76227623
row.write_uint32(processInfo->getAngelPid()); // angel_process_id
76237624
row.write_string(processInfo->getProcessName()); // process_name
7624-
row.write_string(processInfo->getConnectionName()); // conn_name
7625-
row.write_uint32(processInfo->getPort()); // application_port
7625+
row.write_string(uri_buffer); // service_URI
76267626
ndbinfo_send_row(signal, req, row, rl);
76277627
}
76287628
else if(nodeInfo.m_type != NodeInfo::DB)
76297629
{
7630-
/* MGM/API node is < version 7.5.5 or has not sent ProcessInfoRep */
7630+
/* MGM/API node is an older version or has not sent ProcessInfoRep */
76317631

76327632
struct in_addr addr= globalTransporterRegistry.get_connect_address(i);
7633-
char address_buffer[16];
7634-
Ndb_inet_ntop(AF_INET, & addr, address_buffer, 16);
7633+
char service_uri[32];
7634+
strcpy(service_uri, "ndb://");
7635+
Ndb_inet_ntop(AF_INET, & addr, service_uri + 6, 24);
76357636

76367637
Ndbinfo::Row row(signal, req);
76377638
row.write_uint32(getOwnNodeId()); // reporting_node_id
76387639
row.write_uint32(i); // node_id
76397640
row.write_uint32(nodeInfo.getType()); // node_type
7640-
row.write_string(address_buffer); // host_addr
76417641
row.write_string(version_buffer); // node_version
76427642
row.write_uint32(0); // process_id
76437643
row.write_uint32(0); // angel_process_id
76447644
row.write_string(""); // process_name
7645-
row.write_string(""); // conn_name
7646-
row.write_uint32(0); // application_port
7645+
row.write_string(service_uri); // service_URI
76477646
ndbinfo_send_row(signal, req, row, rl);
76487647
}
76497648
}
@@ -7663,22 +7662,24 @@ Qmgr::execPROCESSINFO_REP(Signal *signal)
76637662
jamEntry();
76647663
ProcessInfoRep * report = (ProcessInfoRep *) signal->theData;
76657664
SectionHandle handle(this, signal);
7666-
SegmentedSectionPtr connNamePtr, hostAddrPtr;
7665+
SegmentedSectionPtr pathSectionPtr, hostSectionPtr;
76677666

76687667
ProcessInfo * processInfo = getProcessInfo(report->node_id);
76697668
if(processInfo)
76707669
{
76717670
/* Set everything except the connection name and host address */
76727671
processInfo->initializeFromProcessInfoRep(report);
76737672

7674-
/* Set the connection name */
7675-
handle.getSection(connNamePtr, ProcessInfoRep::ConnNameSectionNum);
7676-
processInfo->setConnectionName(connNamePtr.p->theData);
7673+
/* Set the URI path */
7674+
if(handle.getSection(pathSectionPtr, ProcessInfoRep::PathSectionNum))
7675+
{
7676+
processInfo->setUriPath(pathSectionPtr.p->theData);
7677+
}
76777678

76787679
/* Set the host address */
7679-
if(handle.getSection(hostAddrPtr, ProcessInfoRep::HostAddrSectionNum))
7680+
if(handle.getSection(hostSectionPtr, ProcessInfoRep::HostSectionNum))
76807681
{
7681-
processInfo->setHostAddress(hostAddrPtr.p->theData);
7682+
processInfo->setHostAddress(hostSectionPtr.p->theData);
76827683
}
76837684
else
76847685
{

0 commit comments

Comments
 (0)