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
c0ca164b
Commit
c0ca164b
authored
Nov 19, 2018
by
Vladislav Vaintroub
Committed by
Monty
Dec 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17308 mariabackup to use the BACKUP statement instead of FTWRL
parent
c53aab97
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
31 deletions
+21
-31
extra/mariabackup/backup_mysql.cc
extra/mariabackup/backup_mysql.cc
+9
-28
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+12
-3
No files found.
extra/mariabackup/backup_mysql.cc
View file @
c0ca164b
...
...
@@ -971,28 +971,10 @@ lock_tables(MYSQL *connection)
}
if
(
opt_lock_ddl_per_table
)
{
/* TODO : Remove after MDEV-17772 is fixed */
start_mdl_waiters_killer
();
}
if
(
!
opt_lock_wait_timeout
&&
!
opt_kill_long_queries_timeout
)
{
/* We do first a FLUSH TABLES. If a long update is running, the
FLUSH TABLES will wait but will not stall the whole mysqld, and
when the long update is done the FLUSH TABLES WITH READ LOCK
will start and succeed quickly. So, FLUSH TABLES is to lower
the probability of a stage where both mysqldump and most client
connections are stalled. Of course, if a second long update
starts between the two FLUSHes, we have that bad stall.
Option lock_wait_timeout serve the same purpose and is not
compatible with this trick.
*/
msg_ts
(
"Executing FLUSH NO_WRITE_TO_BINLOG TABLES...
\n
"
);
xb_mysql_query
(
connection
,
"FLUSH NO_WRITE_TO_BINLOG TABLES"
,
false
);
}
if
(
opt_lock_wait_timeout
)
{
if
(
!
wait_for_no_updates
(
connection
,
opt_lock_wait_timeout
,
...
...
@@ -1001,7 +983,7 @@ lock_tables(MYSQL *connection)
}
}
msg_ts
(
"
Executing FLUSH TABLES WITH READ LOCK
...
\n
"
);
msg_ts
(
"
Acquiring BACKUP LOCKS
...
\n
"
);
if
(
opt_kill_long_queries_timeout
)
{
start_query_killer
();
...
...
@@ -1012,9 +994,13 @@ lock_tables(MYSQL *connection)
"SET SESSION wsrep_causal_reads=0"
,
false
);
}
xb_mysql_query
(
connection
,
"FLUSH TABLES WITH READ LOCK"
,
false
);
xb_mysql_query
(
connection
,
"BACKUP STAGE START"
,
true
);
//xb_mysql_query(connection, "BACKUP STAGE FLUSH", true);
//xb_mysql_query(connection, "BACKUP STAGE BLOCK_DDL", true);
xb_mysql_query
(
connection
,
"BACKUP STAGE BLOCK_COMMIT"
,
true
);
if
(
opt_lock_ddl_per_table
)
{
/* TODO : Remove after MDEV-17772 is fixed */
stop_mdl_waiters_killer
();
}
...
...
@@ -1058,13 +1044,8 @@ unlock_all(MYSQL *connection)
os_thread_sleep
(
opt_debug_sleep_before_unlock
*
1000
);
}
if
(
binlog_locked
)
{
msg_ts
(
"Executing UNLOCK BINLOG
\n
"
);
xb_mysql_query
(
connection
,
"UNLOCK BINLOG"
,
false
);
}
msg_ts
(
"Executing UNLOCK TABLES
\n
"
);
xb_mysql_query
(
connection
,
"UNLOCK TABLES"
,
false
);
msg_ts
(
"Executing BACKUP STAGE END
\n
"
);
xb_mysql_query
(
connection
,
"BACKUP STAGE END"
,
false
);
msg_ts
(
"All tables unlocked
\n
"
);
}
...
...
extra/mariabackup/xtrabackup.cc
View file @
c0ca164b
...
...
@@ -474,9 +474,18 @@ DECLARE_THREAD(dbug_execute_in_new_connection)(void *arg)
dbug_thread_param_t
*
par
=
(
dbug_thread_param_t
*
)
arg
;
int
err
=
mysql_query
(
par
->
con
,
par
->
query
);
int
err_no
=
mysql_errno
(
par
->
con
);
DBUG_ASSERT
(
par
->
expect_err
==
err
);
if
(
err
&&
par
->
expect_errno
)
DBUG_ASSERT
(
err_no
==
par
->
expect_errno
);
if
(
par
->
expect_err
!=
err
)
{
msg
(
"FATAL: dbug_execute_in_new_connection : mysql_query '%s' returns %d, instead of expected %d"
,
par
->
query
,
err
,
par
->
expect_err
);
_exit
(
1
);
}
if
(
err
&&
par
->
expect_errno
&&
par
->
expect_errno
!=
err_no
)
{
msg
(
"FATAL: dbug_execute_in_new_connection: mysql_query '%s' returns mysql_errno %d, instead of expected %d"
,
par
->
query
,
err_no
,
par
->
expect_errno
);
_exit
(
1
);
}
mysql_close
(
par
->
con
);
mysql_thread_end
();
os_event_t
done
=
par
->
done_event
;
...
...
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