Borehole · Project · free tier
pingcap/tidb
Free reading: not for reliance
69d1aac · 28,771 commits · 7,834 files
Read 2026-10-22

pingcap/tidb: technical due diligence, read from its repository

What Borehole read in pingcap/tidb's code and history at 69d1aac: its licence, security advisories, releases, review practice, tests, dependencies and operations. Every finding cites the file and line it rests on. The full report also covers the team and asks the questions the code cannot answer.

DimensionRating
Architecture & Codebase — including AI provenancestrong
Engineering Process & SDLC Maturitystrong
Product & Engineering Maturityadequate
Security & Reliability Postureadequate
Observability & Operationsstrong
Fit with the Acquirernot assessable

What the repository says

  • Releases are cut from another branch than the one surveyed
  • .gitmodules:1: 1 submodule(s) this survey does not read: pkg/extension/enterprise

Architecture & Codebase — including AI provenance

strong
01.6

pkg/parser/parser.y is 18,530 lines, 125× this codebase's median file

adequate

The median source file here is 148 lines. 124 files exceed 1,480 lines, the largest being 18,530. Size is not a defect on its own — some problems genuinely live in one place — but these are where merge conflicts, review fatigue and single-owner knowledge concentrate, and they are the first thing that slows an inheriting engineer down.

Evidence
pkg/parser/parser.y:1 — 18,530 lines (125× median)
pkg/ddl/executor.go:1 — 8,425 lines (56× median)
pkg/planner/core/logical_plan_builder.go:1 — 8,127 lines (54× median)
pkg/expression/builtin_time.go:1 — 7,268 lines (49× median)
pkg/planner/core/planbuilder.go:1 — 6,787 lines (45× median)

Engineering Process & SDLC Maturity

strong

No finding.

Product & Engineering Maturity

adequate
04.3

162 direct dependencies in a single manifest

adequate

go.mod declares 162 direct dependencies. Each one is a maintenance obligation, a supply-chain surface and a potential licence question that transfers with the asset. The count says nothing about whether any given dependency was a good choice; it says how many such choices a buyer inherits.

Evidence
go.mod — 162 declared
pkg/parser/go.mod — 14 declared
04.17

Go 1.25 is past end of life

adequate

The code is pinned to Go 1.25 (end of life 2026-08-11). None of these receives security fixes any more; the first stopped on 2026-08-11. Moving off an unsupported runtime is rarely a one-line change, so a buyer should ask whether the upgrade is planned and what it touches.

Evidence
Dockerfile — Go 1.25, end of life 2026-08-11
04.38

6 files still carry code deprecated more than two years ago

adequate

6 files were marked deprecated over two years ago and still are, the oldest since Jan 2024. A deprecation is a promise to remove. Ask what still depends on these, and whether removing them is scheduled.

Evidence
pkg/config/config.go — deprecated since Jan 2024
pkg/expression/simple_rewriter.go — deprecated since Feb 2024
pkg/util/context/warn.go — deprecated since May 2024
pkg/types/json_binary.go — deprecated since May 2024
pkg/util/hint/hint.go — deprecated since Jul 2024
04.62

Releases are cut from another branch than the one surveyed

adequate

The newest release, v26.3.21, is not on the branch this survey read; the newest release on it is v1.0.0. The shipped product may differ from what this report describes. Survey the release branch too.

Evidence
tag v26.3.21

Security & Reliability Posture

adequate
05.6

2 Dockerfiles run the application as root

adequate

No USER instruction switches away from root, so the process runs with full privileges inside the container. It is a one-line fix and an ordinary expectation, which is why its absence is worth asking about: it usually says more about whether anyone has reviewed the deployment than about this container specifically.

Evidence
Dockerfile — runs as root
br/docker/Dockerfile — runs as root
05.13

8 outbound calls can wait forever

adequate

8 HTTP calls use a client with no timeout (Python `requests` without `timeout=`, or Go's default client). When a dependency slows down, each one holds a worker until the connection gives up, and enough of them take the service down with the dependency.

Evidence
cmd/benchkv/main.go:129 — outbound call without a timeout
pkg/lightning/common/security.go:64 — outbound call without a timeout
pkg/server/internal/testserverclient/server_client.go:100 — outbound call without a timeout
05.20

50 SQL statements built from strings

adequate

50 places in product code build SQL by formatting or joining strings rather than passing parameters. 4 of them put a value into the string; in the rest, what the code shows going in is a table or column name, a constant, or something the line does not show. Ask whether any value reaches these strings, rather than a parameter.

Evidence
pkg/bindinfo/utils.go:269 — SQL built from a string
pkg/ddl/job_scheduler.go:846 — SQL built from a string
pkg/statistics/handle/storage/table_size_stats.go:127 — SQL built from a string
05.26

6 locked dependencies have published vulnerabilities, 3 high or critical in what ships

adequate

6 of 363 locked dependencies match 13 published advisories in OSV, 3 of them rated high or critical. A lockfile says which version is installed, not whether the flawed code is reachable from this product, so each needs a look. Most are fixed by an upgrade, and the advisory names the version. This lockfile pins development tools alongside what ships and does not say which is which, so some of these may never reach a user.

Evidence
go.mod — github.com/prometheus/prometheus v0.50.1: GHSA-8rm2-7qqf-34qm (high), fixed in 0.311.3
go.mod — go.etcd.io/etcd/client/pkg/v3 v3.5.15: GO-2026-6107 (high), fixed in 3.5.33
go.mod — go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0: GHSA-8wmf-6v46-5gfg (low), fixed in 1.45.0

Observability & Operations

strong
06.9

No error reporter is wired in

adequate

Nothing in the service initialises an error reporter (Sentry, Rollbar, Bugsnag, Honeybadger or an APM agent). An exception in production reaches a person only if someone is reading the logs, which usually means a customer reports it first.

Evidence
no error reporter initialised
06.18

3 of 7 deployed images carry no version, or `latest`

adequate

3 images in the deployment configuration are named without a version or as `latest`. A redeploy can change the software without a commit, a rollback has nothing to roll back to, and nobody can say from the repository what is running.

Evidence
br/docker-compose.yaml:203 — image without a version
br/docker-compose.yaml:213 — image without a version
br/docker-compose.yaml:222 — image without a version

Fit with the Acquirer

not assessable

Not rated: structurally not assessable from a repository.

Read more, or read your own

The full report on pingcap/tidb: every dimension, the questions for the room, and the audit log.

Survey a repository: free on public repositories. Private code is read on your own machine by a collector whose source you can read first.