mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx-tools: добавление опций -d
и -p
для mdbx_copy
.
This commit is contained in:
parent
9eef3c3541
commit
69f85af242
@ -14,6 +14,10 @@ mdbx_copy \- MDBX environment copy tool
|
||||
[\c
|
||||
.BR \-c ]
|
||||
[\c
|
||||
.BR \-d ]
|
||||
[\c
|
||||
.BR \-p ]
|
||||
[\c
|
||||
.BR \-n ]
|
||||
.B src_path
|
||||
[\c
|
||||
@ -45,6 +49,22 @@ or unused pages will be omitted from the copy. This option will
|
||||
slow down the backup process as it is more CPU-intensive.
|
||||
Currently it fails if the environment has suffered a page leak.
|
||||
.TP
|
||||
.BR \-d
|
||||
Alters geometry to enforce the copy to be a dynamic size DB,
|
||||
which could be growth and shrink by reasonable steps on the fly.
|
||||
.TP
|
||||
.BR \-p
|
||||
Use read transaction parking/ousting during copying MVCC-snapshot.
|
||||
This allows the writing transaction to oust the read
|
||||
transaction used to copy the database if copying takes so long
|
||||
that it will interfere with the recycling old MVCC snapshots
|
||||
and may lead to an overflow of the database.
|
||||
However, if the reading transaction is ousted the copy will
|
||||
be aborted until successful completion. Thus, this option
|
||||
allows copy the database without interfering with write
|
||||
transactions and a threat of database overflow, but at the cost
|
||||
that copying will be aborted to prevent such conditions.
|
||||
.TP
|
||||
.BR \-u
|
||||
Warms up the DB before copying via notifying OS kernel of subsequent access to the database pages.
|
||||
.TP
|
||||
|
@ -39,10 +39,13 @@ static void signal_handler(int sig) {
|
||||
static void usage(const char *prog) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"usage: %s [-V] [-q] [-c] [-u|U] src_path [dest_path]\n"
|
||||
"usage: %s [-V] [-q] [-c] [-d] [-p] [-u|U] src_path [dest_path]\n"
|
||||
" -V\t\tprint version and exit\n"
|
||||
" -q\t\tbe quiet\n"
|
||||
" -c\t\tenable compactification (skip unused pages)\n"
|
||||
" -d\t\tenforce copy to be a dynamic size DB\n"
|
||||
" -p\t\tusing transaction parking/ousting during copying MVCC-snapshot\n"
|
||||
" \t\tto avoid stopping recycling and overflowing the DB\n"
|
||||
" -u\t\twarmup database before copying\n"
|
||||
" -U\t\twarmup and try lock database pages in memory before copying\n"
|
||||
" src_path\tsource database\n"
|
||||
@ -66,6 +69,10 @@ int main(int argc, char *argv[]) {
|
||||
flags |= MDBX_NOSUBDIR;
|
||||
else if (argv[1][1] == 'c' && argv[1][2] == '\0')
|
||||
cpflags |= MDBX_CP_COMPACT;
|
||||
else if (argv[1][1] == 'd' && argv[1][2] == '\0')
|
||||
cpflags |= MDBX_CP_FORCE_DYNAMIC_SIZE;
|
||||
else if (argv[1][1] == 'p' && argv[1][2] == '\0')
|
||||
cpflags |= MDBX_CP_THROTTLE_MVCC;
|
||||
else if (argv[1][1] == 'q' && argv[1][2] == '\0')
|
||||
quiet = true;
|
||||
else if (argv[1][1] == 'u' && argv[1][2] == '\0')
|
||||
|
Loading…
Reference in New Issue
Block a user