Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.5.6
-
None
-
CentOS 7.7.1908
-
MXS-SPRINT-138
Description
Config:
[CCRf]
|
type=filter
|
module=ccrfilter
|
time=15
|
options=ignorecase
|
match=/.*INSERT.*/
|
|
[Read-Write-Service]
|
type=service
|
router=readwritesplit
|
servers=server1,server2,server3
|
user=max
|
password=max
|
filters=CCRf
|
master_accept_reads=true
|
max_sescmd_history=1500
|
prune_sescmd_history=true
|
delayed_retry=true
|
delayed_retry_timeout=1
|
Servers:
┌─────────┬────────────┬──────┬─────────────┬─────────────────┬───────────────────────┐
|
│ Server │ Address │ Port │ Connections │ State │ GTID │
|
├─────────┼────────────┼──────┼─────────────┼─────────────────┼───────────────────────┤
|
│ server1 │ 10.0.0.125 │ 3306 │ 0 │ Master, Running │ 125-125-161 │
|
├─────────┼────────────┼──────┼─────────────┼─────────────────┼───────────────────────┤
|
│ server2 │ 10.0.0.131 │ 3306 │ 0 │ Slave, Running │ 125-125-161 │
|
├─────────┼────────────┼──────┼─────────────┼─────────────────┼───────────────────────┤
|
│ server3 │ 10.0.0.124 │ 3306 │ 0 │ Slave, Running │ 124-124-4,125-125-161 │
|
└─────────┴────────────┴──────┴─────────────┴─────────────────┴───────────────────────┘
|
Filter:
┌────────────┬──────────────────────────────┐
|
│ Filter │ CCRf │
|
├────────────┼──────────────────────────────┤
|
│ Module │ ccrfilter │
|
├────────────┼──────────────────────────────┤
|
│ Services │ Read-Write-Service │
|
├────────────┼──────────────────────────────┤
|
│ Parameters │ { │
|
│ │ "count": 0, │
|
│ │ "global": false, │
|
│ │ "ignore": "", │
|
│ │ "match": ".*INSERT.*", │
|
│ │ "options": "ignorecase", │
|
│ │ "time": 15 │
|
│ │ } │
|
└────────────┴──────────────────────────────┘
|
Results:
~# mysql -h 10.0.0.87 -u max -pmax -e "insert into test.simple( val, blah) values( $RANDOM, '$(hostname)'); select now(), @@hostname; select sleep(10); select now(), @@hostname; select sleep(10); select now(), @@hostname;"
|
+---------------------+-----------------------------------------+
|
| now() | @@hostname |
|
+---------------------+-----------------------------------------+
|
| 2021-07-01 23:38:04 | MariaDB-10-5-8-Maxscale-2-5-6-C77-S-131 |
|
+---------------------+-----------------------------------------+
|
+-----------+
|
| sleep(10) |
|
+-----------+
|
| 0 |
|
+-----------+
|
+---------------------+-----------------------------------------+
|
| now() | @@hostname |
|
+---------------------+-----------------------------------------+
|
| 2021-07-01 23:38:14 | MariaDB-10-5-8-Maxscale-2-5-6-C77-S-125 |
|
+---------------------+-----------------------------------------+
|
+-----------+
|
| sleep(10) |
|
+-----------+
|
| 0 |
|
+-----------+
|
+---------------------+-----------------------------------------+
|
| now() | @@hostname |
|
+---------------------+-----------------------------------------+
|
| 2021-07-01 23:38:24 | MariaDB-10-5-8-Maxscale-2-5-6-C77-S-124 |
|
+---------------------+-----------------------------------------+
|
~# mysql -h 10.0.0.87 -u max -pmax -e "INSERT into test.simple( val, blah) values( $RANDOM, '$(hostname)'); select now(), @@hostname; select sleep(10); select now(), @@hostname; select sleep(10); select now(), @@hostname;"
|
+---------------------+-----------------------------------------+
|
| now() | @@hostname |
|
+---------------------+-----------------------------------------+
|
| 2021-07-01 23:38:44 | MariaDB-10-5-8-Maxscale-2-5-6-C77-S-125 |
|
+---------------------+-----------------------------------------+
|
+-----------+
|
| sleep(10) |
|
+-----------+
|
| 0 |
|
+-----------+
|
+---------------------+-----------------------------------------+
|
| now() | @@hostname |
|
+---------------------+-----------------------------------------+
|
| 2021-07-01 23:38:54 | MariaDB-10-5-8-Maxscale-2-5-6-C77-S-125 |
|
+---------------------+-----------------------------------------+
|
+-----------+
|
| sleep(10) |
|
+-----------+
|
| 0 |
|
+-----------+
|
+---------------------+-----------------------------------------+
|
| now() | @@hostname |
|
+---------------------+-----------------------------------------+
|
| 2021-07-01 23:39:04 | MariaDB-10-5-8-Maxscale-2-5-6-C77-S-131 |
|
+---------------------+-----------------------------------------+
|