You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "MarlboBlack (via GitHub)" <gi...@apache.org> on 2023/03/12 11:11:09 UTC

[GitHub] [shardingsphere-elasticjob] MarlboBlack opened a new issue, #2195: Caching dirty data causes the task not to be executed, resulting in the "Sharding item for job '{job_name}' is empty"

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

   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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-elasticjob] MarlboBlack commented on issue #2195: Caching dirty data causes the task not to be executed, resulting in the "Sharding item for job '{job_name}' is empty"

Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2195:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2195#issuecomment-1474596167

   How to disable the cache,just like this:
   `registryCenter.evictCacheData("/"+jobName); `  after  ` jobScheduler.init();`
   


-- 
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-elasticjob] MarlboBlack commented on issue #2195: Caching dirty data causes the task not to be executed, resulting in the "Sharding item for job '{job_name}' is empty"

Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2195:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2195#issuecomment-1474592546

   Currently, I have two solutions to solve this problem: first, disable caching,and second, remove the local sharding node cache before sharding. After sharding, force to obtain the latest sharding information from Zookeeper.


-- 
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-elasticjob] TeslaCN commented on issue #2195: Caching dirty data causes the task not to be executed, resulting in the "Sharding item for job '{job_name}' is empty"

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN commented on issue #2195:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2195#issuecomment-1477640288

   Thanks for your feedback. I'll investigate this issue.


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