Distsql执行超时的问题

环境介绍

shardingsphere-proxy版本:v5.2.0
后端MySQL版本:5.7;主从复制:1主2从
mode.type: Cluster(zookeeper)

问题描述

后端MySQL为1主2从的主从复制,当1个从库shutdown后,使用Distsql进行alter READWRITE_SPLITTING报错超时退出。

测试

  1. 添加resource
ALTER RESOURCE ds_10_216_91_118_3309 (
HOST="10.216.91.118",
PORT=3309,
DB="jz_ds_0",
USER="dba",
PASSWORD="123456",
PROPERTIES("maximumPoolSize"="10","idleTimeout"="30000","initializationFailTimeout"="1","validationTimeout"="5000","connectionTimeout"="30000")
),ds_10_216_91_119_3309 (
HOST="10.216.91.119",
PORT=3309,
DB="jz_ds_0",
USER="dba",
PASSWORD="123456"
),ds_10_216_91_120_3309 (
HOST="10.216.91.120",
PORT=3309,
DB="jz_ds_0",
USER="dba",
PASSWORD="123456"
);
  1. 配置读写分离
CREATE READWRITE_SPLITTING RULE my_group_3309 (
WRITE_RESOURCE=ds_10_216_91_118_3309,
READ_RESOURCES(ds_10_216_91_119_3309,ds_10_216_91_120_3309),
TYPE(NAME="random")
);
mysql> SHOW READWRITE_SPLITTING RULES \G
*************************** 1. row ***************************
                           name: my_group_3309
    auto_aware_data_source_name: 
write_data_source_query_enabled: 
         write_data_source_name: ds_10_216_91_118_3309
         read_data_source_names: ds_10_216_91_119_3309,ds_10_216_91_120_3309
             load_balancer_type: random
            load_balancer_props: 
1 row in set (0.00 sec)
  1. 查看MySQL架构
    image

  2. 模拟从库shutdown

  3. Distsql 进行atlter操作


    或者

此时出现alter 操作等待超时退出的问题。

京ICP备2021015875号