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
f2895078
Commit
f2895078
authored
Dec 02, 2009
by
Dave Wells
Committed by
Yoni Fogel
Apr 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leak
git-svn-id:
file:///svn/toku/tokudb@16258
c7de825b-a66e-492c-adef-691d508d4ae1
parent
9f9280f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
21 deletions
+10
-21
src/tests/recovery_fileops_stress.c
src/tests/recovery_fileops_stress.c
+10
-21
No files found.
src/tests/recovery_fileops_stress.c
View file @
f2895078
...
...
@@ -79,6 +79,9 @@ static void set_crash_timer(void) {
static
void
update_crash_timer
(
void
)
{
if
(
--
crash_timer
==
0
)
{
// close the states table before we crash
int
r
=
states
->
close
(
states
,
0
);
CKERR
(
r
);
if
(
verbose
)
{
printf
(
"%s : crash
\n
"
,
__FILE__
);
fflush
(
stdout
);
...
...
@@ -236,7 +239,7 @@ static void do_random_fileops(void)
}
}
static
void
run_test
(
int
iter
,
int
crash
){
static
void
run_test
(
int
iter
){
u_int32_t
recovery_flags
=
DB_INIT_LOG
|
DB_INIT_TXN
;
int
r
,
i
;
...
...
@@ -367,46 +370,34 @@ static void run_test(int iter, int crash){
db_env_set_checkpoint_callback
(
NULL
,
NULL
);
db_env_set_checkpoint_callback2
(
NULL
,
NULL
);
// after checkpoint
if
(
verbose
)
printf
(
"%s : after checkpoint #2
\n
"
,
__FILE__
);
do_random_fileops
();
// close the states table before we crash
r
=
states
->
close
(
states
,
0
);
CKERR
(
r
);
crash
=
crash
;
if
(
iter
>
10
)
{
if
(
verbose
)
printf
(
"%s : crash
\n
"
,
__FILE__
);
crash_it
();
}
if
(
verbose
)
printf
(
"%s : done
\n
"
,
__FILE__
);
r
=
env
->
txn_checkpoint
(
env
,
0
,
0
,
0
);
CKERR
(
r
);
for
(
i
=
0
;
i
<
NUM_DICTIONARIES
;
i
++
)
{
db
=
db_array
[
i
];
state
=
get_state
(
i
);
if
(
state
==
CREATED
||
state
==
OPEN
)
{
r
=
db
->
close
(
db
,
0
);
CKERR
(
r
);
r
=
db
->
close
(
db
,
0
);
CKERR
(
r
);
db
=
NULL
;
}
}
r
=
env
->
close
(
env
,
0
);
// assert((r == 0) || (r == EINVAL)); // OK to have open transactions prior to close
CKERR
(
r
);
r
=
states
->
close
(
states
,
0
);
CKERR
(
r
);
r
=
env
->
close
(
env
,
0
);
CKERR
(
r
);
if
(
verbose
)
printf
(
"%s : done
\n
"
,
__FILE__
);
}
// ------------ infrastructure ----------
static
void
do_args
(
int
argc
,
char
*
argv
[]);
static
int
iter_arg
=
0
;
static
int
do_crash
=
0
;
int
test_main
(
int
argc
,
char
**
argv
)
{
do_args
(
argc
,
argv
);
run_test
(
iter_arg
,
do_crash
);
run_test
(
iter_arg
);
return
0
;
}
...
...
@@ -423,13 +414,11 @@ static void do_args(int argc, char *argv[]) {
}
else
if
(
strcmp
(
argv
[
0
],
"-h"
)
==
0
)
{
resultcode
=
0
;
do_usage:
fprintf
(
stderr
,
"Usage:
\n
%s [-v|-q]* [-h] [-i]
[-C]
\n
"
,
cmd
);
fprintf
(
stderr
,
"Usage:
\n
%s [-v|-q]* [-h] [-i]
\n
"
,
cmd
);
exit
(
resultcode
);
}
else
if
(
strcmp
(
argv
[
0
],
"-i"
)
==
0
)
{
argc
--
;
argv
++
;
iter_arg
=
atoi
(
argv
[
0
]);
}
else
if
(
strcmp
(
argv
[
0
],
"-C"
)
==
0
)
{
do_crash
=
1
;
}
else
{
fprintf
(
stderr
,
"Unknown arg: %s
\n
"
,
argv
[
0
]);
resultcode
=
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