Skip to content

fix(pipelines): reserve memory for TiDB ghpr build - #5069

Open
wuhuizuo wants to merge 1 commit into
mainfrom
flare-agent/fix-tidb-ghpr-build-memory
Open

fix(pipelines): reserve memory for TiDB ghpr build#5069
wuhuizuo wants to merge 1 commit into
mainfrom
flare-agent/fix-tidb-ghpr-build-memory

Conversation

@wuhuizuo

@wuhuizuo wuhuizuo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • increase the TiDB ghpr_build memory request from 16Gi to 32Gi
  • keep the existing 64Gi memory limit and Bazel concurrency unchanged

Root cause

Jenkins staging build #12 was evicted by kubelet during make bazel_build because the node was under memory pressure. The golang container was using 23,219,056Ki, above its 16Gi request. Reserving 32Gi covers the observed usage and aligns this build with the existing pull_build_next_gen template.

Failed build: https://do.pingcap.net/jenkins-staging/job/pingcap/job/tidb/job/ghpr_build/12/

Tests

  • CRANE_BIN=disabled sh .ci/verify-k8s-pod-yaml.sh pipelines/pingcap/tidb/latest/ghpr_build/pod.yaml
  • bash .ci/verify-storage-class-policy.sh
  • git diff --check

A Jenkins replay will be tracked in a PR comment.

@ti-chi-bot

ti-chi-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wuhuizuo for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have already done a preliminary review for you, and I hope to help you do a better job.

Summary
This PR increases the memory request for the TiDB ghpr_build Jenkins pod from 16Gi to 32Gi to prevent eviction due to node memory pressure, while keeping the memory limit and Bazel concurrency unchanged. The change is minimal and focused, addressing a real stability issue identified from a failed build. Overall, the approach is straightforward and appropriate for the problem described.


Code Improvements

  • File: pipelines/pingcap/tidb/latest/ghpr_build/pod.yaml (line 14)
    • The increase from 16Gi to 32Gi for the memory request is a direct fix addressing memory eviction issues. However, consider also adding a short comment above the resource block explaining the reason for this higher memory request, so future maintainers understand the rationale without looking up the PR. For example:
      # Increased memory request to 32Gi to prevent eviction during build (see PR #XYZ)
      resources:
        requests:
          cpu: "2"
          memory: 32Gi
    • This small addition improves maintainability and knowledge sharing.

Best Practices

  • Testing coverage:

    • The PR description mentions running .ci/verify-k8s-pod-yaml.sh and other scripts, which is good to validate YAML correctness and policy compliance. However, consider adding a note or automated check to monitor actual pod memory usage over time to proactively catch resource request mismatches.
  • Documentation:

    • Add a reference or link to the Jenkins build logs (already partially included in the description) inside the pod.yaml as a comment, so it's easier to trace why this change was made.

No critical issues identified given the scope and nature of the change. The patch is minimal and suitable for the problem described.

@ti-chi-bot ti-chi-bot Bot added the size/XS label Sep 1, 2026
@wuhuizuo

wuhuizuo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Jenkins Replay Status

  • pipelines/pingcap/tidb/latest/ghpr_build/pipeline.groovy -> pingcap/tidb/ghpr_build
    • status: skipped
    • source selector: lastSuccessfulBuild on Jenkins staging
    • pod template: local PR YAML inlining verified by dry-run
    • note: authenticated replay could not be submitted because JENKINS_USER and JENKINS_TOKEN are not present in the repo .env

PR validation: pre-commit, Pod YAML, PR content policy, secret scan, and storage class policy all passed.

Summary: 0 success, 0 failure, 1 skipped.

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant