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
a1e0046c
Commit
a1e0046c
authored
Aug 23, 2004
by
tomas@poseidon.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.(none):/home/tomas/mysql-4.1
parents
b1847f47
91f10a99
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
462 additions
and
405 deletions
+462
-405
acinclude.m4
acinclude.m4
+5
-0
configure.in
configure.in
+7
-2
mysql-test/ndb/ndb_config_2_node.ini
mysql-test/ndb/ndb_config_2_node.ini
+2
-10
ndb/include/ndb_global.h
ndb/include/ndb_global.h
+0
-1
ndb/src/common/mgmcommon/ConfigInfo.cpp
ndb/src/common/mgmcommon/ConfigInfo.cpp
+399
-370
ndb/src/common/mgmcommon/ConfigInfo.hpp
ndb/src/common/mgmcommon/ConfigInfo.hpp
+5
-5
ndb/src/common/mgmcommon/InitConfigFileParser.cpp
ndb/src/common/mgmcommon/InitConfigFileParser.cpp
+5
-11
ndb/src/common/mgmcommon/InitConfigFileParser.hpp
ndb/src/common/mgmcommon/InitConfigFileParser.hpp
+3
-2
ndb/src/common/mgmcommon/LocalConfig.cpp
ndb/src/common/mgmcommon/LocalConfig.cpp
+1
-1
ndb/src/common/mgmcommon/Makefile.am
ndb/src/common/mgmcommon/Makefile.am
+9
-0
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+24
-2
ndb/src/mgmsrv/main.cpp
ndb/src/mgmsrv/main.cpp
+2
-1
No files found.
acinclude.m4
View file @
a1e0046c
...
@@ -1515,6 +1515,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
...
@@ -1515,6 +1515,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
--with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
--with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
[ndb_docs="$withval"],
[ndb_docs="$withval"],
[ndb_docs=no])
[ndb_docs=no])
AC_ARG_WITH([ndb-port-base],
[
--with-ndb-port-base Base port for NDB Cluster],
[ndb_port_base="$withval"],
[ndb_port_base="default"])
AC_MSG_CHECKING([for NDB Cluster options])
AC_MSG_CHECKING([for NDB Cluster options])
AC_MSG_RESULT([])
AC_MSG_RESULT([])
...
...
configure.in
View file @
a1e0046c
...
@@ -389,8 +389,6 @@ then
...
@@ -389,8 +389,6 @@ then
# Disable exceptions as they seams to create problems with gcc and threads.
# Disable exceptions as they seams to create problems with gcc and threads.
# mysqld doesn't use run-time-type-checking, so we disable it.
# mysqld doesn't use run-time-type-checking, so we disable it.
CXXFLAGS
=
"
$CXXFLAGS
-fno-implicit-templates -fno-exceptions -fno-rtti"
CXXFLAGS
=
"
$CXXFLAGS
-fno-implicit-templates -fno-exceptions -fno-rtti"
# ndb cannot be compiled with -fno-implicit-templaces
ndb_cxxflags_fix
=
"
$ndb_cxxflags_fix
-fimplicit-templates"
# If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
# If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
# we will gets some problems when linking static programs.
# we will gets some problems when linking static programs.
...
@@ -2985,6 +2983,13 @@ then
...
@@ -2985,6 +2983,13 @@ then
AC_SUBST
([
NDB_DEFS]
)
AC_SUBST
([
NDB_DEFS]
)
AC_SUBST
([
ndb_cxxflags_fix]
)
AC_SUBST
([
ndb_cxxflags_fix]
)
if
test
X
"
$ndb_port_base
"
=
Xdefault
then
ndb_port_base
=
"2200"
fi
AC_SUBST
([
ndb_port_base]
)
ndb_transporter_opt_objs
=
""
ndb_transporter_opt_objs
=
""
if
test
X
"
$have_ndb_shm
"
=
Xyes
if
test
X
"
$have_ndb_shm
"
=
Xyes
then
then
...
...
mysql-test/ndb/ndb_config_2_node.ini
View file @
a1e0046c
...
@@ -7,19 +7,11 @@ Diskless: CHOOSE_Diskless
...
@@ -7,19 +7,11 @@ Diskless: CHOOSE_Diskless
TimeBetweenWatchDogCheck:
30000
TimeBetweenWatchDogCheck:
30000
FileSystemPath:
CHOOSE_FILESYSTEM
FileSystemPath:
CHOOSE_FILESYSTEM
[COMPUTER]
Id:
1
HostName:
CHOOSE_HOSTNAME_1
[COMPUTER]
Id:
2
HostName:
CHOOSE_HOSTNAME_2
[DB]
[DB]
ExecuteOnComputer:
1
HostName:
CHOOSE_HOSTNAME_
1
[DB]
[DB]
ExecuteOnComputer:
2
HostName:
CHOOSE_HOSTNAME_
2
[MGM]
[MGM]
PortNumber:
CHOOSE_PORT_MGM
PortNumber:
CHOOSE_PORT_MGM
...
...
ndb/include/ndb_global.h
View file @
a1e0046c
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#define NDBGLOBAL_H
#define NDBGLOBAL_H
#include <my_global.h>
#include <my_global.h>
#define NDB_BASE_PORT 2200
/** signal & SIG_PIPE */
/** signal & SIG_PIPE */
#include <my_alarm.h>
#include <my_alarm.h>
...
...
ndb/src/common/mgmcommon/ConfigInfo.cpp
View file @
a1e0046c
This diff is collapsed.
Click to expand it.
ndb/src/common/mgmcommon/ConfigInfo.hpp
View file @
a1e0046c
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
* A MANDATORY parameters must be specified in the config file
* A MANDATORY parameters must be specified in the config file
* An UNDEFINED parameter may or may not be specified in the config file
* An UNDEFINED parameter may or may not be specified in the config file
*/
*/
static
const
Uint64
MANDATORY
=
~
0
;
// Default value for mandatory params.
static
const
char
*
MANDATORY
=
(
char
*
)
~
(
UintPtr
)
0
;
// Default value for mandatory params.
static
const
Uint64
UNDEFINED
=
(
~
0
)
-
1
;
// Default value for undefined params.
static
const
char
*
UNDEFINED
=
0
;
// Default value for undefined params.
/**
/**
* @class ConfigInfo
* @class ConfigInfo
...
@@ -56,9 +56,9 @@ public:
...
@@ -56,9 +56,9 @@ public:
Status
_status
;
Status
_status
;
bool
_updateable
;
bool
_updateable
;
Type
_type
;
Type
_type
;
Uint64
_default
;
const
char
*
_default
;
Uint64
_min
;
const
char
*
_min
;
Uint64
_max
;
const
char
*
_max
;
};
};
/**
/**
...
...
ndb/src/common/mgmcommon/InitConfigFileParser.cpp
View file @
a1e0046c
...
@@ -31,7 +31,6 @@ static void require(bool v) { if(!v) abort();}
...
@@ -31,7 +31,6 @@ static void require(bool v) { if(!v) abort();}
// Ctor / Dtor
// Ctor / Dtor
//****************************************************************************
//****************************************************************************
InitConfigFileParser
::
InitConfigFileParser
(){
InitConfigFileParser
::
InitConfigFileParser
(){
m_info
=
new
ConfigInfo
();
m_info
=
new
ConfigInfo
();
}
}
...
@@ -111,7 +110,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
...
@@ -111,7 +110,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
"of configuration file."
);
"of configuration file."
);
return
0
;
return
0
;
}
}
snprintf
(
ctx
.
fname
,
sizeof
(
ctx
.
fname
),
section
);
free
(
section
);
snprintf
(
ctx
.
fname
,
sizeof
(
ctx
.
fname
),
section
);
free
(
section
);
ctx
.
type
=
InitConfigFileParser
::
DefaultSection
;
ctx
.
type
=
InitConfigFileParser
::
DefaultSection
;
ctx
.
m_sectionLineno
=
ctx
.
m_lineno
;
ctx
.
m_sectionLineno
=
ctx
.
m_lineno
;
...
@@ -132,7 +130,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
...
@@ -132,7 +130,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
"of configuration file."
);
"of configuration file."
);
return
0
;
return
0
;
}
}
snprintf
(
ctx
.
fname
,
sizeof
(
ctx
.
fname
),
section
);
snprintf
(
ctx
.
fname
,
sizeof
(
ctx
.
fname
),
section
);
free
(
section
);
free
(
section
);
ctx
.
type
=
InitConfigFileParser
::
Section
;
ctx
.
type
=
InitConfigFileParser
::
Section
;
...
@@ -162,7 +159,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
...
@@ -162,7 +159,6 @@ InitConfigFileParser::parseConfig(FILE * file) {
ctx
.
reportError
(
"Could not store section of configuration file."
);
ctx
.
reportError
(
"Could not store section of configuration file."
);
return
0
;
return
0
;
}
}
for
(
size_t
i
=
0
;
ConfigInfo
::
m_ConfigRules
[
i
].
m_configRule
!=
0
;
i
++
){
for
(
size_t
i
=
0
;
ConfigInfo
::
m_ConfigRules
[
i
].
m_configRule
!=
0
;
i
++
){
ctx
.
type
=
InitConfigFileParser
::
Undefined
;
ctx
.
type
=
InitConfigFileParser
::
Undefined
;
ctx
.
m_currentSection
=
0
;
ctx
.
m_currentSection
=
0
;
...
@@ -378,7 +374,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s,
...
@@ -378,7 +374,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s,
errno
=
0
;
errno
=
0
;
char
*
p
;
char
*
p
;
long
long
v
=
strtoll
(
s
,
&
p
,
10
);
long
long
v
=
strtoll
(
s
,
&
p
,
log10base
);
if
(
errno
!=
0
)
if
(
errno
!=
0
)
return
false
;
return
false
;
...
@@ -536,20 +532,18 @@ InitConfigFileParser::storeSection(Context& ctx){
...
@@ -536,20 +532,18 @@ InitConfigFileParser::storeSection(Context& ctx){
if
(
ctx
.
type
==
InitConfigFileParser
::
Section
){
if
(
ctx
.
type
==
InitConfigFileParser
::
Section
){
for
(
int
i
=
0
;
i
<
m_info
->
m_NoOfRules
;
i
++
){
for
(
int
i
=
0
;
i
<
m_info
->
m_NoOfRules
;
i
++
){
const
ConfigInfo
::
SectionRule
&
rule
=
m_info
->
m_SectionRules
[
i
];
const
ConfigInfo
::
SectionRule
&
rule
=
m_info
->
m_SectionRules
[
i
];
if
(
!
strcmp
(
rule
.
m_section
,
"*"
)
||
!
strcmp
(
rule
.
m_section
,
ctx
.
fname
))
if
(
!
strcmp
(
rule
.
m_section
,
"*"
)
||
!
strcmp
(
rule
.
m_section
,
ctx
.
fname
))
{
if
(
!
(
*
rule
.
m_sectionRule
)(
ctx
,
rule
.
m_ruleData
))
if
(
!
(
*
rule
.
m_sectionRule
)(
ctx
,
rule
.
m_ruleData
))
{
return
false
;
return
false
;
}
}
}
}
}
}
if
(
ctx
.
type
==
InitConfigFileParser
::
DefaultSection
)
if
(
ctx
.
type
==
InitConfigFileParser
::
DefaultSection
)
require
(
ctx
.
m_defaults
->
put
(
ctx
.
pname
,
ctx
.
m_currentSection
));
require
(
ctx
.
m_defaults
->
put
(
ctx
.
pname
,
ctx
.
m_currentSection
));
if
(
ctx
.
type
==
InitConfigFileParser
::
Section
)
if
(
ctx
.
type
==
InitConfigFileParser
::
Section
)
require
(
ctx
.
m_config
->
put
(
ctx
.
pname
,
ctx
.
m_currentSection
));
require
(
ctx
.
m_config
->
put
(
ctx
.
pname
,
ctx
.
m_currentSection
));
delete
ctx
.
m_currentSection
;
ctx
.
m_currentSection
=
NULL
;
delete
ctx
.
m_currentSection
;
ctx
.
m_currentSection
=
NULL
;
return
true
;
return
true
;
}
}
...
...
ndb/src/common/mgmcommon/InitConfigFileParser.hpp
View file @
a1e0046c
...
@@ -86,6 +86,9 @@ public:
...
@@ -86,6 +86,9 @@ public:
void
reportWarning
(
const
char
*
msg
,
...);
void
reportWarning
(
const
char
*
msg
,
...);
};
};
static
bool
convertStringToUint64
(
const
char
*
s
,
Uint64
&
val
,
Uint32
log10base
=
0
);
static
bool
convertStringToBool
(
const
char
*
s
,
bool
&
val
);
private:
private:
/**
/**
* Check if line only contains space/comments
* Check if line only contains space/comments
...
@@ -111,8 +114,6 @@ private:
...
@@ -111,8 +114,6 @@ private:
bool
parseNameValuePair
(
Context
&
,
const
char
*
line
);
bool
parseNameValuePair
(
Context
&
,
const
char
*
line
);
bool
storeNameValuePair
(
Context
&
,
const
char
*
fname
,
const
char
*
value
);
bool
storeNameValuePair
(
Context
&
,
const
char
*
fname
,
const
char
*
value
);
bool
convertStringToUint64
(
const
char
*
s
,
Uint64
&
val
,
Uint32
log10base
=
0
);
bool
convertStringToBool
(
const
char
*
s
,
bool
&
val
);
bool
storeSection
(
Context
&
);
bool
storeSection
(
Context
&
);
const
Properties
*
getSection
(
const
char
*
name
,
const
Properties
*
src
);
const
Properties
*
getSection
(
const
char
*
name
,
const
Properties
*
src
);
...
...
ndb/src/common/mgmcommon/LocalConfig.cpp
View file @
a1e0046c
...
@@ -89,7 +89,7 @@ LocalConfig::init(const char *connectString,
...
@@ -89,7 +89,7 @@ LocalConfig::init(const char *connectString,
//7. Check
//7. Check
{
{
char
buf
[
256
];
char
buf
[
256
];
snprintf
(
buf
,
sizeof
(
buf
),
"host=localhost:%
u
"
,
NDB_BASE_PORT
);
snprintf
(
buf
,
sizeof
(
buf
),
"host=localhost:%
s
"
,
NDB_BASE_PORT
);
if
(
readConnectString
(
buf
))
if
(
readConnectString
(
buf
))
return
true
;
return
true
;
}
}
...
...
ndb/src/common/mgmcommon/Makefile.am
View file @
a1e0046c
MYSQLDATAdir
=
$(localstatedir)
MYSQLSHAREdir
=
$(pkgdatadir)
MYSQLBASEdir
=
$(prefix)
noinst_LTLIBRARIES
=
libmgmsrvcommon.la
noinst_LTLIBRARIES
=
libmgmsrvcommon.la
libmgmsrvcommon_la_SOURCES
=
\
libmgmsrvcommon_la_SOURCES
=
\
...
@@ -10,6 +14,11 @@ libmgmsrvcommon_la_SOURCES = \
...
@@ -10,6 +14,11 @@ libmgmsrvcommon_la_SOURCES = \
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/src/mgmapi
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/src/mgmapi
DEFS_LOC
=
-DDEFAULT_MYSQL_HOME
=
"
\"
$(MYSQLBASEdir)
\"
"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DSHAREDIR
=
"
\"
$(MYSQLSHAREdir)
\"
"
\
-DNDB_BASE_PORT
=
"
\"
@ndb_port_base@
\"
"
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/common.mk.am
include
$(top_srcdir)/ndb/config/type_ndbapi.mk.am
include
$(top_srcdir)/ndb/config/type_ndbapi.mk.am
include
$(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
include
$(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
...
...
ndb/src/mgmsrv/Services.cpp
View file @
a1e0046c
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
#include "Services.hpp"
#include "Services.hpp"
extern
bool
g_StopServer
;
static
const
unsigned
int
MAX_READ_TIMEOUT
=
1000
;
static
const
unsigned
int
MAX_READ_TIMEOUT
=
1000
;
static
const
unsigned
int
MAX_WRITE_TIMEOUT
=
100
;
static
const
unsigned
int
MAX_WRITE_TIMEOUT
=
100
;
...
@@ -1012,11 +1014,28 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
...
@@ -1012,11 +1014,28 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
nodes
.
push_back
(
atoi
(
p
));
nodes
.
push_back
(
atoi
(
p
));
}
}
int
stop_self
=
0
;
for
(
size_t
i
=
0
;
i
<
nodes
.
size
();
i
++
)
{
if
(
nodes
[
i
]
==
m_mgmsrv
.
getOwnNodeId
())
{
stop_self
=
1
;
if
(
i
!=
nodes
.
size
()
-
1
)
{
m_output
->
println
(
"stop reply"
);
m_output
->
println
(
"result: server must be stopped last"
);
m_output
->
println
(
""
);
return
;
}
}
}
int
stopped
=
0
,
result
=
0
;
int
stopped
=
0
,
result
=
0
;
for
(
size_t
i
=
0
;
i
<
nodes
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
nodes
.
size
();
i
++
)
if
(
nodes
[
i
]
!=
m_mgmsrv
.
getOwnNodeId
())
{
if
((
result
=
m_mgmsrv
.
stopNode
(
nodes
[
i
],
abort
!=
0
))
==
0
)
if
((
result
=
m_mgmsrv
.
stopNode
(
nodes
[
i
],
abort
!=
0
))
==
0
)
stopped
++
;
stopped
++
;
}
else
stopped
++
;
m_output
->
println
(
"stop reply"
);
m_output
->
println
(
"stop reply"
);
if
(
result
!=
0
)
if
(
result
!=
0
)
...
@@ -1025,6 +1044,9 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
...
@@ -1025,6 +1044,9 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
m_output
->
println
(
"result: Ok"
);
m_output
->
println
(
"result: Ok"
);
m_output
->
println
(
"stopped: %d"
,
stopped
);
m_output
->
println
(
"stopped: %d"
,
stopped
);
m_output
->
println
(
""
);
m_output
->
println
(
""
);
if
(
stop_self
)
g_StopServer
=
true
;
}
}
...
...
ndb/src/mgmsrv/main.cpp
View file @
a1e0046c
...
@@ -265,9 +265,10 @@ NDB_MAIN(mgmsrv){
...
@@ -265,9 +265,10 @@ NDB_MAIN(mgmsrv){
NdbSleep_MilliSleep
(
500
);
NdbSleep_MilliSleep
(
500
);
}
}
g_EventLogger
.
info
(
"Shutting down server..."
);
glob
.
socketServer
->
stopServer
();
glob
.
socketServer
->
stopServer
();
glob
.
socketServer
->
stopSessions
();
glob
.
socketServer
->
stopSessions
();
g_EventLogger
.
info
(
"Shutdown complete"
);
return
0
;
return
0
;
error_end:
error_end:
return
1
;
return
1
;
...
...
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