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

feat: 优化分库分表迁移过程中,task_instance_id 动态查询条件构造逻辑 #3324 #3327

Merged
merged 9 commits into from
Dec 12, 2024

Conversation

wangyu096
Copy link
Collaborator

  1. 修复 AppResourceScopeInterceptor 未处理内部请求的问题; 改造之后,对于 /service 开头的内部请求,同样也会解析 AppResourceScope 到上下文中 (AppResourceScopeInterceptor.java)
  2. 修复使用线程池导致 JobExecuteContext 上下文丢失的问题(ContextExecutorService.java)
  3. 修复 API Path 不规范的问题(/service/stepInstance/appIds/{appId}/stepInstanceIds/{stepInstanceId})
  4. 修复微服务重启之后,JobExecuteContext 上下文丢失的问题 ( ResultHandlerManage.StopTask.java)
  5. 优化 task_instance_id dao 查询条件构造逻辑。原先的逻辑,如果 JobExecuteContext 或者 JobExecuteContext.getAppResourceScope 不存在,会直接使用 DSL.trueCondition(),忽略了 taskInstanceId条件。但是在这个场景下逻辑是错误的,因为上下文信息并非是必须的,有些场景下并没上下文,所以这时候需要判断 job.features.daoAddTaskInstanceId.enabled 即可(TaskInstanceIdDynamicCondition.java)。直接使用 DSL.trueCondition 会导致一直忽略 taskInstanceId 查询条件
  6. 优化日志,便于后续观察和定位问题

@@ -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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个接口是不是也需要增加taskInstanceId参数,用于命中分库分表逻辑

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@jsonwan
Copy link
Collaborator

jsonwan commented Dec 12, 2024

WebSearchToolsResource中的两个接口未命中分库分表逻辑,需要确认下走全分片查询是否可行

Copy link
Collaborator

@jsonwan jsonwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2个问题需要看下。

@wangyu096
Copy link
Collaborator Author

WebSearchToolsResource中的两个接口未命中分库分表逻辑,需要确认下走全分片查询是否可行

已沟通,后续上线之后观察。理论上即使走全分片查询也能很快完成,因为在每个分片上都能命中索引

@wangyu096 wangyu096 merged commit f893700 into TencentBlueKing:master Dec 12, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants