tikv / tikv/pd

server/cluster/cluster.go: some pub functions(tests only) are hard to maintain, make it private and use failpoint instead

Open
#4,822 1 comment 0 reactions 0 assignees View on GitHub
good first issue type/enhancement
Dominant language
Go
Stars
1.2k
Forks
783
Avg merge
5d 21h
Merged PRs (30d)
36

Description

## Enhancement Task
It seems the function `InitCluster` needn't to be public, with making it public, the caller should care about too many conditions which also makes the lib hard to maintain.
[https://github.com/tikv/pd/blob/56a015c32925022cda9c803830c058916ca02d38/server/cluster/cluster.go#L217-L228](https://github.com/tikv/pd/blob/56a015c32925022cda9c803830c058916ca02d38/server/cluster/cluster.go#L217-L228)

It seems this function need to be public because we want to use it in the tests, maybe we could use `failpoint` instead.

Meanwhile, the function `LoadClusterInfo` have the same problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.