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

MetaDataChangedSubscriber throws an exception when alter storage unit #34040

Open
RaigorJiang opened this issue Dec 13, 2024 · 0 comments
Open
Assignees
Milestone

Comments

@RaigorJiang
Copy link
Contributor

RaigorJiang commented Dec 13, 2024

Bug Report

Which version of ShardingSphere did you use?

5.5.2-SNAPSHOT master f39b52b

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

ShardingSphere-Proxy

Expected behavior

Alter storage unit success

Actual behavior

MetaDataChangedSubscriber throws an exception
image

Reason analyze (If you can)

No

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

1. create database

CREATE DATABASE sharding_db;
USE sharding_db;

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

2. create sharding table rule

CREATE SHARDING TABLE RULE t_order (
STORAGE_UNITS(ds_0,ds_1),
SHARDING_COLUMN=order_id,
TYPE(NAME="MOD",PROPERTIES("sharding-count"="4")));

3. create table

DROP TABLE IF EXISTS t_order;
CREATE TABLE `t_order` (
        `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
        `order_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'order id',
        PRIMARY KEY (`id`)
);

4. active version before alter

image

5. alter storage unit

ALTER STORAGE UNIT ds_0 (
    URL="jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
    USER="root",
    PASSWORD="123456",
    PROPERTIES("maximumPoolSize"=10)
), ds_1 (
    URL="jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
    USER="root",
    PASSWORD="123456",
    PROPERTIES("maximumPoolSize"=10)
);

6. active version after alter

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants