-
Notifications
You must be signed in to change notification settings - Fork 201
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
feat: 优化分库分表迁移过程中,task_instance_id 动态查询条件构造逻辑 #3324 #3327
Conversation
wangyu096
commented
Dec 12, 2024
- 修复 AppResourceScopeInterceptor 未处理内部请求的问题; 改造之后,对于 /service 开头的内部请求,同样也会解析 AppResourceScope 到上下文中 (AppResourceScopeInterceptor.java)
- 修复使用线程池导致 JobExecuteContext 上下文丢失的问题(ContextExecutorService.java)
- 修复 API Path 不规范的问题(/service/stepInstance/appIds/{appId}/stepInstanceIds/{stepInstanceId})
- 修复微服务重启之后,JobExecuteContext 上下文丢失的问题 ( ResultHandlerManage.StopTask.java)
- 优化 task_instance_id dao 查询条件构造逻辑。原先的逻辑,如果 JobExecuteContext 或者 JobExecuteContext.getAppResourceScope 不存在,会直接使用 DSL.trueCondition(),忽略了 taskInstanceId条件。但是在这个场景下逻辑是错误的,因为上下文信息并非是必须的,有些场景下并没上下文,所以这时候需要判断 job.features.daoAddTaskInstanceId.enabled 即可(TaskInstanceIdDynamicCondition.java)。直接使用 DSL.trueCondition 会导致一直忽略 taskInstanceId 查询条件
- 优化日志,便于后续观察和定位问题
@@ -41,7 +41,7 @@ | |||
@SmartFeignClient(value = "job-execute", contextId = "stepInstanceResource") | |||
@InternalAPI | |||
public interface ServiceStepInstanceResource { | |||
@GetMapping("/service/stepInstance/appIds/{appId}/stepInstanceIds/{stepInstanceId}") | |||
@GetMapping("/service/stepInstance/app/{appId}/stepInstanceId/{stepInstanceId}") | |||
InternalResponse<ServiceStepInstanceDTO> getStepInstance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个接口是不是也需要增加taskInstanceId参数,用于命中分库分表逻辑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
WebSearchToolsResource中的两个接口未命中分库分表逻辑,需要确认下走全分片查询是否可行 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2个问题需要看下。
已沟通,后续上线之后观察。理论上即使走全分片查询也能很快完成,因为在每个分片上都能命中索引 |