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.
| Dimension | Rating |
|---|---|
| Architecture & Codebase — including AI provenance | strong |
| Engineering Process & SDLC Maturity | strong |
| Product & Engineering Maturity | adequate |
| Security & Reliability Posture | adequate |
| Observability & Operations | strong |
| Fit with the Acquirer | not 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
strongpkg/parser/parser.y is 18,530 lines, 125× this codebase's median file
adequateThe 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.
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
strongNo finding.
Product & Engineering Maturity
adequate162 direct dependencies in a single manifest
adequatego.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.
go.mod — 162 declared |
pkg/parser/go.mod — 14 declared |
Go 1.25 is past end of life
adequateThe 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.
Dockerfile — Go 1.25, end of life 2026-08-11 |
6 files still carry code deprecated more than two years ago
adequate6 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.
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 |
Releases are cut from another branch than the one surveyed
adequateThe 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.
| tag v26.3.21 |
Security & Reliability Posture
adequate2 Dockerfiles run the application as root
adequateNo 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.
Dockerfile — runs as root |
br/docker/Dockerfile — runs as root |
8 outbound calls can wait forever
adequate8 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.
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 |
50 SQL statements built from strings
adequate50 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.
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 |
6 locked dependencies have published vulnerabilities, 3 high or critical in what ships
adequate6 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.
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
strongNo error reporter is wired in
adequateNothing 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.
| no error reporter initialised |
3 of 7 deployed images carry no version, or `latest`
adequate3 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.
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 assessableNot 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.