FLUSH TABLES WITH READ LOCK Locks the entire cluster

Description

FLUSH TABLES WITH READ LOCK on one node appears to lock other nodes as well.

In a 3 nodes Galera cluster if I do FTWRL on one node and apply simple DDL or DML on other nodes I don't have any locking.

To reproduce the issue I used a trivial mysqlslap test:

  1. on my node 1
    $ mysqlslap --concurrency=10 --iterations=200 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql -uroot -h127.0.0.1 -P10021

With this as soon as FTWRL is executed on another node, say 3, all threads of mysqlslap on node 1 will hang with something like:

{{

1 2 3 4 5 6 7 8 9 10 11 | 519 | root | localhost:46438 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (2101913295,1100418235,'XQ0K9x30cYaFq2RvMZzKHKgmxy4uKBpreh4fX7f7XEEM8a9Nz8jGKF | 0.000 | | 520 | root | localhost:46440 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (2101913295,1100418235,'XQ0K9x30cYaFq2RvMZzKHKgmxy4uKBpreh4fX7f7XEEM8a9Nz8jGKF | 0.000 | | 521 | root | localhost:46442 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (2101913295,1100418235,'XQ0K9x30cYaFq2RvMZzKHKgmxy4uKBpreh4fX7f7XEEM8a9Nz8jGKF | 0.000 | | 522 | root | localhost:46444 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (2101913295,1100418235,'XQ0K9x30cYaFq2RvMZzKHKgmxy4uKBpreh4fX7f7XEEM8a9Nz8jGKF | 0.000 | | 523 | root | localhost:46446 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (1233983202,789373855,'jdtPbBILRQyiu7nZN3RdI96aQOP4Y0z7dlO4wbQF1OpvYdLnggGrqMP | 0.000 | | 524 | root | localhost:46448 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (1233983202,789373855,'jdtPbBILRQyiu7nZN3RdI96aQOP4Y0z7dlO4wbQF1OpvYdLnggGrqMP | 0.000 | | 525 | root | localhost:46450 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (1233983202,789373855,'jdtPbBILRQyiu7nZN3RdI96aQOP4Y0z7dlO4wbQF1OpvYdLnggGrqMP | 0.000 | | 526 | root | localhost:46452 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (1233983202,789373855,'jdtPbBILRQyiu7nZN3RdI96aQOP4Y0z7dlO4wbQF1OpvYdLnggGrqMP | 0.000 | | 527 | root | localhost:46454 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (1233983202,789373855,'jdtPbBILRQyiu7nZN3RdI96aQOP4Y0z7dlO4wbQF1OpvYdLnggGrqMP | 0.000 | | 528 | root | localhost:46456 | mysqlslap | Query | 4 | query end | INSERT INTO t1 VALUES (2101913295,1100418235,'XQ0K9x30cYaFq2RvMZzKHKgmxy4uKBpreh4fX7f7XEEM8a9Nz8jGKF | 0.000 | +-----+-------------+-----------------+-----------+---------+------+--------------------+------------------------------------------------------------------------------------------------------+----------+

}}

At this point, writing to any other node is also impossible, statements will hang, and so the whole cluster is locked.

FTWRL is used for backups, for example, so potentially a backup can lock the whole cluster.

Environment

Linux 64

Status

Assignee

Nirbhay Choubey

Reporter

Claudio Nanni

Labels

None

External issue ID

None

External issue ID

None

Components

Affects versions

10.1.11

Priority

Critical