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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4a6e9d80
Commit
4a6e9d80
authored
Aug 04, 2004
by
ndbdev@eel.hemma.oreland.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wl1292 - workaround for mgmsrv node id problems
parent
90a0345a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
55 deletions
+51
-55
ndb/src/cw/cpcd/Makefile.am
ndb/src/cw/cpcd/Makefile.am
+1
-1
ndb/src/cw/cpcd/Process.cpp
ndb/src/cw/cpcd/Process.cpp
+37
-41
ndb/test/run-test/main.cpp
ndb/test/run-test/main.cpp
+13
-13
No files found.
ndb/src/cw/cpcd/Makefile.am
View file @
4a6e9d80
ndb
tools
_PROGRAMS
=
ndb_cpcd
ndb
bin
_PROGRAMS
=
ndb_cpcd
ndb_cpcd_SOURCES
=
main.cpp CPCD.cpp Process.cpp APIService.cpp Monitor.cpp common.cpp
...
...
ndb/src/cw/cpcd/Process.cpp
View file @
4a6e9d80
...
...
@@ -209,49 +209,45 @@ int
set_ulimit
(
const
BaseString
&
pair
){
#ifdef HAVE_GETRLIMIT
errno
=
0
;
do
{
Vector
<
BaseString
>
list
;
pair
.
split
(
list
,
":"
);
if
(
list
.
size
()
!=
2
){
break
;
}
int
res
;
rlim_t
value
=
RLIM_INFINITY
;
if
(
!
(
list
[
1
].
trim
()
==
"unlimited"
)){
value
=
atoi
(
list
[
1
].
c_str
());
}
struct
rlimit
rlp
;
Vector
<
BaseString
>
list
;
pair
.
split
(
list
,
":"
);
if
(
list
.
size
()
!=
2
){
logger
.
error
(
"Unable to process ulimit: split >%s< list.size()=%d"
,
pair
.
c_str
(),
list
.
size
());
return
-
1
;
}
int
res
;
rlim_t
value
=
RLIM_INFINITY
;
if
(
!
(
list
[
1
].
trim
()
==
"unlimited"
)){
value
=
atoi
(
list
[
1
].
c_str
());
}
struct
rlimit
rlp
;
#define _RLIMIT_FIX(x) { res = getrlimit(x,&rlp); if(!res){ rlp.rlim_cur = value; res = setrlimit(x, &rlp); }}
if
(
list
[
0
].
trim
()
==
"c"
){
_RLIMIT_FIX
(
RLIMIT_CORE
);
}
else
if
(
list
[
0
]
==
"d"
){
_RLIMIT_FIX
(
RLIMIT_DATA
);
}
else
if
(
list
[
0
]
==
"f"
){
_RLIMIT_FIX
(
RLIMIT_FSIZE
);
}
else
if
(
list
[
0
]
==
"n"
){
_RLIMIT_FIX
(
RLIMIT_NOFILE
);
}
else
if
(
list
[
0
]
==
"s"
){
_RLIMIT_FIX
(
RLIMIT_STACK
);
}
else
if
(
list
[
0
]
==
"t"
){
_RLIMIT_FIX
(
RLIMIT_CPU
);
}
else
{
errno
=
EINVAL
;
break
;
}
if
(
!
res
)
break
;
return
0
;
}
while
(
false
);
logger
.
error
(
"Unable to process ulimit: %s(%s)"
,
pair
.
c_str
(),
strerror
(
errno
));
return
-
1
;
#else
return
0
;
// Maybe it's ok anyway...
if
(
list
[
0
].
trim
()
==
"c"
){
_RLIMIT_FIX
(
RLIMIT_CORE
);
}
else
if
(
list
[
0
]
==
"d"
){
_RLIMIT_FIX
(
RLIMIT_DATA
);
}
else
if
(
list
[
0
]
==
"f"
){
_RLIMIT_FIX
(
RLIMIT_FSIZE
);
}
else
if
(
list
[
0
]
==
"n"
){
_RLIMIT_FIX
(
RLIMIT_NOFILE
);
}
else
if
(
list
[
0
]
==
"s"
){
_RLIMIT_FIX
(
RLIMIT_STACK
);
}
else
if
(
list
[
0
]
==
"t"
){
_RLIMIT_FIX
(
RLIMIT_CPU
);
}
else
{
errno
=
EINVAL
;
}
if
(
res
){
logger
.
error
(
"Unable to process ulimit: %s res=%d error=%d(%s)"
,
pair
.
c_str
(),
res
,
errno
,
strerror
(
errno
));
return
-
1
;
}
#endif
return
0
;
}
void
...
...
ndb/test/run-test/main.cpp
View file @
4a6e9d80
...
...
@@ -106,13 +106,6 @@ main(int argc, const char ** argv){
if
(
!
setup_hosts
(
g_config
))
goto
end
;
if
(
!
start_processes
(
g_config
,
atrt_process
::
NDB_MGM
))
goto
end
;
if
(
!
connect_ndb_mgm
(
g_config
)){
goto
end
;
}
/**
* Main loop
*/
...
...
@@ -122,25 +115,32 @@ main(int argc, const char ** argv){
*/
if
(
restart
){
g_logger
.
info
(
"(Re)starting ndb processes"
);
if
(
!
stop_processes
(
g_config
,
atrt_process
::
NDB_MGM
))
goto
end
;
if
(
!
stop_processes
(
g_config
,
atrt_process
::
NDB_DB
))
goto
end
;
if
(
!
wait_ndb
(
g_config
,
NDB_MGM_NODE_STATUS_NO_CONTACT
))
if
(
!
start_processes
(
g_config
,
atrt_process
::
NDB_MGM
))
goto
end
;
if
(
!
connect_ndb_mgm
(
g_config
)){
goto
end
;
}
if
(
!
start_processes
(
g_config
,
atrt_process
::
NDB_DB
))
goto
end
;
if
(
!
wait_ndb
(
g_config
,
NDB_MGM_NODE_STATUS_NOT_STARTED
))
goto
end
;
for
(
Uint32
i
=
0
;
i
<
3
;
i
++
)
if
(
wait_ndb
(
g_config
,
NDB_MGM_NODE_STATUS_STARTED
))
goto
started
;
goto
end
;
started:
started:
g_logger
.
info
(
"Ndb start completed"
);
}
...
...
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