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:41:05 UTC

[GitHub] [shardingsphere] TeslaCN opened a new issue, #17773: Supports scaling table without primary key but with unique index on non-null column

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

   ## Feature Request
   
   ### Is your feature request related to a problem?
   
   Table without primary key but with unique index on a non-null column cannot be scaled by ShardingSphere-Scaling.
   
   ```
   mysql> show create table bmsql_item;
   +------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Table      | Create Table                                                                                                                                                                                                                                                                                                                                                   |
   +------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | bmsql_item | CREATE TABLE `bmsql_item` (
     `i_id` int NOT NULL,
     `i_name` varchar(24) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
     `i_price` decimal(5,2) DEFAULT NULL,
     `i_data` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
     `i_im_id` int DEFAULT NULL,
     UNIQUE KEY `unique_i_id` (`i_id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
   +------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   1 row in set (0.00 sec)
   
   ```
   
   ```
   [ERROR] 2022-05-18 13:56:28.801 [elasticjob-0130317c30317c3054317c626d73716c5f7368617264696e67-2] o.a.s.d.p.s.r.RuleAlteredJob - job prepare failed, 0130317c30317c3054317c626d73716c5f7368617264696e67-1
   org.apache.shardingsphere.data.pipeline.core.exception.PipelineJobCreationException: Can not split range for table bmsql_item_1, reason: no primary key
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.prepare.InventoryTaskSplitter.checkPrimaryKey(InventoryTaskSplitter.java:169)
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.prepare.InventoryTaskSplitter.getInventoryPositions(InventoryTaskSplitter.java:149)
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.prepare.InventoryTaskSplitter.splitByPrimaryKey(InventoryTaskSplitter.java:113)
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.prepare.InventoryTaskSplitter.splitDumperConfig(InventoryTaskSplitter.java:88)
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.prepare.InventoryTaskSplitter.splitInventoryData(InventoryTaskSplitter.java:77)
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.RuleAlteredJobPreparer.initInventoryTasks(RuleAlteredJobPreparer.java:160)
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.RuleAlteredJobPreparer.prepare(RuleAlteredJobPreparer.java:85)
           at org.apache.shardingsphere.data.pipeline.scenario.rulealtered.RuleAlteredJob.execute(RuleAlteredJob.java:50)
           at org.apache.shardingsphere.elasticjob.simple.executor.SimpleJobExecutor.process(SimpleJobExecutor.java:33)
           at org.apache.shardingsphere.elasticjob.simple.executor.SimpleJobExecutor.process(SimpleJobExecutor.java:29)
           at org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor.process(ElasticJobExecutor.java:172)
           at org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor.lambda$process$0(ElasticJobExecutor.java:153)
           at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
           at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
           at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
           at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
           at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
           at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
           at java.base/java.lang.Thread.run(Thread.java:833)
   ```
   
   ### Describe the feature you would like.
   
   Supports scaling table without primary key but with unique index on non-null column.


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


[GitHub] [shardingsphere] github-actions[bot] commented on issue #17773: Supports scaling table without primary key but with unique index on non-null column

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

   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 #17773: Supports scaling table without primary key but with unique index on non-null column

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #17773: Supports scaling table without primary key but with unique index on non-null column
URL: https://github.com/apache/shardingsphere/issues/17773


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