Failed to deploy to the cluster after modifying and compiling the PD source code

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 修改pd源码编译之后,部署到集群失败

| username: TiDBer_eEiwvfN0

[TiDB Usage Environment] Production Environment
[TiDB Version] v5.3.0
[Reproduction Path] I would like to ask for some advice. I want to modify the PD source code to add a log (for example) and then update it to the already deployed cluster. The current approach is:

  1. git clone the source code
  2. Switch to the v5.3.0 branch: git checkout origin/release-5.3
  3. Modify the source code
  4. Compile: make build
    The binary file pd-server generated this way will report an error when replacing the PD in the cluster using tiup, because the version injected during compilation is incorrect. Is there any documentation on this?
| username: yytest | Original post link

Try upgrading the version.

| username: zhaokede | Original post link

Download the official version; there’s really no need to compile it yourself. Just upgrade the version.

| username: 有猫万事足 | Original post link

Please provide detailed error information.

| username: TiDBer_eEiwvfN0 | Original post link

We plan to modify the PD source code to suit our business needs, so we have to compile it manually.

| username: TiDBer_eEiwvfN0 | Original post link

I think it’s because the binary version produced by make build is incorrect, and the service fails the version check.

| username: tidb狂热爱好者 | Original post link

When compiling, replace all components. Don’t just replace PD.

| username: xfworld | Original post link

There must be a verification rule for the version number. Check according to the packaging rules.

Take a good look at this: pd/Makefile at master · tikv/pd · GitHub

If it doesn’t work, replace it according to the original rules. At least the packaged version must be the same.