MarlboBlack opened a new issue, #2194:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2194

   We used Jenkins to deploy the Elastic-job-lite service with only one node. 
Almost every time the service restarts, it is found that some tasks are not 
executed when the time is up. After adding log monitoring, it is found that the 
task is actually triggered, but the current instance does not get the partition 
information, resulting in not being executed, The message in the log displays 
"Sharding item for job '{job_name}' is empty".
   
   What makes me puzzled is that I have only one instance. If there is only one 
partition, this instance must get that partition.
   
   After my troubleshooting and analysis, I found that if the service was 
restarted, the task would first execute the re-sharding logic after triggering, 
and then execute the sharding of the task on this instance. If there is only 
one instance, it means that this instance is the master node, so this is done 
in one thread, which should be no problem.
   
   The problem is that when the sharding of the current instance is obtained 
after the sharding is completed, the cache TreeCache is used first. The cache 
is synchronized by the watcher of the curator framework. If the cache has not 
been synchronized from the Zookeeper when the code is executed to obtain the 
shard of this instance, then dirty data will be obtained, which leads to this 
problem.
   
   
   My suggestion is to disable the cache by default, or explicitly update the 
cache after modifying the information on the Zookeeper. The cache must be 
consistent before subsequent operations are allowed.
   


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

Reply via email to