You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/10 06:40:57 UTC

[GitHub] [shardingsphere] zhaojinchao95 opened a new issue, #17094: Need to check `ALTER SHARDING TABLE RULE` legality when use scaling

zhaojinchao95 opened a new issue, #17094:
URL: https://github.com/apache/shardingsphere/issues/17094

   ### Which version of ShardingSphere did you use?
   
   `master`
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   `ShardingSphere-Proxy`
   
   ### Expected behavior
   
   `show scaling status 0130317c30317c3054317c7465737431` have information
   
   ### Actual behavior
   
   No message
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ```
   mysql> create database test1;
   Query OK, 0 rows affected (0.16 sec)
   
   mysql> ADD RESOURCE ds_0 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_0?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=123456,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ), ds_1 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_1?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=123456,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> );
   ERROR 1046 (3D000): No database selected
   mysql> use test1;
   Database changed
   mysql> ADD RESOURCE ds_0 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_0?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=123456,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ), ds_1 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_1?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=123456,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> );
   Query OK, 0 rows affected (0.57 sec)
   
   mysql> CREATE SHARDING TABLE RULE t_order(
       -> RESOURCES(ds_0,ds_1),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
       -> ), t_order_item(
       -> RESOURCES(ds_0,ds_1),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
       -> );
   Query OK, 0 rows affected (1.63 sec)
   
   mysql> CREATE TABLE t_order (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
   
   CREATE TABLE t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
   Query OK, 0 rows affected (0.31 sec)
   
   mysql>
   mysql> CREATE TABLE t_order_item (item_id INT NOT NULL, order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, creation_date DATE, PRIMARY KEY (item_id));
   Query OK, 0 rows affected (0.17 sec)
   
   mysql> insert into t_order (order_id, user_id, status) values (1,2,'ok'),(2,4,'ok'),(3,6,'ok'),(4,1,'ok'),(5,3,'ok'),(6,5,'ok');
   Query OK, 6 rows affected (0.08 sec)
   
   mysql>
   mysql> insert into t_order_item (item_id, order_id, user_id, status) values (1,1,2,'ok'),(2,2,4,'ok'),(3,3,6,'ok'),(4,4,1,'ok'),(5,5,3,'ok'),(6,6,5,'ok');
   Query OK, 6 rows affected (0.01 sec)
   
   mysql> preview select count(1) from t_order;
   +------------------+-------------------------------------------------------------------------+
   | data_source_name | actual_sql                                                              |
   +------------------+-------------------------------------------------------------------------+
   | ds_0             | select count(1) from t_order_0 UNION ALL select count(1) from t_order_2 |
   | ds_1             | select count(1) from t_order_1 UNION ALL select count(1) from t_order_3 |
   +------------------+-------------------------------------------------------------------------+
   2 rows in set (0.10 sec)
   
   mysql>
   mysql> preview select count(1) from t_order_item;
   +------------------+-----------------------------------------------------------------------------------+
   | data_source_name | actual_sql                                                                        |
   +------------------+-----------------------------------------------------------------------------------+
   | ds_0             | select count(1) from t_order_item_0 UNION ALL select count(1) from t_order_item_2 |
   | ds_1             | select count(1) from t_order_item_1 UNION ALL select count(1) from t_order_item_3 |
   +------------------+-----------------------------------------------------------------------------------+
   2 rows in set (0.01 sec)
   
   mysql> ADD RESOURCE ds_2 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_10?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=123456,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ), ds_3 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_11?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=123456,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> ), ds_4 (
       ->     URL="jdbc:mysql://127.0.0.1:3306/scaling_ds_12?serverTimezone=UTC&useSSL=false",
       ->     USER=root,
       ->     PASSWORD=123456,
       ->     PROPERTIES("maximumPoolSize"=50,"idleTimeout"="60000")
       -> );
   Query OK, 0 rows affected (0.12 sec)
   
   mysql> CREATE SHARDING SCALING RULE scaling_auto2 (
       -> COMPLETION_DETECTOR(TYPE(NAME=IDLE, PROPERTIES("incremental-task-idle-minute-threshold"=1))),
       -> DATA_CONSISTENCY_CHECKER(TYPE(NAME=CRC32_MATCH))
       -> );
   Query OK, 0 rows affected (0.09 sec)
   
   mysql> ALTER SHARDING TABLE RULE t_order(
       -> RESOURCES(ds_2,ds_3,ds_4),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=6)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
       -> ), t_order_item(
       -> RESOURCES(ds_2,ds_3,ds_4),
       -> SHARDING_COLUMN=order_id,
       -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=6)),
       -> KEY_GENERATE_STRATEGY(COLUMN=order_id,TYPE(NAME=snowflake))
       -> );
   Query OK, 0 rows affected (0.17 sec)
   
   mysql> show scaling list;
   +----------------------------------+----------------------+----------------------+--------+---------------------+-----------+
   | id                               | tables               | sharding_total_count | active | create_time         | stop_time |
   +----------------------------------+----------------------+----------------------+--------+---------------------+-----------+
   | 0130317c30317c3054317c7465737431 | t_order,t_order_item | 2                    | true   | 2022-04-25 19:09:45 | NULL      |
   +----------------------------------+----------------------+----------------------+--------+---------------------+-----------+
   1 row in set (0.09 sec)
   
   mysql>  show scaling status 0130317c30317c3054317c7465737431
       -> ;
   +------+-------------+--------+--------+-------------------------------+--------------------------+
   | item | data_source | status | active | inventory_finished_percentage | incremental_idle_seconds |
   +------+-------------+--------+--------+-------------------------------+--------------------------+
   | 0    |             |        |        |                               |                          |
   | 1    |             |        |        |                               |                          |
   +------+-------------+--------+--------+-------------------------------+--------------------------+
   2 rows in set (0.01 sec)
   
   mysql> ;
   ERROR:
   No query specified
   
   mysql>  show scaling status 0130317c30317c3054317c7465737431;
   +------+-------------+--------+--------+-------------------------------+--------------------------+
   | item | data_source | status | active | inventory_finished_percentage | incremental_idle_seconds |
   +------+-------------+--------+--------+-------------------------------+--------------------------+
   | 0    |             |        |        |                               |                          |
   | 1    |             |        |        |                               |                          |
   +------+-------------+--------+--------+-------------------------------+--------------------------+
   2 rows in set (0.01 sec)
   ```
   
   ### Think
   
   ```
   CREATE SHARDING SCALING RULE scaling_auto2 (
   COMPLETION_DETECTOR(TYPE(NAME=IDLE, PROPERTIES("incremental-task-idle-minute-threshold"=1))),
   DATA_CONSISTENCY_CHECKER(TYPE(NAME=CRC32_MATCH))
   );
   ```
   
   Execute `ALTER SHARDING TABLE RULE t_order.. ` after 1 minute is OK. 
   Execute `ALTER SHARDING TABLE RULE t_order.. ` in less than 1 minute is Fail.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Need to check `ALTER SHARDING TABLE RULE` legality when use scaling [shardingsphere]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17094:
URL: https://github.com/apache/shardingsphere/issues/17094#issuecomment-2026020512

   There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #17094: Need to check `ALTER SHARDING TABLE RULE` legality when use scaling

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #17094:
URL: https://github.com/apache/shardingsphere/issues/17094#issuecomment-1272349918

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #17094: Need to check `ALTER SHARDING TABLE RULE` legality when use scaling

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #17094: Need to check `ALTER SHARDING TABLE RULE` legality when use scaling
URL: https://github.com/apache/shardingsphere/issues/17094


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org