You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "sandynz (via GitHub)" <gi...@apache.org> on 2025/10/14 08:11:23 UTC

[PR] Improve InventoryDumper query range after job restarting [shardingsphere]

sandynz opened a new pull request, #36878:
URL: https://github.com/apache/shardingsphere/pull/36878

   Related to #33996.
   
   Changes proposed in this pull request:
     - Remove InventoryDumperContext.firstDump
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   - [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   


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


Re: [PR] Improve InventoryDumper query range after job restarting [shardingsphere]

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on PR #36878:
URL: https://github.com/apache/shardingsphere/pull/36878#issuecomment-3519740305

   `InventoryDumperContext.firstDump` might cause bug.
   
   ### Test case
   
   #### Table and configuration:
   - `tableA` with 300 million records, with integer primary key id AUTO_INCREMENT. Use default `SHARDING_SIZE` 10 million, then there could be 30 records shards.
   - Use default `WORKER_THREAD` 20.
   
   #### Steps to reproduce
   1. Start migration job. (There will be 20 threads to do migration concurrently, and 10 shards tasks are queued)
   2. After job running a very short time, run `show migration status {jobId};`, make sure `processed_records_count` is greater than 0 and `inventory_finished_percentage` is less than 10%.
   3. Restart migration job.
   
   #### Reason analyze
   When job is stopped and there are still some shards tasks are queued, after job is started again, `InventoryDumperContext.firstDump` will return `false` (check on job item level, not on every shard task). When queued shards tasks running, query SQL condition will use `>`, so a shard task will skip one record, `>=` should be used at the first dump for every shard task.
   


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


Re: [PR] Improve InventoryDumper query range after job restarting [shardingsphere]

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz merged PR #36878:
URL: https://github.com/apache/shardingsphere/pull/36878


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