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
f4016502
Commit
f4016502
authored
Aug 20, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
parents
050bf6a8
8c938872
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
168 additions
and
96 deletions
+168
-96
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
include/my_time.h
include/my_time.h
+1
-0
mysql-test/ndb/ndb_config_2_node.ini
mysql-test/ndb/ndb_config_2_node.ini
+1
-2
mysql-test/ndb/ndbcluster.sh
mysql-test/ndb/ndbcluster.sh
+27
-32
ndb/src/common/mgmcommon/ConfigInfo.cpp
ndb/src/common/mgmcommon/ConfigInfo.cpp
+78
-50
ndb/src/common/mgmcommon/ConfigRetriever.cpp
ndb/src/common/mgmcommon/ConfigRetriever.cpp
+42
-1
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+2
-2
ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
+1
-1
ndb/src/kernel/blocks/ndbfs/Filename.cpp
ndb/src/kernel/blocks/ndbfs/Filename.cpp
+9
-2
ndb/src/kernel/blocks/ndbfs/Filename.hpp
ndb/src/kernel/blocks/ndbfs/Filename.hpp
+1
-1
ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+1
-1
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+4
-3
sql/mysql_priv.h
sql/mysql_priv.h
+0
-1
No files found.
BitKeeper/etc/logging_ok
View file @
f4016502
...
...
@@ -154,6 +154,7 @@ ram@gw.udmsearch.izhnet.ru
ram@mysql.r18.ru
ram@ram.(none)
ranger@regul.home.lan
rburnett@build.mysql.com
root@home.(none)
root@x3.internalnet
salle@banica.(none)
...
...
include/my_time.h
View file @
f4016502
...
...
@@ -27,6 +27,7 @@
C_MODE_START
extern
ulonglong
log_10_int
[
20
];
extern
uchar
days_in_month
[];
/*
Portable time_t replacement.
...
...
mysql-test/ndb/ndb_config_2_node.ini
View file @
f4016502
...
...
@@ -5,6 +5,7 @@ DataMemory: CHOOSE_DataMemory
IndexMemory:
CHOOSE_IndexMemory
Diskless:
CHOOSE_Diskless
TimeBetweenWatchDogCheck:
30000
FileSystemPath:
CHOOSE_FILESYSTEM
[COMPUTER]
Id:
1
...
...
@@ -16,11 +17,9 @@ HostName: CHOOSE_HOSTNAME_2
[DB]
ExecuteOnComputer:
1
FileSystemPath:
CHOOSE_FILESYSTEM_NODE_1
[DB]
ExecuteOnComputer:
2
FileSystemPath:
CHOOSE_FILESYSTEM_NODE_2
[MGM]
PortNumber:
CHOOSE_PORT_MGM
...
...
mysql-test/ndb/ndbcluster.sh
View file @
f4016502
...
...
@@ -54,7 +54,7 @@ while test $# -gt 0; do
stop_ndb
=
1
;;
--initial
)
flags_ndb
=
$flags_ndb
"
-i"
flags_ndb
=
"
$flags_ndb
-i"
initial_ndb
=
1
;;
--status
)
...
...
@@ -81,20 +81,18 @@ while test $# -gt 0; do
shift
done
fs_ndb
=
$fsdir
/ndbcluster-
$port_base
fs_name_1
=
$fs_ndb
/node-1-fs
fs_name_2
=
$fs_ndb
/node-2-fs
fs_ndb
=
"
$fsdir
/ndbcluster-
$port_base
"
NDB_HOME
=
if
[
!
-x
$fsdir
]
;
then
if
[
!
-x
"
$fsdir
"
]
;
then
echo
"
$fsdir
missing"
exit
1
fi
if
[
!
-x
$exec_ndb
]
;
then
if
[
!
-x
"
$exec_ndb
"
]
;
then
echo
"
$exec_ndb
missing"
exit
1
fi
if
[
!
-x
$exec_mgmtsrvr
]
;
then
if
[
!
-x
"
$exec_mgmtsrvr
"
]
;
then
echo
"
$exec_mgmtsrvr
missing"
exit
1
fi
...
...
@@ -108,12 +106,10 @@ start_default_ndbcluster() {
# do some checks
if
[
$initial_ndb
]
;
then
[
-d
$fs_ndb
]
||
mkdir
$fs_ndb
[
-d
$fs_name_1
]
||
mkdir
$fs_name_1
[
-d
$fs_name_2
]
||
mkdir
$fs_name_2
if
[
"
$initial_ndb
"
]
;
then
[
-d
"
$fs_ndb
"
]
||
mkdir
"
$fs_ndb
"
fi
if
[
-d
"
$fs_ndb
"
-a
-d
"
$fs_name_1
"
-a
-d
"
$fs_name_2
"
]
;
then
:
;
else
if
[
-d
"
$fs_ndb
"
]
;
then
:
;
else
echo
"
$fs_ndb
filesystem directory does not exist"
exit
1
fi
...
...
@@ -128,42 +124,41 @@ port_transporter=`expr $ndb_mgmd_port + 2`
if
[
$initial_ndb
]
;
then
sed
\
-e
s,
"CHOOSE_MaxNoOfConcurrentOperations"
,
$ndb_con_op
,g
\
-e
s,
"CHOOSE_DataMemory"
,
$ndb_dmem
,g
\
-e
s,
"CHOOSE_IndexMemory"
,
$ndb_imem
,g
\
-e
s,
"CHOOSE_Diskless"
,
$ndb_diskless
,g
\
-e
s,
"CHOOSE_MaxNoOfConcurrentOperations"
,
"
$ndb_con_op
"
,g
\
-e
s,
"CHOOSE_DataMemory"
,
"
$ndb_dmem
"
,g
\
-e
s,
"CHOOSE_IndexMemory"
,
"
$ndb_imem
"
,g
\
-e
s,
"CHOOSE_Diskless"
,
"
$ndb_diskless
"
,g
\
-e
s,
"CHOOSE_HOSTNAME_"
.
*
,
"
$ndb_host
"
,g
\
-e
s,
"CHOOSE_FILESYSTEM_NODE_1"
,
"
$fs_name_1
"
,g
\
-e
s,
"CHOOSE_FILESYSTEM_NODE_2"
,
"
$fs_name_2
"
,g
\
-e
s,
"CHOOSE_PORT_MGM"
,
$ndb_mgmd_port
,g
\
-e
s,
"CHOOSE_PORT_TRANSPORTER"
,
$port_transporter
,g
\
-e
s,
"CHOOSE_FILESYSTEM"
,
"
$fs_ndb
"
,g
\
-e
s,
"CHOOSE_PORT_MGM"
,
"
$ndb_mgmd_port
"
,g
\
-e
s,
"CHOOSE_PORT_TRANSPORTER"
,
"
$port_transporter
"
,g
\
< ndb/ndb_config_2_node.ini
\
>
"
$fs_ndb
/config.ini"
fi
rm
-f
$cfgfile
2>&1 |
cat
>
/dev/null
rm
-f
$fs_ndb
/
$cfgfile
2>&1 |
cat
>
/dev/null
rm
-f
"
$cfgfile
"
2>&1 |
cat
>
/dev/null
rm
-f
"
$fs_ndb
/
$cfgfile
"
2>&1 |
cat
>
/dev/null
if
(
cd
$fs_ndb
;
$exec_mgmtsrvr
-d
-c
config.ini
)
;
then
:
;
else
if
(
cd
"
$fs_ndb
"
;
$exec_mgmtsrvr
-d
-c
config.ini
)
;
then
:
;
else
echo
"Unable to start
$exec_mgmtsrvr
from
`
pwd
`
"
exit
1
fi
cat
`
find
$fs_ndb
-name
'ndb_*.pid'
`
>
$fs_ndb
/
$pidfile
cat
`
find
"
$fs_ndb
"
-name
'ndb_*.pid'
`
>
"
$fs_ndb
/
$pidfile
"
# Start database node
echo
"Starting ndbd"
(
cd
$fs_ndb
;
$exec_ndb
-d
$flags_ndb
&
)
(
cd
"
$fs_ndb
"
;
$exec_ndb
-d
$flags_ndb
&
)
cat
`
find
$fs_ndb
-name
'ndb_*.pid'
`
>
$fs_ndb
/
$pidfile
cat
`
find
"
$fs_ndb
"
-name
'ndb_*.pid'
`
>
"
$fs_ndb
/
$pidfile
"
# Start database node
echo
"Starting ndbd"
(
cd
$fs_ndb
;
$exec_ndb
-d
$flags_ndb
&
)
(
cd
"
$fs_ndb
"
;
$exec_ndb
-d
$flags_ndb
&
)
cat
`
find
$fs_ndb
-name
'ndb_*.pid'
`
>
$fs_ndb
/
$pidfile
cat
`
find
"
$fs_ndb
"
-name
'ndb_*.pid'
`
>
"
$fs_ndb
/
$pidfile
"
# test if Ndb Cluster starts properly
...
...
@@ -173,7 +168,7 @@ if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else
exit
1
fi
cat
`
find
$fs_ndb
-name
'ndb_*.pid'
`
>
$fs_ndb
/
$pidfile
cat
`
find
"
$fs_ndb
"
-name
'ndb_*.pid'
`
>
$fs_ndb
/
$pidfile
status_ndbcluster
}
...
...
@@ -200,9 +195,9 @@ exec_mgmtclient="$exec_mgmtclient --try-reconnect=1"
echo
"all stop"
|
$exec_mgmtclient
2>&1 |
cat
>
/dev/null
if
[
-f
$fs_ndb
/
$pidfile
]
;
then
kill
-9
`
cat
$fs_ndb
/
$pidfile
`
2> /dev/null
rm
$fs_ndb
/
$pidfile
if
[
-f
"
$fs_ndb
/
$pidfile
"
]
;
then
kill
-9
`
cat
"
$fs_ndb
/
$pidfile
"
`
2> /dev/null
rm
"
$fs_ndb
/
$pidfile
"
fi
}
...
...
ndb/src/common/mgmcommon/ConfigInfo.cpp
View file @
f4016502
This diff is collapsed.
Click to expand it.
ndb/src/common/mgmcommon/ConfigRetriever.cpp
View file @
f4016502
...
...
@@ -37,6 +37,7 @@
#include <mgmapi.h>
#include <mgmapi_config_parameters.h>
#include <mgmapi_configuration.hpp>
#include <ConfigValues.hpp>
#include <NdbHost.h>
...
...
@@ -267,7 +268,7 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
char
localhost
[
MAXHOSTNAMELEN
];
if
(
NdbHost_GetHostName
(
localhost
)
!=
0
){
snprintf
(
buf
,
255
,
"Unable to own hostname"
);
snprintf
(
buf
,
255
,
"Unable to
get
own hostname"
);
setError
(
CR_ERROR
,
buf
);
return
false
;
}
...
...
@@ -317,6 +318,46 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf){
return
false
;
}
/**
* Check hostnames
*/
ndb_mgm_configuration_iterator
iter
(
*
conf
,
CFG_SECTION_CONNECTION
);
for
(
iter
.
first
();
iter
.
valid
();
iter
.
next
()){
Uint32
type
=
CONNECTION_TYPE_TCP
+
1
;
if
(
iter
.
get
(
CFG_TYPE_OF_SECTION
,
&
type
))
continue
;
if
(
type
!=
CONNECTION_TYPE_TCP
)
continue
;
Uint32
nodeId1
,
nodeId2
,
remoteNodeId
;
if
(
iter
.
get
(
CFG_CONNECTION_NODE_1
,
&
nodeId1
))
continue
;
if
(
iter
.
get
(
CFG_CONNECTION_NODE_2
,
&
nodeId2
))
continue
;
if
(
nodeId1
!=
_ownNodeId
&&
nodeId2
!=
_ownNodeId
)
continue
;
remoteNodeId
=
(
_ownNodeId
==
nodeId1
?
nodeId2
:
nodeId1
);
const
char
*
name
;
struct
in_addr
addr
;
BaseString
tmp
;
if
(
!
iter
.
get
(
CFG_TCP_HOSTNAME_1
,
&
name
)
&&
strlen
(
name
)){
if
(
Ndb_getInAddr
(
&
addr
,
name
)
!=
0
){
tmp
.
assfmt
(
"Unable to lookup/illegal hostname %s, "
"connection from node %d to node %d"
,
name
,
_ownNodeId
,
remoteNodeId
);
setError
(
CR_ERROR
,
tmp
.
c_str
());
return
false
;
}
}
if
(
!
iter
.
get
(
CFG_TCP_HOSTNAME_2
,
&
name
)
&&
strlen
(
name
)){
if
(
Ndb_getInAddr
(
&
addr
,
name
)
!=
0
){
tmp
.
assfmt
(
"Unable to lookup/illegal hostname %s, "
"connection from node %d to node %d"
,
name
,
_ownNodeId
,
remoteNodeId
);
setError
(
CR_ERROR
,
tmp
.
c_str
());
return
false
;
}
}
}
return
true
;
}
...
...
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
View file @
f4016502
...
...
@@ -108,8 +108,8 @@ AsyncFile::AsyncFile() :
}
void
AsyncFile
::
doStart
(
const
char
*
filesystemPath
)
{
theFileName
.
init
(
filesystemPath
);
AsyncFile
::
doStart
(
Uint32
nodeId
,
const
char
*
filesystemPath
)
{
theFileName
.
init
(
nodeId
,
filesystemPath
);
// Stacksize for filesystem threads
// An 8k stack should be enough
...
...
ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
View file @
f4016502
...
...
@@ -181,7 +181,7 @@ public:
void
execute
(
Request
*
request
);
void
doStart
(
const
char
*
fspath
);
void
doStart
(
Uint32
nodeId
,
const
char
*
fspath
);
// its a thread so its always running
void
run
();
...
...
ndb/src/kernel/blocks/ndbfs/Filename.cpp
View file @
f4016502
...
...
@@ -46,7 +46,7 @@ Filename::Filename() :
}
void
Filename
::
init
(
const
char
*
pFileSystemPath
){
Filename
::
init
(
Uint32
nodeid
,
const
char
*
pFileSystemPath
){
if
(
pFileSystemPath
==
NULL
)
{
ERROR_SET
(
fatal
,
AFS_ERROR_NOPATH
,
""
,
" Filename::init()"
);
return
;
...
...
@@ -75,8 +75,15 @@ Filename::init(const char * pFileSystemPath){
DIR_SEPARATOR
)
!=
0
)
strcat
(
theBaseDirectory
,
DIR_SEPARATOR
);
}
snprintf
(
buf2
,
sizeof
(
buf2
),
"ndb_%u_fs%s"
,
nodeid
,
DIR_SEPARATOR
);
strcat
(
theBaseDirectory
,
buf2
);
#ifdef NDB_WIN32
CreateDirectory
(
theBaseDirectory
,
0
);
#else
mkdir
(
theBaseDirectory
,
S_IRUSR
|
S_IWUSR
|
S_IXUSR
|
S_IXGRP
|
S_IRGRP
);
#endif
}
Filename
::~
Filename
(){
}
...
...
ndb/src/kernel/blocks/ndbfs/Filename.hpp
View file @
f4016502
...
...
@@ -68,7 +68,7 @@ public:
int
levels
()
const
;
const
char
*
c_str
()
const
;
void
init
(
const
char
*
fileSystemPath
);
void
init
(
Uint32
nodeid
,
const
char
*
fileSystemPath
);
private:
int
theLevelDepth
;
...
...
ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
View file @
f4016502
...
...
@@ -559,7 +559,7 @@ Ndbfs::createAsyncFile(){
}
AsyncFile
*
file
=
new
AsyncFile
;
file
->
doStart
(
theFileSystemPath
);
file
->
doStart
(
getOwnNodeId
(),
theFileSystemPath
);
// Put the file in list of all files
theFiles
.
push_back
(
file
);
...
...
ndb/src/kernel/main.cpp
View file @
f4016502
...
...
@@ -309,11 +309,12 @@ catchsigs(bool ignore){
SIGPIPE
};
for
(
size_t
i
=
0
;
i
<
sizeof
(
signals_shutdown
)
/
sizeof
(
signals_shutdown
[
0
]);
i
++
)
size_t
i
;
for
(
i
=
0
;
i
<
sizeof
(
signals_shutdown
)
/
sizeof
(
signals_shutdown
[
0
]);
i
++
)
handler_register
(
signals_shutdown
[
i
],
handler_shutdown
,
ignore
);
for
(
size_t
i
=
0
;
i
<
sizeof
(
signals_error
)
/
sizeof
(
signals_error
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
signals_error
)
/
sizeof
(
signals_error
[
0
]);
i
++
)
handler_register
(
signals_error
[
i
],
handler_error
,
ignore
);
for
(
size_t
i
=
0
;
i
<
sizeof
(
signals_ignore
)
/
sizeof
(
signals_ignore
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
signals_ignore
)
/
sizeof
(
signals_ignore
[
0
]);
i
++
)
handler_register
(
signals_ignore
[
i
],
SIG_IGN
,
ignore
);
}
...
...
sql/mysql_priv.h
View file @
f4016502
...
...
@@ -828,7 +828,6 @@ extern Gt_creator gt_creator;
extern
Lt_creator
lt_creator
;
extern
Ge_creator
ge_creator
;
extern
Le_creator
le_creator
;
extern
uchar
days_in_month
[];
extern
char
language
[
LIBLEN
],
reg_ext
[
FN_EXTLEN
];
extern
char
glob_hostname
[
FN_REFLEN
],
mysql_home
[
FN_REFLEN
];
extern
char
pidfile_name
[
FN_REFLEN
],
system_time_zone
[
30
],
*
opt_init_file
;
...
...
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