summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-11-14 17:45:37 +0100
committerunknown <guilhem@mysql.com>2004-11-14 17:45:37 +0100
commitce85816690ce8a7cc52a4010463bf33a8d231a0f (patch)
tree0a5167f3dba4c55698528aeb97ddb29895efb481 /client
parentd6f7134d55464cebd8ab82d3e8af043cfec02049 (diff)
downloadmariadb-git-ce85816690ce8a7cc52a4010463bf33a8d231a0f.tar.gz
Try to lower the probability of a stall of mysqldump AND most client connections, when mysqldump does a FLUSH TABLES WITH READ LOCK
(doing FLUSH TABLES first). client/mysqldump.c: try to lower the probability of a stall of mysqldump AND most client connections, when mysqldump does a FLUSH TABLES WITH READ LOCK (doing FLUSH TABLES first).
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 540f0d78c50..498a10041a9 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2050,8 +2050,18 @@ static int do_show_master_status(MYSQL *mysql_con)
static int do_flush_tables_read_lock(MYSQL *mysql_con)
{
+ /*
+ 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.
+ */
return
- mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES WITH READ LOCK");
+ ( mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES") ||
+ mysql_query_with_error_report(mysql_con, 0,
+ "FLUSH TABLES WITH READ LOCK") );
}