Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing check when creating weight load balancing algorithm #33248

Closed
RaigorJiang opened this issue Oct 15, 2024 · 0 comments · Fixed by #33249
Closed

Missing check when creating weight load balancing algorithm #33248

RaigorJiang opened this issue Oct 15, 2024 · 0 comments · Fixed by #33249

Comments

@RaigorJiang
Copy link
Contributor

Bug Report

Which version of ShardingSphere did you use?

5.5.1-SNAPSHOT d52db30

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

If a non-existent storage unit is referenced when creating a rule, an exception should be prompted

Actual behavior

The rule persistence succeeded, but the metadata refresh failed

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

1. DistSQL

create database readwrite_splitting_db;

use readwrite_splitting_db;

REGISTER STORAGE UNIT write_ds_0 (
    URL="jdbc:mysql://127.0.0.1:3306/write_ds_0?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
    USER="root",
    PASSWORD="123456",
    PROPERTIES("maximumPoolSize"=10)
), read_ds_0_0 (
    URL="jdbc:mysql://127.0.0.1:3306/read_ds_0_0?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
    USER="root",
    PASSWORD="123456",
    PROPERTIES("maximumPoolSize"=10)
), read_ds_0_1 (
    URL="jdbc:mysql://127.0.0.1:3306/read_ds_0_1?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
    USER="root",
    PASSWORD="123456",
    PROPERTIES("maximumPoolSize"=10)
);

-- Note that read_ds_0_2 does not exist
CREATE READWRITE_SPLITTING RULE group_0 (
    WRITE_STORAGE_UNIT=write_ds_0,
    READ_STORAGE_UNITS(read_ds_0_0,read_ds_0_1),
    TRANSACTIONAL_READ_QUERY_STRATEGY='PRIMARY',
    TYPE(NAME="WEIGHT", PROPERTIES("read_ds_0_0"="5", "read_ds_0_2"="5"))
);

2. Proxy log

image
@RaigorJiang RaigorJiang added this to the 5.5.2 milestone Oct 15, 2024
jiangML pushed a commit that referenced this issue Nov 12, 2024
* Pick 5.5.0-fix #15, optimize the rollback strategy for import database config failed

* Pick #33248, Check weight load balancer props when create readwrite-splitting rule

* Pick #33274, Add query parameters and check for mysql kill processId

* Pick #33367, Remove ShardingRouteAlgorithmException check logic temporarily to support different actual table name config

* Pick #33346, Fix missing logic db when query information_schema.SCHEMATA with NOT IN clause

* Pick #33370, Fix table does not exist exception when use HintManager#setDatabaseName to transparent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant