azexcy opened a new issue, #18442:
URL: https://github.com/apache/shardingsphere/issues/18442
## Bug Report
The command is executed as follows
```
mysql> CREATE TABLE t_order (order_id bigint NOT NULL, user_id int DEFAULT
NULL, status varchar(50) DEFAULT NULL, t_numeric numeric(10,2) DEFAULT NULL,
PRIMARY KEY (order_id));
Query OK, 0 rows affected (0.60 sec)
mysql> ALTER SHARDING TABLE RULE
t_order(RESOURCES(ds_2),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 (2.10 sec)
mysql> check scaling 0130317c30317c3054317c7368617264696e675f6462;
+------------+----------------------+----------------------+-----------------------+-------------------------+
| table_name | source_records_count | target_records_count |
records_count_matched | records_content_matched |
+------------+----------------------+----------------------+-----------------------+-------------------------+
| t_order | 367 | 0 | false
| false |
+------------+----------------------+----------------------+-----------------------+-------------------------+
1 row in set (1.06 sec)
mysql> check scaling 0130317c30317c3054317c7368617264696e675f6462;
+------------+----------------------+----------------------+-----------------------+-------------------------+
| table_name | source_records_count | target_records_count |
records_count_matched | records_content_matched |
+------------+----------------------+----------------------+-----------------------+-------------------------+
| t_order | 554 | 69 | false
| false |
+------------+----------------------+----------------------+-----------------------+-------------------------+
1 row in set (0.54 sec)
mysql> STOP SCALING 0130317c30317c3054317c7368617264696e675f6462;
Query OK, 0 rows affected (0.05 sec)
mysql> start scaling 0130317c30317c3054317c7368617264696e675f6462;
Query OK, 0 rows affected (0.02 sec)
mysql> STOP SCALING 0130317c30317c3054317c7368617264696e675f6462;
Query OK, 0 rows affected (0.02 sec)
mysql> show scaling list;
+----------------------------------------------+---------+----------------------+--------+---------------------+---------------------+
| id | tables |
sharding_total_count | active | create_time | stop_time |
+----------------------------------------------+---------+----------------------+--------+---------------------+---------------------+
| 0130317c30317c3054317c7368617264696e675f6462 | t_order | 2
| false | 2022-06-20 13:44:23 | 2022-06-20 13:44:46 |
+----------------------------------------------+---------+----------------------+--------+---------------------+---------------------+
1 row in set (0.06 sec)
mysql> show scaling status 0130317c30317c3054317c7368617264696e675f6462;
+------+-------------+-------------------+--------+-------------------------------+--------------------------+
| item | data_source | status | active |
inventory_finished_percentage | incremental_idle_seconds |
+------+-------------+-------------------+--------+-------------------------------+--------------------------+
| 0 | ds_0 | RUNNING | false | 0
| 0 |
| 1 | | PREPARING_FAILURE | false | 0
| 0 |
+------+-------------+-------------------+--------+-------------------------------+--------------------------+
2 rows in set (0.04 sec)
```
When execute start/stop scaling
### Which version of ShardingSphere did you use?
master
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
no exception will be thrown.
### Actual behavior
```
[ERROR] 2022-06-20 13:44:50.903 [Thread-6]
o.a.s.d.p.s.r.RuleAlteredJobScheduler - job prepare failed,
0130317c30317c3054317c7368617264696e675f6462-1
org.apache.shardingsphere.data.pipeline.core.exception.PipelineJobPrepareFailedException:
Job stopping, jobId=0130317c30317c3054317c7368617264696e675f6462
at
org.apache.shardingsphere.data.pipeline.scenario.rulealtered.RuleAlteredJobPreparer.prepare(RuleAlteredJobPreparer.java:84)
at
org.apache.shardingsphere.data.pipeline.scenario.rulealtered.RuleAlteredJobScheduler.run(RuleAlteredJobScheduler.java:74)
at java.lang.Thread.run(Thread.java:750)
```
### Reason analyze (If you can)
The stop event is not handled correctly and affects the next start
--
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:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]