server: deduplicate merged PD endpoints before upstream store init
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in the new-architecture server.prepare() path and trace how --pd values are combined with CollectMemberEndpoints() before upstream store initialization. Add focused unit tests for merging endpoints, verifying that first-occurrence order is preserved and duplicates are removed. Done means the downstream endpoint list contains each endpoint once.
Written by the indexing model from the issue text.
Description
Background
In the new architecture startup path, TiCDC seeds PD endpoints from the --pd CLI flag and then appends all PD member client URLs returned by CollectMemberEndpoints().
When the CLI already provides the full PD member list, the merged endpoint slice becomes duplicated, for example:
http://pd1:2379,http://pd2:2379,http://pd3:2379
-> append discovered members
http://pd1:2379,http://pd2:2379,http://pd3:2379,http://pd1:2379,http://pd2:2379,http://pd3:2379
That duplicated list is later converted into a tikv://host1:port,host2:port,... URI during upstream store initialization.
Problem
TiCDC currently appends discovered PD member endpoints without deduplication in server.prepare(). This makes the final endpoint list unstable and unnecessarily repeated during startup.
Expected behavior
The merged PD endpoint list should be deduplicated while preserving the original order of the first occurrence.
Suggested fix
Add a small helper in the new-arch server startup path to merge and deduplicate PD endpoints before the list is used by downstream initialization code.
Scope
- Minimal behavior change
- Preserve endpoint order
- Add focused unit tests for the merge behavior
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pingcap/ticdc
-
type/feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
contribution type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
component/test severity/minor type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·