Skip to content

topsql_v2: add nextgen coprocessor worker discovery#92

Open
yibin87 wants to merge 2 commits intotidbcloud:0.49from
yibin87:topsql-v2-coprocessor-worker
Open

topsql_v2: add nextgen coprocessor worker discovery#92
yibin87 wants to merge 2 commits intotidbcloud:0.49from
yibin87:topsql-v2-coprocessor-worker

Conversation

@yibin87
Copy link
Copy Markdown
Collaborator

@yibin87 yibin87 commented Apr 23, 2026

Summary

  • extend nextgen TiKV topology discovery to also find coprocessor worker pods
  • map coprocessor worker pods onto the existing TiKV TopSQL source startup path using the worker gRPC pubsub port
  • add focused unit tests for selector generation and pod-to-component mapping

Testing

  • not run locally; cargo test tikv_nextgen --lib --offline failed because the workspace is missing cached dependency borsh v1.6.0

@pingcap-cla-assistant
Copy link
Copy Markdown

pingcap-cla-assistant Bot commented Apr 23, 2026

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot Bot added the size/L label Apr 23, 2026
const K8S_INSTANCE_LABEL: &str = "app.kubernetes.io/instance";

const TIKV_COMPONENT: &str = "tikv";
const COPROCESSOR_WORKER_COMPONENT: &str = "coprocessor-worker";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

TIDB worker不用加吗?除了process worker还有一个tikv worker吧?也不用管?


const TIKV_GRPC_PORT: u16 = 20160;
const TIKV_STATUS_PORT: u16 = 20180;
const COPROCESSOR_WORKER_GRPC_PORT: u16 = 9500;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

为什么要固定呢?有个promethus port的label可以访问吧


fn build_label_selector(label_k8s_instance: &str) -> String {
let component_values = std::iter::once(TIKV_COMPONENT)
.chain(std::iter::once(COPROCESSOR_WORKER_COMPONENT))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

最好能增加一个可配置的label,这样以后如果有新形态或者名字变化也不用升级vector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants