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
7b2f7b43
Commit
7b2f7b43
authored
Feb 17, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
a2c728b2
33c297cf
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
9 deletions
+48
-9
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+5
-1
ndb/include/mgmapi/mgmapi.h
ndb/include/mgmapi/mgmapi.h
+6
-0
ndb/include/mgmcommon/ConfigRetriever.hpp
ndb/include/mgmcommon/ConfigRetriever.hpp
+2
-0
ndb/src/common/mgmcommon/ConfigRetriever.cpp
ndb/src/common/mgmcommon/ConfigRetriever.cpp
+6
-0
ndb/src/kernel/vm/Configuration.cpp
ndb/src/kernel/vm/Configuration.cpp
+9
-0
ndb/src/mgmapi/mgmapi.cpp
ndb/src/mgmapi/mgmapi.cpp
+9
-0
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+11
-8
No files found.
mysql-test/mysql-test-run.pl
View file @
7b2f7b43
...
...
@@ -360,6 +360,10 @@ sub main () {
if
(
$opt_start_and_exit
)
{
if
(
ndbcluster_start
()
)
{
mtr_error
("
Can't start ndbcluster
");
}
if
(
mysqld_start
('
master
',
0
,
[]
,
[]
)
)
{
mtr_report
("
Servers started, exiting
");
...
...
@@ -1055,7 +1059,7 @@ sub ndbcluster_start () {
"
--data-dir=
$glob_mysql_test_dir
/var
"],
"",
"
/dev/null
",
"",
"")
)
{
mtr_error
("
Error ndbcluster_
install
");
mtr_error
("
Error ndbcluster_
start
");
return
1
;
}
...
...
ndb/include/mgmapi/mgmapi.h
View file @
7b2f7b43
...
...
@@ -531,6 +531,12 @@ extern "C" {
int
ndb_mgm_set_connectstring
(
NdbMgmHandle
handle
,
const
char
*
connect_string
);
int
ndb_mgm_set_configuration_nodeid
(
NdbMgmHandle
handle
,
int
nodeid
);
int
ndb_mgm_get_configuration_nodeid
(
NdbMgmHandle
handle
);
int
ndb_mgm_get_connected_port
(
NdbMgmHandle
handle
);
const
char
*
ndb_mgm_get_connected_host
(
NdbMgmHandle
handle
);
const
char
*
ndb_mgm_get_connectstring
(
NdbMgmHandle
handle
,
char
*
buf
,
int
buf_sz
);
/**
* Gets the connectstring used for a connection
*
...
...
ndb/include/mgmcommon/ConfigRetriever.hpp
View file @
7b2f7b43
...
...
@@ -55,6 +55,8 @@ public:
*/
Uint32
allocNodeId
(
int
no_retries
,
int
retry_delay_in_seconds
);
int
setNodeId
(
Uint32
nodeid
);
/**
* Get config using socket
*/
...
...
ndb/src/common/mgmcommon/ConfigRetriever.cpp
View file @
7b2f7b43
...
...
@@ -316,6 +316,12 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32
return
true
;
}
int
ConfigRetriever
::
setNodeId
(
Uint32
nodeid
)
{
return
ndb_mgm_set_configuration_nodeid
(
m_handle
,
nodeid
);
}
Uint32
ConfigRetriever
::
allocNodeId
(
int
no_retries
,
int
retry_delay_in_seconds
)
{
...
...
ndb/src/kernel/vm/Configuration.cpp
View file @
7b2f7b43
...
...
@@ -141,6 +141,8 @@ Configuration::init(int argc, char** argv)
else
_programName
=
strdup
(
""
);
globalData
.
ownId
=
0
;
return
true
;
}
...
...
@@ -215,6 +217,13 @@ Configuration::fetch_configuration(){
ConfigRetriever
&
cr
=
*
m_config_retriever
;
/**
* if we have a nodeid set (e.g in a restart situation)
* reuse it
*/
if
(
globalData
.
ownId
)
cr
.
setNodeId
(
globalData
.
ownId
);
globalData
.
ownId
=
cr
.
allocNodeId
(
2
/*retry*/
,
3
/*delay*/
);
if
(
globalData
.
ownId
==
0
){
...
...
ndb/src/mgmapi/mgmapi.cpp
View file @
7b2f7b43
...
...
@@ -1727,6 +1727,15 @@ ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *cfg)
}
}
extern
"C"
int
ndb_mgm_set_configuration_nodeid
(
NdbMgmHandle
handle
,
int
nodeid
)
{
CHECK_HANDLE
(
handle
,
-
1
);
handle
->
cfg
.
_ownNodeId
=
nodeid
;
return
0
;
}
extern
"C"
int
ndb_mgm_get_configuration_nodeid
(
NdbMgmHandle
handle
)
...
...
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
7b2f7b43
...
...
@@ -1069,16 +1069,19 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it,
}
ndbout
<<
")"
<<
endl
;
}
else
{
if
(
ndb_mgm_find
(
it
,
CFG_NODE_ID
,
node_id
)
!=
0
){
ndb_mgm_first
(
it
);
if
(
ndb_mgm_find
(
it
,
CFG_NODE_ID
,
node_id
)
==
0
){
const
char
*
config_hostname
=
0
;
ndb_mgm_get_string_parameter
(
it
,
CFG_NODE_HOST
,
&
config_hostname
);
if
(
config_hostname
==
0
||
config_hostname
[
0
]
==
0
)
config_hostname
=
"any host"
;
ndbout_c
(
" (not connected, accepting connect from %s)"
,
config_hostname
);
}
else
{
ndbout_c
(
"Unable to find node with id: %d"
,
node_id
);
return
;
}
const
char
*
config_hostname
=
0
;
ndb_mgm_get_string_parameter
(
it
,
CFG_NODE_HOST
,
&
config_hostname
);
if
(
config_hostname
==
0
||
config_hostname
[
0
]
==
0
)
config_hostname
=
"any host"
;
ndbout
<<
" (not connected, accepting connect from "
<<
config_hostname
<<
")"
<<
endl
;
}
}
}
...
...
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