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
d467d3cf
Commit
d467d3cf
authored
Feb 14, 2014
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backup stress test runs
parent
fbd96859
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
BACKUP_STRESS_NOTES
BACKUP_STRESS_NOTES
+13
-0
src/tests/threaded_stress_test_helpers.h
src/tests/threaded_stress_test_helpers.h
+56
-0
No files found.
BACKUP_STRESS_NOTES
0 → 100644
View file @
d467d3cf
git clone https://github.com/Tokutek/ft-index.git
cd /home/bradley/tokusandbox/ft-index
mkdir third-party
(cd third-party ; git clone https://github.com/Tokutek/jemalloc.git)
(cd third-party; git clone https://github.com/Tokutek/backup-enterprise.git)
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Debug -D USE_BDB=OFF -D CMAKE_INSTALL_PREFIX=/home/bradley/tokusandbox/ft-index/install ..
make -j4 install
cd src/tests
mkdir backup
TOKU_HUGE_PAGES_OK=1 ./test_stress1.tdb --num_seconds 10 --backup_after_num_seconds 1 -v --envdir mytest
src/tests/threaded_stress_test_helpers.h
View file @
d467d3cf
...
...
@@ -105,6 +105,11 @@ PATENT RIGHTS GRANT:
#ifndef _THREADED_STRESS_TEST_HELPERS_H_
#define _THREADED_STRESS_TEST_HELPERS_H_
#define USE_BACKUP
#ifdef USE_BACKUP
#include "../../backup-enterprise/backup/backup.h"
#endif
#include "toku_config.h"
#include "test.h"
...
...
@@ -175,6 +180,9 @@ struct cli_args {
int
num_elements
;
// number of elements per DB
int
num_DBs
;
// number of DBs
int
num_seconds
;
// how long test should run
#ifdef USE_BACKUP
int
backup_after_num_seconds
;
// Perform a backup after this many seconds
#endif
int
join_timeout
;
// how long to wait for threads to join before assuming deadlocks
bool
only_create
;
// true if want to only create DBs but not run stress
bool
only_stress
;
// true if DBs are already created and want to only run stress
...
...
@@ -2248,6 +2256,9 @@ static struct cli_args UU() get_default_args(void) {
.
num_elements
=
150000
,
.
num_DBs
=
1
,
.
num_seconds
=
180
,
#ifdef USE_BACKUP
.
backup_after_num_seconds
=
-
1
,
// negative means no backup
#endif
.
join_timeout
=
3600
,
.
only_create
=
false
,
.
only_stress
=
false
,
...
...
@@ -2622,6 +2633,9 @@ static inline void parse_stress_test_args (int argc, char *const argv[], struct
INT32_ARG_NONNEG
(
"--num_elements"
,
num_elements
,
""
),
INT32_ARG_NONNEG
(
"--num_DBs"
,
num_DBs
,
""
),
INT32_ARG_NONNEG
(
"--num_seconds"
,
num_seconds
,
"s"
),
#ifdef USE_BACKUP
INT32_ARG_NONNEG
(
"--backup_after_num_seconds"
,
backup_after_num_seconds
,
"s"
),
#endif
INT32_ARG_NONNEG
(
"--node_size"
,
env_args
.
node_size
,
" bytes"
),
INT32_ARG_NONNEG
(
"--basement_node_size"
,
env_args
.
basement_node_size
,
" bytes"
),
INT32_ARG_NONNEG
(
"--rollback_node_size"
,
env_args
.
rollback_node_size
,
" bytes"
),
...
...
@@ -2864,9 +2878,45 @@ UU() stress_recover(struct cli_args *args) {
{
int
chk_r
=
close_tables
(
env
,
dbs
,
args
->
num_DBs
);
CKERR
(
chk_r
);
}
}
#ifdef USE_BACKUP
static
int
simple_poll_fun
(
float
progress
,
const
char
*
progress_string
,
void
*
args_v
)
{
struct
cli_args
*
UU
(
args
)
=
(
struct
cli_args
*
)
args_v
;
if
(
verbose
)
{
printf
(
"Progress %f: %s
\n
"
,
progress
,
progress_string
);
}
return
0
;
}
static
void
simple_error_fun
(
int
error_number
,
const
char
*
error_string
,
void
*
UU
(
error_extra
))
{
printf
(
"Error not expected. Got error %d (%s)
\n
"
,
error_number
,
error_string
);
abort
();
}
static
void
*
do_backup_thread
(
void
*
args_v
)
{
struct
cli_args
*
args
=
(
struct
cli_args
*
)
args_v
;
printf
(
"Doing backup source+dirs=%s
\n
"
,
args
->
env_args
.
envdir
);
sleep
(
args
->
backup_after_num_seconds
);
const
char
*
source_dirs
[]
=
{
args
->
env_args
.
envdir
};
const
char
*
dest_dirs
[]
=
{
"backup"
};
int
r
=
tokubackup_create_backup
(
source_dirs
,
dest_dirs
,
1
,
simple_poll_fun
,
args
,
simple_error_fun
,
NULL
);
CKERR
(
r
);
printf
(
"Done with backup
\n
"
);
return
args_v
;
}
#endif
static
void
open_and_stress_tables
(
struct
cli_args
*
args
,
bool
fill_with_zeroes
,
int
(
*
cmp
)(
DB
*
,
const
DBT
*
,
const
DBT
*
))
{
#ifdef USE_BACKUP
pthread_t
backup_thread
;
if
(
args
->
backup_after_num_seconds
>=
0
)
{
assert
(
args
->
backup_after_num_seconds
<
args
->
num_seconds
+
2
);
// allow things to shut down, but not drag out.
int
chk_r
=
toku_pthread_create
(
&
backup_thread
,
NULL
,
do_backup_thread
,
args
);
CKERR
(
chk_r
);
}
#endif
if
((
args
->
key_size
<
8
&&
args
->
key_size
!=
4
)
||
(
args
->
val_size
<
8
&&
args
->
val_size
!=
4
))
{
fprintf
(
stderr
,
"The only valid key/val sizes are 4, 8, and > 8.
\n
"
);
...
...
@@ -2902,6 +2952,12 @@ open_and_stress_tables(struct cli_args *args, bool fill_with_zeroes, int (*cmp)(
stress_table
(
env
,
dbs
,
args
);
{
int
chk_r
=
close_tables
(
env
,
dbs
,
args
->
num_DBs
);
CKERR
(
chk_r
);
}
}
#ifdef USE_BACKUP
if
(
args
->
backup_after_num_seconds
>=
0
)
{
int
r
=
toku_pthread_join
(
backup_thread
,
NULL
);
assert
(
r
==
0
);
}
#endif
}
static
void
...
...
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