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/06 07:00:38 UTC
[GitHub] [shardingsphere-elasticjob] MarlboBlack opened a new issue, #2190: 单节点部署出现Sharding item for job '' is empty.
MarlboBlack opened a new issue, #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190
我们使用Elastic-job只部署了1个节点,使用Jenkins部署。几乎每天都会发现有一些任务未执行,添加上日志监控之后发现任务其实是触发了,但是job_status_trace_log中的message显示Sharding item for job '{job_name}' is empty。我知道当实例数大于分片数的时候有一些实例获取不到分片就会打印这个信息,但是我们是单节点部署的,且分片默认为1。这个问题我们目前还不知道如何分析解决。
--
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] songxiaosheng commented on issue #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463580814
Why there is no sharding information "sharding item for job"? There may be the following situations:
You can refer to the following code:
jobFacade.getShardingContexts();
```
public ShardingContexts getShardingContexts() {
boolean isFailover = configService.load(true).isFailover();
if (isFailover) {
List<Integer> failoverShardingItems = failoverService.getLocalFailoverItems();
if (!failoverShardingItems.isEmpty()) {
return executionContextService.getJobShardingContext(failoverShardingItems);
}
}
shardingService.shardingIfNecessary();
List<Integer> shardingItems = shardingService.getLocalShardingItems();
if (isFailover) {
shardingItems.removeAll(failoverService.getLocalTakeOffItems());
}
shardingItems.removeAll(executionService.getDisabledItems(shardingItems));
return executionContextService.getJobShardingContext(shardingItems);
}
```
--
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] songxiaosheng commented on issue #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463566595
>
yes it's me
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463582914
是的,我就是认为这一步出了问题
List<Integer> shardingItems = shardingService.getLocalShardingItems();
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463539828
> Which version do you use
I don't know if this is you
https://blog.csdn.net/songjunyan/article/details/125360044
--
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 closed issue #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack closed issue #2190: 单节点部署出现Sharding item for job '' is empty.
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190
--
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] songxiaosheng commented on issue #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463591169
> > Why there is no sharding information "sharding item for job"? There may be the following situations: You can refer to the following code: jobFacade.getShardingContexts();
> > ```
> > public ShardingContexts getShardingContexts() {
> > boolean isFailover = configService.load(true).isFailover();
> > if (isFailover) {
> > List<Integer> failoverShardingItems = failoverService.getLocalFailoverItems();
> > if (!failoverShardingItems.isEmpty()) {
> > return executionContextService.getJobShardingContext(failoverShardingItems);
> > }
> > }
> > shardingService.shardingIfNecessary();
> > List<Integer> shardingItems = shardingService.getLocalShardingItems();
> > if (isFailover) {
> > shardingItems.removeAll(failoverService.getLocalTakeOffItems());
> > }
> > shardingItems.removeAll(executionService.getDisabledItems(shardingItems));
> > return executionContextService.getJobShardingContext(shardingItems);
> > }
> > ```
>
> 因为进去发现是从缓存中获取,按照我的理解,这个缓存是通过Listener监听刷新的,那就有可能刚分片完,还没有刷新缓存的时候代码就执行到这里了,所以获取的是错误的缓存数据,导致sharding/0/instanceId和当前实例不同
do you find the log "sharding begin." , Two methods of shardingIfNecessary method and getShardingContexts are in single thread
--
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] songxiaosheng commented on issue #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463587105
> 是的,我就是认为这一步出了问题 List shardingItems = shardingService.getLocalShardingItems();
your can search the 《中间件源码》in WeChat find me ,then leave you wechat id to me
--
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] songxiaosheng commented on issue #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "songxiaosheng (via GitHub)" <gi...@apache.org>.
songxiaosheng commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463306008
Which version do you use
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463533895
> Which version do you use
In addition, I think it is caused by re-sharing, and then the local cache listening update is later than this method to obtain the sharding node
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463530893
just version 2.1.5,I suspect that the problem is caused by the cache of CuratorFramework.see this methd:
com.dangdang.ddframe.job.lite.internal.sharding.ShardingService#getShardingItems
Because I have analyzed the Zookeeper node information,it works normally,and my service did not restart ,so it must have never been disconnected,this eliminates the interference of old service.
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463574979
> >
>
> yes it's me
Can you add a WeChat chat,give me your WeChat
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463531305
> Which version do you use
just version 2.1.5,I suspect that the problem is caused by the cache of CuratorFramework.see this methd:
com.dangdang.ddframe.job.lite.internal.sharding.ShardingService#getShardingItems
Because I have analyzed the Zookeeper node information,it works normally,and my service did not restart ,so it must have never been disconnected,this eliminates the interference of old service.
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "MarlboBlack (via GitHub)" <gi...@apache.org>.
MarlboBlack commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1463586074
> Why there is no sharding information "sharding item for job"? There may be the following situations: You can refer to the following code: jobFacade.getShardingContexts();
>
> ```
> public ShardingContexts getShardingContexts() {
> boolean isFailover = configService.load(true).isFailover();
> if (isFailover) {
> List<Integer> failoverShardingItems = failoverService.getLocalFailoverItems();
> if (!failoverShardingItems.isEmpty()) {
> return executionContextService.getJobShardingContext(failoverShardingItems);
> }
> }
> shardingService.shardingIfNecessary();
> List<Integer> shardingItems = shardingService.getLocalShardingItems();
> if (isFailover) {
> shardingItems.removeAll(failoverService.getLocalTakeOffItems());
> }
> shardingItems.removeAll(executionService.getDisabledItems(shardingItems));
> return executionContextService.getJobShardingContext(shardingItems);
> }
> ```
因为进去发现是从缓存中获取,按照我的理解,这个缓存是通过Listener监听刷新的,那就有可能刚分片完,还没有刷新缓存的时候代码就执行到这里了,所以获取的是错误的缓存数据,导致sharding/0/instanceId和当前实例不同
--
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 #2190: 单节点部署出现Sharding item for job '' is empty.
Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN commented on issue #2190:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2190#issuecomment-1457325753
Please report issue according to the template.
--
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