1 /* Copyright (c) 2003-2007 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
21 #define DEBUG(x) { ndbout << "Qmgr::" << x << endl; }
26 creadyDistCom
= ZFALSE
;
28 // Records with constant sizes
29 nodeRec
= new NodeRec
[MAX_NODES
];
31 cnoCommitFailedNodes
= 0;
33 c_clusterNodes
.clear();
34 c_stopReq
.senderRef
= 0;
37 * Check sanity for NodeVersion
39 ndbrequire((Uint32
)NodeInfo::DB
== 0);
40 ndbrequire((Uint32
)NodeInfo::API
== 1);
41 ndbrequire((Uint32
)NodeInfo::MGM
== 2);
44 nodePtr
.i
= getOwnNodeId();
45 ptrAss(nodePtr
, nodeRec
);
46 nodePtr
.p
->blockRef
= reference();
48 c_connectedNodes
.set(getOwnNodeId());
49 setNodeInfo(getOwnNodeId()).m_version
= NDB_VERSION
;
55 const ndb_mgm_configuration_iterator
* p
=
56 m_ctx
.m_config
.getOwnConfigIterator();
59 Uint32 hbDBAPI
= 1500;
60 ndb_mgm_get_int_parameter(p
, CFG_DB_API_HEARTBEAT_INTERVAL
, &hbDBAPI
);
62 setHbApiDelay(hbDBAPI
);
65 void Qmgr::initRecords()
67 // Records with dynamic sizes
68 }//Qmgr::initRecords()
70 Qmgr::Qmgr(Block_context
& ctx
)
71 : SimulatedBlock(QMGR
, ctx
)
73 BLOCK_CONSTRUCTOR(Qmgr
);
76 addRecSignal(GSN_DUMP_STATE_ORD
, &Qmgr::execDUMP_STATE_ORD
);
77 addRecSignal(GSN_STOP_REQ
, &Qmgr::execSTOP_REQ
);
78 addRecSignal(GSN_DEBUG_SIG
, &Qmgr::execDEBUG_SIG
);
79 addRecSignal(GSN_CONTINUEB
, &Qmgr::execCONTINUEB
);
80 addRecSignal(GSN_CM_HEARTBEAT
, &Qmgr::execCM_HEARTBEAT
);
81 addRecSignal(GSN_CM_ADD
, &Qmgr::execCM_ADD
);
82 addRecSignal(GSN_CM_ACKADD
, &Qmgr::execCM_ACKADD
);
83 addRecSignal(GSN_CM_REGREQ
, &Qmgr::execCM_REGREQ
);
84 addRecSignal(GSN_CM_REGCONF
, &Qmgr::execCM_REGCONF
);
85 addRecSignal(GSN_CM_REGREF
, &Qmgr::execCM_REGREF
);
86 addRecSignal(GSN_CM_NODEINFOREQ
, &Qmgr::execCM_NODEINFOREQ
);
87 addRecSignal(GSN_CM_NODEINFOCONF
, &Qmgr::execCM_NODEINFOCONF
);
88 addRecSignal(GSN_CM_NODEINFOREF
, &Qmgr::execCM_NODEINFOREF
);
89 addRecSignal(GSN_PREP_FAILREQ
, &Qmgr::execPREP_FAILREQ
);
90 addRecSignal(GSN_PREP_FAILCONF
, &Qmgr::execPREP_FAILCONF
);
91 addRecSignal(GSN_PREP_FAILREF
, &Qmgr::execPREP_FAILREF
);
92 addRecSignal(GSN_COMMIT_FAILREQ
, &Qmgr::execCOMMIT_FAILREQ
);
93 addRecSignal(GSN_COMMIT_FAILCONF
, &Qmgr::execCOMMIT_FAILCONF
);
94 addRecSignal(GSN_FAIL_REP
, &Qmgr::execFAIL_REP
);
95 addRecSignal(GSN_PRES_TOREQ
, &Qmgr::execPRES_TOREQ
);
96 addRecSignal(GSN_PRES_TOCONF
, &Qmgr::execPRES_TOCONF
);
99 addRecSignal(GSN_CONNECT_REP
, &Qmgr::execCONNECT_REP
);
100 addRecSignal(GSN_NDB_FAILCONF
, &Qmgr::execNDB_FAILCONF
);
101 addRecSignal(GSN_READ_CONFIG_REQ
, &Qmgr::execREAD_CONFIG_REQ
);
102 addRecSignal(GSN_STTOR
, &Qmgr::execSTTOR
);
103 addRecSignal(GSN_CLOSE_COMCONF
, &Qmgr::execCLOSE_COMCONF
);
104 addRecSignal(GSN_API_REGREQ
, &Qmgr::execAPI_REGREQ
);
105 addRecSignal(GSN_API_VERSION_REQ
, &Qmgr::execAPI_VERSION_REQ
);
106 addRecSignal(GSN_DISCONNECT_REP
, &Qmgr::execDISCONNECT_REP
);
107 addRecSignal(GSN_API_FAILREQ
, &Qmgr::execAPI_FAILREQ
);
108 addRecSignal(GSN_API_FAILCONF
, &Qmgr::execAPI_FAILCONF
);
109 addRecSignal(GSN_READ_NODESREQ
, &Qmgr::execREAD_NODESREQ
);
110 addRecSignal(GSN_API_BROADCAST_REP
, &Qmgr::execAPI_BROADCAST_REP
);
112 addRecSignal(GSN_NODE_FAILREP
, &Qmgr::execNODE_FAILREP
);
113 addRecSignal(GSN_ALLOC_NODEID_REQ
, &Qmgr::execALLOC_NODEID_REQ
);
114 addRecSignal(GSN_ALLOC_NODEID_CONF
, &Qmgr::execALLOC_NODEID_CONF
);
115 addRecSignal(GSN_ALLOC_NODEID_REF
, &Qmgr::execALLOC_NODEID_REF
);
117 // Arbitration signals
118 addRecSignal(GSN_ARBIT_PREPREQ
, &Qmgr::execARBIT_PREPREQ
);
119 addRecSignal(GSN_ARBIT_PREPCONF
, &Qmgr::execARBIT_PREPCONF
);
120 addRecSignal(GSN_ARBIT_PREPREF
, &Qmgr::execARBIT_PREPREF
);
121 addRecSignal(GSN_ARBIT_STARTCONF
, &Qmgr::execARBIT_STARTCONF
);
122 addRecSignal(GSN_ARBIT_STARTREF
, &Qmgr::execARBIT_STARTREF
);
123 addRecSignal(GSN_ARBIT_CHOOSECONF
, &Qmgr::execARBIT_CHOOSECONF
);
124 addRecSignal(GSN_ARBIT_CHOOSEREF
, &Qmgr::execARBIT_CHOOSEREF
);
125 addRecSignal(GSN_ARBIT_STOPREP
, &Qmgr::execARBIT_STOPREP
);
127 addRecSignal(GSN_READ_NODESREF
, &Qmgr::execREAD_NODESREF
);
128 addRecSignal(GSN_READ_NODESCONF
, &Qmgr::execREAD_NODESCONF
);
130 addRecSignal(GSN_DIH_RESTARTREF
, &Qmgr::execDIH_RESTARTREF
);
131 addRecSignal(GSN_DIH_RESTARTCONF
, &Qmgr::execDIH_RESTARTCONF
);
132 addRecSignal(GSN_NODE_VERSION_REP
, &Qmgr::execNODE_VERSION_REP
);
133 addRecSignal(GSN_START_ORD
, &Qmgr::execSTART_ORD
);
144 BLOCK_FUNCTIONS(Qmgr
)