|
43 | 43 | #include <signaldata/DihRestart.hpp>
|
44 | 44 | #include <signaldata/DumpStateOrd.hpp>
|
45 | 45 | #include <signaldata/IsolateOrd.hpp>
|
| 46 | +#include <signaldata/ProcessInfoRep.hpp> |
46 | 47 | #include <ndb_version.h>
|
47 | 48 | #include <OwnProcessInfo.hpp>
|
48 | 49 | #include <NodeInfo.hpp>
|
@@ -3653,6 +3654,8 @@ Qmgr::api_failed(Signal* signal, Uint32 nodeId)
|
3653 | 3654 | closeCom->requestType = CloseComReqConf::RT_API_FAILURE;
|
3654 | 3655 | closeCom->failNo = 0;
|
3655 | 3656 | closeCom->noOfNodes = 1;
|
| 3657 | + ProcessInfo * processInfo = getProcessInfo(nodeId); |
| 3658 | + if(processInfo) processInfo->invalidate(); |
3656 | 3659 | NodeBitmask::clear(closeCom->theNodes);
|
3657 | 3660 | NodeBitmask::set(closeCom->theNodes, failedNodePtr.i);
|
3658 | 3661 | sendSignal(TRPMAN_REF, GSN_CLOSE_COMREQ, signal,
|
@@ -7594,13 +7597,105 @@ Qmgr::execDBINFO_SCANREQ(Signal *signal)
|
7594 | 7597 | ndbinfo_send_row(signal, req, row, rl);
|
7595 | 7598 | break;
|
7596 | 7599 | }
|
| 7600 | + case Ndbinfo::PROCESSES_TABLEID: |
| 7601 | + { |
| 7602 | + jam(); |
| 7603 | + for(int i = 1 ; i <= max_api_node_id ; i++) |
| 7604 | + { |
| 7605 | + NodeInfo nodeInfo = getNodeInfo(i); |
| 7606 | + if(nodeInfo.m_connected) |
| 7607 | + { |
| 7608 | + char version_buffer[NDB_VERSION_STRING_BUF_SZ]; |
| 7609 | + ndbGetVersionString(nodeInfo.m_version, nodeInfo.m_mysql_version, |
| 7610 | + 0, version_buffer, NDB_VERSION_STRING_BUF_SZ); |
| 7611 | + |
| 7612 | + ProcessInfo *processInfo = getProcessInfo(i); |
| 7613 | + if(processInfo && processInfo->isValid()) |
| 7614 | + { |
| 7615 | + Ndbinfo::Row row(signal, req); |
| 7616 | + row.write_uint32(getOwnNodeId()); // reporting_node_id |
| 7617 | + row.write_uint32(i); // node_id |
| 7618 | + row.write_uint32(nodeInfo.getType()); // node_type |
| 7619 | + row.write_string(processInfo->getHostAddress()); // host_addr |
| 7620 | + row.write_string(version_buffer); // node_version |
| 7621 | + row.write_uint32(processInfo->getPid()); // process_id |
| 7622 | + row.write_uint32(processInfo->getAngelPid()); // angel_process_id |
| 7623 | + row.write_string(processInfo->getProcessName()); // process_name |
| 7624 | + row.write_string(processInfo->getConnectionName()); // conn_name |
| 7625 | + row.write_uint32(processInfo->getPort()); // application_port |
| 7626 | + ndbinfo_send_row(signal, req, row, rl); |
| 7627 | + } |
| 7628 | + else if(nodeInfo.m_type != NodeInfo::DB) |
| 7629 | + { |
| 7630 | + /* MGM/API node is < version 7.5.5 or has not sent ProcessInfoRep */ |
| 7631 | + |
| 7632 | + struct in_addr addr= globalTransporterRegistry.get_connect_address(i); |
| 7633 | + char address_buffer[16]; |
| 7634 | + Ndb_inet_ntop(AF_INET, & addr, address_buffer, 16); |
| 7635 | + |
| 7636 | + Ndbinfo::Row row(signal, req); |
| 7637 | + row.write_uint32(getOwnNodeId()); // reporting_node_id |
| 7638 | + row.write_uint32(i); // node_id |
| 7639 | + row.write_uint32(nodeInfo.getType()); // node_type |
| 7640 | + row.write_string(address_buffer); // host_addr |
| 7641 | + row.write_string(version_buffer); // node_version |
| 7642 | + row.write_uint32(0); // process_id |
| 7643 | + row.write_uint32(0); // angel_process_id |
| 7644 | + row.write_string(""); // process_name |
| 7645 | + row.write_string(""); // conn_name |
| 7646 | + row.write_uint32(0); // application_port |
| 7647 | + ndbinfo_send_row(signal, req, row, rl); |
| 7648 | + } |
| 7649 | + } |
| 7650 | + } |
| 7651 | + break; |
| 7652 | + } |
7597 | 7653 | default:
|
7598 | 7654 | break;
|
7599 | 7655 | }
|
7600 | 7656 | ndbinfo_send_scan_conf(signal, req, rl);
|
7601 | 7657 | }
|
7602 | 7658 |
|
7603 | 7659 |
|
| 7660 | +void |
| 7661 | +Qmgr::execPROCESSINFO_REP(Signal *signal) |
| 7662 | +{ |
| 7663 | + jamEntry(); |
| 7664 | + ProcessInfoRep * report = (ProcessInfoRep *) signal->theData; |
| 7665 | + SectionHandle handle(this, signal); |
| 7666 | + SegmentedSectionPtr connNamePtr, hostAddrPtr; |
| 7667 | + |
| 7668 | + ProcessInfo * processInfo = getProcessInfo(report->node_id); |
| 7669 | + if(processInfo) |
| 7670 | + { |
| 7671 | + /* Set everything except the connection name and host address */ |
| 7672 | + processInfo->initializeFromProcessInfoRep(report); |
| 7673 | + |
| 7674 | + /* Set the connection name */ |
| 7675 | + handle.getSection(connNamePtr, ProcessInfoRep::ConnNameSectionNum); |
| 7676 | + processInfo->setConnectionName(connNamePtr.p->theData); |
| 7677 | + |
| 7678 | + /* Set the host address */ |
| 7679 | + if(handle.getSection(hostAddrPtr, ProcessInfoRep::HostAddrSectionNum)) |
| 7680 | + { |
| 7681 | + processInfo->setHostAddress(hostAddrPtr.p->theData); |
| 7682 | + } |
| 7683 | + else |
| 7684 | + { |
| 7685 | + /* Use the address from the transporter registry. |
| 7686 | + As implemented below we use setHostAddress() with struct in_addr |
| 7687 | + to set an IPv4 address. An alternate more abstract version |
| 7688 | + of ProcessInfo::setHostAddress() is also available, which |
| 7689 | + takes a struct sockaddr * and length. |
| 7690 | + */ |
| 7691 | + struct in_addr addr= |
| 7692 | + globalTransporterRegistry.get_connect_address(report->node_id); |
| 7693 | + processInfo->setHostAddress(& addr); |
| 7694 | + } |
| 7695 | + } |
| 7696 | + releaseSections(handle); |
| 7697 | +} |
| 7698 | + |
7604 | 7699 | void
|
7605 | 7700 | Qmgr::execISOLATE_ORD(Signal* signal)
|
7606 | 7701 | {
|
|
0 commit comments