MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CmRegSignalData.hpp
1 /*
2  Copyright (C) 2003, 2005, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef CM_REG_HPP
20 #define CM_REG_HPP
21 
22 #include <NodeBitmask.hpp>
23 
28 class CmRegReq {
32  friend class Qmgr;
33 
34 public:
35  STATIC_CONST( SignalLength = 6 + NdbNodeBitmask::Size );
36 private:
37 
38  Uint32 blockRef;
39  Uint32 nodeId;
40  Uint32 version; // See ndb_version.h
41  Uint32 mysql_version;
42 
43  Uint32 start_type; // As specified by cmd-line or mgm, NodeState::StartType
44  Uint32 latest_gci; // 0 means no fs
45  Uint32 skip_nodes[NdbNodeBitmask::Size]; // Nodes that does not _need_
46  // to be part of restart
47 };
48 
52 class CmRegConf {
56  friend class Qmgr;
57 
58 public:
59  STATIC_CONST( SignalLength = 5 + NdbNodeBitmask::Size );
60 private:
61 
62  Uint32 presidentBlockRef;
63  Uint32 presidentNodeId;
64  Uint32 presidentVersion;
65  Uint32 presidentMysqlVersion;
66 
70  Uint32 dynamicId;
71  Uint32 allNdbNodes[NdbNodeBitmask::Size];
72 };
73 
77 class CmRegRef {
81  friend class Qmgr;
82 
83 public:
84  STATIC_CONST( SignalLength = 7 + NdbNodeBitmask::Size );
85 
86  enum ErrorCode {
87  ZBUSY = 0, /* Only the president can send this */
88  ZBUSY_PRESIDENT = 1,/* Only the president can send this */
89  ZBUSY_TO_PRES = 2, /* Only the president can send this */
90  ZNOT_IN_CFG = 3, /* Only the president can send this */
91  ZELECTION = 4, /* Receiver is definitely not president,
92  * but we are not sure if sender ends up
93  * as president. */
94  ZNOT_PRESIDENT = 5, /* We are not president */
95  ZNOT_DEAD = 6, /* We are not dead when we are starting */
96  ZINCOMPATIBLE_VERSION = 7,
97  ZINCOMPATIBLE_START_TYPE = 8,
98  ZSINGLE_USER_MODE = 9, /* The cluster is in single user mode,
99  * data node is not allowed to get added
100  * in the cluster while in single user mode */
101  ZGENERIC = 100 /* The generic error code */
102  };
103 private:
104 
105  Uint32 blockRef;
106  Uint32 nodeId;
107  Uint32 errorCode;
111  Uint32 presidentCandidate;
112  Uint32 candidate_latest_gci; // 0 means non
113 
117  Uint32 latest_gci;
118  Uint32 start_type;
119  Uint32 skip_nodes[NdbNodeBitmask::Size]; // Nodes that does not _need_
120  // to be part of restart
121 };
122 
123 class CmAdd {
127  friend class Qmgr;
128 
129 public:
130  STATIC_CONST( SignalLength = 4 );
131 
132 private:
133  enum RequestType {
134  Prepare = 0,
135  AddCommit = 1,
136  CommitNew = 2
137  };
138 
139  Uint32 requestType;
140  Uint32 startingNodeId;
141  Uint32 startingVersion;
142  Uint32 startingMysqlVersion;
143 };
144 
145 class CmAckAdd {
149  friend class Qmgr;
150 
151 public:
152  STATIC_CONST( SignalLength = 3 );
153 
154 private:
155  Uint32 senderNodeId;
156  Uint32 requestType; // see CmAdd::RequestType
157  Uint32 startingNodeId;
158 };
159 
164  friend class Qmgr;
165 
166 public:
167  STATIC_CONST( SignalLength = 5 );
168 
169 private:
173  Uint32 nodeId;
174  Uint32 dynamicId;
175  Uint32 version;
176  Uint32 mysql_version;
177  Uint32 lqh_workers; // added in telco-6.4
178 };
179 
184  friend class Qmgr;
185 
186 public:
187  STATIC_CONST( SignalLength = 3 );
188 
189  enum ErrorCode {
190  NotRunning = 1
191  };
192 
193 private:
194  Uint32 nodeId;
195  Uint32 errorCode;
196 };
197 
202  friend class Qmgr;
203 
204 public:
205  STATIC_CONST( SignalLength = 5 );
206 
207 private:
208  Uint32 nodeId;
209  Uint32 dynamicId;
210  Uint32 version;
211  Uint32 mysql_version;
212  Uint32 lqh_workers; // added in telco-6.4
213 };
214 
215 #endif