Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
37d8c780
Commit
37d8c780
authored
Aug 09, 2006
by
stewart@willster.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#13985
fixups after review by jonas
parent
c7096021
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
40 deletions
+27
-40
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+1
-0
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+4
-24
ndb/src/mgmsrv/MgmtSrvr.hpp
ndb/src/mgmsrv/MgmtSrvr.hpp
+1
-2
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+1
-3
ndb/src/ndbapi/ClusterMgr.cpp
ndb/src/ndbapi/ClusterMgr.cpp
+19
-10
ndb/src/ndbapi/ClusterMgr.hpp
ndb/src/ndbapi/ClusterMgr.hpp
+1
-1
No files found.
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
37d8c780
...
@@ -705,6 +705,7 @@ CommandInterpreter::execute_impl(const char *_line)
...
@@ -705,6 +705,7 @@ CommandInterpreter::execute_impl(const char *_line)
DBUG_RETURN
(
true
);
DBUG_RETURN
(
true
);
if
(
strcasecmp
(
firstToken
,
"SHOW"
)
==
0
)
{
if
(
strcasecmp
(
firstToken
,
"SHOW"
)
==
0
)
{
Guard
g
(
m_print_mutex
);
executeShow
(
allAfterFirstToken
);
executeShow
(
allAfterFirstToken
);
DBUG_RETURN
(
true
);
DBUG_RETURN
(
true
);
}
}
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
37d8c780
...
@@ -77,7 +77,6 @@
...
@@ -77,7 +77,6 @@
}\
}\
}
}
extern
int
global_flag_send_heartbeat_now
;
extern
int
g_no_nodeid_checks
;
extern
int
g_no_nodeid_checks
;
extern
my_bool
opt_core
;
extern
my_bool
opt_core
;
...
@@ -1456,9 +1455,9 @@ MgmtSrvr::exitSingleUser(int * stopCount, bool abort)
...
@@ -1456,9 +1455,9 @@ MgmtSrvr::exitSingleUser(int * stopCount, bool abort)
#include <ClusterMgr.hpp>
#include <ClusterMgr.hpp>
void
void
MgmtSrvr
::
updateStatus
(
NodeBitmask
nodes
)
MgmtSrvr
::
updateStatus
()
{
{
theFacade
->
theClusterMgr
->
forceHB
(
nodes
);
theFacade
->
theClusterMgr
->
forceHB
();
}
}
int
int
...
@@ -1985,25 +1984,6 @@ MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const
...
@@ -1985,25 +1984,6 @@ MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const
}
}
}
}
void
MgmtSrvr
::
get_connected_ndb_nodes
(
NodeBitmask
&
connected_nodes
)
const
{
NodeBitmask
ndb_nodes
;
if
(
theFacade
&&
theFacade
->
theClusterMgr
)
{
for
(
Uint32
i
=
0
;
i
<
MAX_NODES
;
i
++
)
{
if
(
getNodeType
(
i
)
==
NDB_MGM_NODE_TYPE_NDB
)
{
ndb_nodes
.
set
(
i
);
const
ClusterMgr
::
Node
&
node
=
theFacade
->
theClusterMgr
->
getNodeInfo
(
i
);
connected_nodes
.
bitOR
(
node
.
m_state
.
m_connected_nodes
);
}
}
}
connected_nodes
.
bitAND
(
ndb_nodes
);
}
bool
bool
MgmtSrvr
::
alloc_node_id
(
NodeId
*
nodeId
,
MgmtSrvr
::
alloc_node_id
(
NodeId
*
nodeId
,
enum
ndb_mgm_node_type
type
,
enum
ndb_mgm_node_type
type
,
...
@@ -2178,7 +2158,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
...
@@ -2178,7 +2158,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
if
(
found_matching_type
&&
!
found_free_node
)
{
if
(
found_matching_type
&&
!
found_free_node
)
{
// we have a temporary error which might be due to that
// we have a temporary error which might be due to that
// we have got the latest connect status from db-nodes. Force update.
// we have got the latest connect status from db-nodes. Force update.
global_flag_send_heartbeat_now
=
1
;
updateStatus
()
;
}
}
BaseString
type_string
,
type_c_string
;
BaseString
type_string
,
type_c_string
;
...
@@ -2532,7 +2512,7 @@ MgmtSrvr::Allocated_resources::~Allocated_resources()
...
@@ -2532,7 +2512,7 @@ MgmtSrvr::Allocated_resources::~Allocated_resources()
if
(
!
m_reserved_nodes
.
isclear
())
{
if
(
!
m_reserved_nodes
.
isclear
())
{
m_mgmsrv
.
m_reserved_nodes
.
bitANDC
(
m_reserved_nodes
);
m_mgmsrv
.
m_reserved_nodes
.
bitANDC
(
m_reserved_nodes
);
// node has been reserved, force update signal to ndb nodes
// node has been reserved, force update signal to ndb nodes
global_flag_send_heartbeat_now
=
1
;
m_mgmsrv
.
updateStatus
()
;
char
tmp_str
[
128
];
char
tmp_str
[
128
];
m_mgmsrv
.
m_reserved_nodes
.
getText
(
tmp_str
);
m_mgmsrv
.
m_reserved_nodes
.
getText
(
tmp_str
);
...
...
ndb/src/mgmsrv/MgmtSrvr.hpp
View file @
37d8c780
...
@@ -488,10 +488,9 @@ public:
...
@@ -488,10 +488,9 @@ public:
const
char
*
get_connect_address
(
Uint32
node_id
);
const
char
*
get_connect_address
(
Uint32
node_id
);
void
get_connected_nodes
(
NodeBitmask
&
connected_nodes
)
const
;
void
get_connected_nodes
(
NodeBitmask
&
connected_nodes
)
const
;
void
get_connected_ndb_nodes
(
NodeBitmask
&
connected_nodes
)
const
;
SocketServer
*
get_socket_server
()
{
return
m_socket_server
;
}
SocketServer
*
get_socket_server
()
{
return
m_socket_server
;
}
void
updateStatus
(
NodeBitmask
nodes
);
void
updateStatus
();
//**************************************************************************
//**************************************************************************
private
:
private
:
...
...
ndb/src/mgmsrv/Services.cpp
View file @
37d8c780
...
@@ -982,9 +982,7 @@ printNodeStatus(OutputStream *output,
...
@@ -982,9 +982,7 @@ printNodeStatus(OutputStream *output,
MgmtSrvr
&
mgmsrv
,
MgmtSrvr
&
mgmsrv
,
enum
ndb_mgm_node_type
type
)
{
enum
ndb_mgm_node_type
type
)
{
NodeId
nodeId
=
0
;
NodeId
nodeId
=
0
;
NodeBitmask
hbnodes
;
mgmsrv
.
updateStatus
();
mgmsrv
.
get_connected_ndb_nodes
(
hbnodes
);
mgmsrv
.
updateStatus
(
hbnodes
);
while
(
mgmsrv
.
getNextNodeId
(
&
nodeId
,
type
))
{
while
(
mgmsrv
.
getNextNodeId
(
&
nodeId
,
type
))
{
enum
ndb_mgm_node_status
status
;
enum
ndb_mgm_node_status
status
;
Uint32
startPhase
=
0
,
Uint32
startPhase
=
0
,
...
...
ndb/src/ndbapi/ClusterMgr.cpp
View file @
37d8c780
...
@@ -37,8 +37,6 @@
...
@@ -37,8 +37,6 @@
#include <mgmapi_configuration.hpp>
#include <mgmapi_configuration.hpp>
#include <mgmapi_config_parameters.h>
#include <mgmapi_config_parameters.h>
int
global_flag_send_heartbeat_now
=
0
;
//#define DEBUG_REG
//#define DEBUG_REG
// Just a C wrapper for threadMain
// Just a C wrapper for threadMain
...
@@ -169,7 +167,7 @@ ClusterMgr::doStop( ){
...
@@ -169,7 +167,7 @@ ClusterMgr::doStop( ){
}
}
void
void
ClusterMgr
::
forceHB
(
NodeBitmask
waitFor
)
ClusterMgr
::
forceHB
()
{
{
theFacade
.
lock_mutex
();
theFacade
.
lock_mutex
();
...
@@ -180,10 +178,25 @@ ClusterMgr::forceHB(NodeBitmask waitFor)
...
@@ -180,10 +178,25 @@ ClusterMgr::forceHB(NodeBitmask waitFor)
return
;
return
;
}
}
global_flag_send_heartbeat_now
=
1
;
waitingForHB
=
true
;
waitingForHB
=
true
;
waitForHBFromNodes
=
waitFor
;
NodeBitmask
ndb_nodes
;
ndb_nodes
.
clear
();
waitForHBFromNodes
.
clear
();
for
(
Uint32
i
=
0
;
i
<
MAX_NODES
;
i
++
)
{
if
(
!
theNodes
[
i
].
defined
)
continue
;
if
(
theNodes
[
i
].
m_info
.
m_type
==
NodeInfo
::
DB
)
{
ndb_nodes
.
set
(
i
);
const
ClusterMgr
::
Node
&
node
=
getNodeInfo
(
i
);
waitForHBFromNodes
.
bitOR
(
node
.
m_state
.
m_connected_nodes
);
}
ndbout
<<
endl
;
}
waitForHBFromNodes
.
bitAND
(
ndb_nodes
);
#ifdef DEBUG_REG
#ifdef DEBUG_REG
char
buf
[
128
];
char
buf
[
128
];
ndbout
<<
"Waiting for HB from "
<<
waitForHBFromNodes
.
getText
(
buf
)
<<
endl
;
ndbout
<<
"Waiting for HB from "
<<
waitForHBFromNodes
.
getText
(
buf
)
<<
endl
;
...
@@ -239,9 +252,6 @@ ClusterMgr::threadMain( ){
...
@@ -239,9 +252,6 @@ ClusterMgr::threadMain( ){
/**
/**
* Start of Secure area for use of Transporter
* Start of Secure area for use of Transporter
*/
*/
int
send_heartbeat_now
=
global_flag_send_heartbeat_now
;
global_flag_send_heartbeat_now
=
0
;
theFacade
.
lock_mutex
();
theFacade
.
lock_mutex
();
for
(
int
i
=
1
;
i
<
MAX_NODES
;
i
++
){
for
(
int
i
=
1
;
i
<
MAX_NODES
;
i
++
){
/**
/**
...
@@ -264,8 +274,7 @@ ClusterMgr::threadMain( ){
...
@@ -264,8 +274,7 @@ ClusterMgr::threadMain( ){
}
}
theNode
.
hbCounter
+=
timeSlept
;
theNode
.
hbCounter
+=
timeSlept
;
if
(
theNode
.
hbCounter
>=
theNode
.
hbFrequency
||
if
(
theNode
.
hbCounter
>=
theNode
.
hbFrequency
)
{
send_heartbeat_now
)
{
/**
/**
* It is now time to send a new Heartbeat
* It is now time to send a new Heartbeat
*/
*/
...
...
ndb/src/ndbapi/ClusterMgr.hpp
View file @
37d8c780
...
@@ -50,7 +50,7 @@ public:
...
@@ -50,7 +50,7 @@ public:
void
doStop
();
void
doStop
();
void
startThread
();
void
startThread
();
void
forceHB
(
NodeBitmask
waitFor
);
void
forceHB
();
private:
private:
void
threadMain
();
void
threadMain
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment