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/26 11:27:53 UTC

[GitHub] [shardingsphere] sandynz commented on pull request #21774: Improve migration job stopping

sandynz commented on PR #21774:
URL: https://github.com/apache/shardingsphere/pull/21774#issuecomment-1291888741

   Test steps:
   
   1, Start a migration job on sbtest1 table, with 140 millions records, the migration might cost more than 10 minutes on local machine.
   
   2, Stop underlying MySQL server.
   
   3, Verify migration job is stopped, `active` is false, and `error_message` is not blank in migration status DistSQL result.
   
   Example result:
   ```
   mysql> show migration list;
   +---------------------------------------+---------+----------------------+--------+---------------------+---------------------+
   | id                                    | tables  | sharding_total_count | active | create_time         | stop_time           |
   +---------------------------------------+---------+----------------------+--------+---------------------+---------------------+
   | j0101270cbb6714cff0d7d13db9fa23c7c0a1 | sbtest1 | 1                    | false  | 2022-10-26 18:33:19 | 2022-10-26 19:09:08 |
   +---------------------------------------+---------+----------------------+--------+---------------------+---------------------+
   1 row in set (0.29 sec)
   
   mysql> show migration status 'j0101270cbb6714cff0d7d13db9fa23c7c0a1';
   +------+-------------+--------------------------------+--------+-------------------------+-------------------------------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----------------------------------------------------------------------------------------------------------------+
   | item | data_source | status                         | active | processed_records_count | inventory_finished_percentage | incremental_idle_seconds | error_message                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                     |
   +------+-------------+--------------------------------+--------+-------------------------+-------------------------------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----------------------------------------------------------------------------------------------------------------+
   | 0    | mysql_ds_0  | EXECUTE_INVENTORY_TASK_FAILURE | false  | 39248000                | 0                             | 0                        | java.util.concurrent.CompletionException: org.apache.shardingsphere.data.pipeline.core.ingest.exception.IngestException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Server shutdown in progress
   	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
   	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
   	at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1643)
   	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   Caused by: org.apache.shardingsphere.data.pipeline.core.ingest.exception.IngestException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Server shutdown in progress
   	at org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumper.runBlocking(InventoryDumper.java:116)
   	at org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.start(AbstractLifecycleExecutor.java:53)
   	at org.apache.shardingsphere.data.pipeline.api.executor.AbstractLifecycleExecutor.run(AbstractLifecycleExecutor.java:91)
   	at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1640)
   	... 4 more
   Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Server shutdown in progress
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.Util.getInstance(Util.java:408)
   	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
   	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
   	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
   	at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1288)
   	at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:788)
   	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011)
   	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
   	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
   	at org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumper.dump(InventoryDumper.java:142)
   	at org.apache.shardingsphere.data.pipeline.core.ingest.dumper.InventoryDumper.runBlocking(InventoryDumper.java:106)
   	... 7 more
    |
   +------+-------------+--------------------------------+--------+-------------------------+-------------------------------+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----------------------------------------------------------------------------------------------------------------+
   1 row in set (0.02 sec)
   ```
   
   And also verify pipeline threads quit.
   


-- 
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