Skip to content

Comments

*: upgrade golang to 1.25.5 (#63475)#65043

Merged
ti-chi-bot merged 6 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-63475-to-release-8.5
Dec 16, 2025
Merged

*: upgrade golang to 1.25.5 (#63475)#65043
ti-chi-bot merged 6 commits intopingcap:release-8.5from
ti-chi-bot:cherry-pick-63475-to-release-8.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #63475

What problem does this PR solve?

Security vulnerabilities

Issue Number: close #62981
Issue Number: ref #62487

  • From go 1.24.0 golang's switch its builtin map to swiss table: https://go.dev/blog/swisstable.
  • TiDB manually estimates a map's memory usage for memory control, since the implementation of map is changed, we need adopt the memory estimation for the new map.
  • CRDB uses another specified variables allocator to allocate and release memory used by a Map.
    • Such allocator is supposed to have the ability to record memory usage info.

What changed and how does it work?

Solution

  • Remove all bInMap and calculate approximate heap size dynamically
    • Capacity of swisstable is 1024(maxTableCapacity) which means the overhead of split(rehash) is quite low
    • It is difficult to simply determine the timing of each swisstable split(growthLeft == 0) when dirLen is large
  • Opportunities to recalculate size:
    • Increment of max len reaches 1024 or double len
    • Approximate size: groupSize * maxLen * 204 / 1000
      • 204: linear fitting of different kinds of map[K]V
  • Sampling statistics of heap size:
    • calculate approximate valid swisstable number & total heap size of map
  • Check abi each time then modify func checkMapABI before upgrading golang version

TODO

  • Upgrade client_golang and testify(some unit tests will break if using testify @ v1.11.1).

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Benchmark

TPC-H

ENV:

  • tidb x 1: 4c 20g
  • pd x 1, tikv x 1
  • TPC-H (sf 8)
  • set global tidb_mem_quota_query=20<<30
TPC-H (sf 8) go1.23.12 go1.25.x
Q1 6.07 6.07
Q2 1.58 1.31
Q3 2.99 2.92
Q4 1.24 1.17
Q5 4.73 4.6
Q6 2.52 2.72
Q7 3.99 3.93
Q8 2.05 1.98
Q9 8.56 8.29
Q10 2.25 2.18
Q11 1.24 1.11
Q12 4.19 4.13
Q13 4.87 4.19
Q14 3.12 2.92
Q15 5.6 5.67
Q16 1.24 1.31
Q17 12.99 13.59
Q18 14.66 15.33
Q19 6.07 6.21
Q20 3.19 3.12
Q21 5.34 5.2
Q22 1.44 1.38
SUM 99.93 99.33

TPC-C

Env:

  • tidb: 4c 2g
    • no copr-cache
  • pd x 1, tikv x 1
go1.23.12
  • warehouses: 4, threads: 100, duration: 3m
    • tpmC: 22262.8, tpmTotal: 49279.3, efficiency: 43279.1%
  • warehouses: 4, threads: 200, duration: 3m
    • tpmC: 18614.0, tpmTotal: 41521.7, efficiency: 36185.8%
    • Error 8176: kill the top-1 SQL
go1.25.x
  • warehouses: 4, threads: 100, duration: 3m
    • tpmC: 22944.3, tpmTotal: 50980.4, efficiency: 44604.0%
  • warehouses: 4, threads: 200, duration: 3m
    • tpmC: 20613.8, tpmTotal: 45561.0, efficiency: 40073.5%
    • Error 8176: kill the top-1 SQL

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot added component/dumpling This is related to Dumpling of TiDB. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Dec 15, 2025
@ti-chi-bot ti-chi-bot mentioned this pull request Dec 15, 2025
3 tasks
@ti-chi-bot
Copy link
Member Author

@solotzg This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 15, 2025

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Signed-off-by: Zhigao TONG <tongzhigao@pingcap.com>
@solotzg solotzg force-pushed the cherry-pick-63475-to-release-8.5 branch from 5a072e8 to 0e018a0 Compare December 15, 2025 13:04
@ti-chi-bot ti-chi-bot bot added the sig/planner SIG: Planner label Dec 15, 2025
Signed-off-by: Zhigao TONG <tongzhigao@pingcap.com>
@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 84.64419% with 41 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-8.5@44b12e6). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #65043   +/-   ##
================================================
  Coverage               ?   72.6272%           
================================================
  Files                  ?       1676           
  Lines                  ?     468447           
  Branches               ?          0           
================================================
  Hits                   ?     340220           
  Misses                 ?     105588           
  Partials               ?      22639           
Flag Coverage Δ
integration 49.7497% <66.6666%> (?)
unit 64.9378% <77.9026%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9278% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 55.1537% <0.0000%> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

hawkingrei and others added 3 commits December 15, 2025 22:07
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Zhigao TONG <tongzhigao@pingcap.com>
@ti-chi-bot ti-chi-bot bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Dec 15, 2025
Signed-off-by: Zhigao TONG <tongzhigao@pingcap.com>
@solotzg
Copy link
Contributor

solotzg commented Dec 16, 2025

@solotzg solotzg mentioned this pull request Dec 16, 2025
@solotzg
Copy link
Contributor

solotzg commented Dec 16, 2025

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 16, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 16, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-12-16 02:30:57.446061233 +0000 UTC m=+1526602.259838815: ☑️ agreed by windtalker.
  • 2025-12-16 02:32:46.029723492 +0000 UTC m=+1526710.843501094: ☑️ agreed by hawkingrei.

@D3Hunter
Copy link
Contributor

/approve

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, hawkingrei, lance6716, windtalker

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

The pull request process is described 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 added the approved label Dec 16, 2025
@purelind
Copy link
Contributor

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 16, 2025
@wuhuizuo
Copy link
Contributor

/test ?

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 16, 2025

@wuhuizuo: The following commands are available to trigger required jobs:

/test build
/test check-dev
/test check-dev2
/test mysql-test
/test pull-br-integration-test
/test pull-unit-test-ddlv1
/test unit-test

The following commands are available to trigger optional jobs:

/test pull-check-deps
/test pull-common-test
/test pull-e2e-test
/test pull-integration-common-test
/test pull-integration-copr-test
/test pull-integration-ddl-test
/test pull-integration-e2e-test
/test pull-integration-jdbc-test
/test pull-integration-mysql-test
/test pull-integration-nodejs-test
/test pull-integration-python-orm-test
/test pull-integration-tidb-tools-test
/test pull-lightning-integration-test
/test pull-mysql-client-test
/test pull-sqllogic-test

Use /test all to run the following jobs that were automatically triggered:

pingcap/tidb/release-8.5/pull_build
pingcap/tidb/release-8.5/pull_check
pingcap/tidb/release-8.5/pull_check2
pingcap/tidb/release-8.5/pull_mysql_test
pingcap/tidb/release-8.5/pull_unit_test
pull-check-deps
Details

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tiprow
Copy link

tiprow bot commented Dec 16, 2025

@wuhuizuo: The following commands are available to trigger required jobs:

  • /test fast_test_tiprow_for_release

Use /test all to run all jobs.

Details

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tiprow
Copy link

tiprow bot commented Dec 16, 2025

@ti-chi-bot[bot]: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow_for_release

Use /test all to run all jobs.

Details

In response to this:

@wuhuizuo: The following commands are available to trigger required jobs:

/test build
/test check-dev
/test check-dev2
/test mysql-test
/test pull-br-integration-test
/test pull-unit-test-ddlv1
/test unit-test

The following commands are available to trigger optional jobs:

/test pull-check-deps
/test pull-common-test
/test pull-e2e-test
/test pull-integration-common-test
/test pull-integration-copr-test
/test pull-integration-ddl-test
/test pull-integration-e2e-test
/test pull-integration-jdbc-test
/test pull-integration-mysql-test
/test pull-integration-nodejs-test
/test pull-integration-python-orm-test
/test pull-integration-tidb-tools-test
/test pull-lightning-integration-test
/test pull-mysql-client-test
/test pull-sqllogic-test

Use /test all to run the following jobs that were automatically triggered:

pingcap/tidb/release-8.5/pull_build
pingcap/tidb/release-8.5/pull_check
pingcap/tidb/release-8.5/pull_check2
pingcap/tidb/release-8.5/pull_mysql_test
pingcap/tidb/release-8.5/pull_unit_test
pull-check-deps

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@wuhuizuo
Copy link
Contributor

/test pull-unit-test-ddlv1

@wuhuizuo
Copy link
Contributor

/test unit-test

@tiprow
Copy link

tiprow bot commented Dec 16, 2025

@wuhuizuo: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow_for_release

Use /test all to run all jobs.

Details

In response to this:

/test pull-unit-test-ddlv1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tiprow
Copy link

tiprow bot commented Dec 16, 2025

@wuhuizuo: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow_for_release

Use /test all to run all jobs.

Details

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@wuhuizuo
Copy link
Contributor

/test mysql-test

@tiprow
Copy link

tiprow bot commented Dec 16, 2025

@wuhuizuo: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow_for_release

Use /test all to run all jobs.

Details

In response to this:

/test mysql-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@wuhuizuo wuhuizuo added the priority/P0 The issue has P0 priority. label Dec 16, 2025
@solotzg
Copy link
Contributor

solotzg commented Dec 16, 2025

/retest

@ti-chi-bot ti-chi-bot merged commit 30107c0 into pingcap:release-8.5 Dec 16, 2025
20 of 28 checks passed
@ti-chi-bot ti-chi-bot deleted the cherry-pick-63475-to-release-8.5 branch December 16, 2025 08:58
@pingcap pingcap deleted a comment from ti-chi-bot bot Dec 16, 2025
@pingcap pingcap deleted a comment from ti-chi-bot bot Dec 16, 2025
@pingcap pingcap deleted a comment from ti-chi-bot bot Dec 16, 2025
@pingcap pingcap deleted a comment from ti-chi-bot bot Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. component/dumpling This is related to Dumpling of TiDB. lgtm ok-to-test Indicates a PR is ready to be tested. priority/P0 The issue has P0 priority. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants