Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The shards which assigned to non-leader instances may not be executed in specific scenario #1471

Closed
TeslaCN opened this issue Sep 19, 2020 · 2 comments · Fixed by #1472
Closed
Assignees
Milestone

Comments

@TeslaCN
Copy link
Member

TeslaCN commented Sep 19, 2020

Bug Report

This problem can be reproduced in specific scenario.

Which version of ElasticJob did you use?

3.0.0-beta-SNAPSHOT

Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?

ElasticJob-Lite

Expected behavior

Actual behavior

  1. Leader instance has already finished sharding and started executing shards assigned to it.
  2. Non-leader instance's listener set resharding necessary flag before it start executing LiteJob#execute().
  3. So the Non-leader instances keep waiting for sharding completed.

Reason analyze (If you can)

image

Example codes for reproduce this issue (such as a github link).

https://github.com/TeslaCN/shardingsphere-elasticjob-lite/tree/reproduce-blocking/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/bug

Steps to reproduce the behavior.

Check out my branch and configure zookeeper. Main class is org.apache.shardingsphere.elasticjob.lite.example.bug.ReproduceMain

  1. Start a process "A" and wait it schedule job.
  2. After process "A" completed schedule, start a new process "B".
@TeslaCN
Copy link
Member Author

TeslaCN commented Sep 20, 2020

I have analyzed logs and draw a graph.

@TeslaCN
Copy link
Member Author

TeslaCN commented Sep 20, 2020

I recorded the process of troubleshooting on my blog.
https://blog.csdn.net/wu_weijie/article/details/108678606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants