Repository navigation
Conversation
`ti fs --region azure-centralus ...` failed local region validation even though the Azure Central US Filesystem deployment is available. Add the azure provider and its built-in Filesystem endpoint, and keep the Azure placement out of TiDB Cloud Starter placement validation. `region.supported` is shared by DB and Filesystem resolution, so adding azure there would also let `ti db` commands accept `azure-centralus` and send `regions/azure-centralus` to the Starter API, which the product documentation does not list as a Starter placement. Instead, mark the placement as Filesystem-only: `region.Validate` (Starter) rejects it with an explicit error, while the new `region.ValidateFilesystem` accepts it for Filesystem endpoint resolution. `ParsePlacementCode` and `CanonicalCode` keep accepting every known placement so `--region`, `ti configure`, and stored credentials still work. - internal/config/region: add `ProviderAzure`, the azure-centralus placement, and the `filesystemOnly` marker plus `ValidateFilesystem`. - internal/api/endpoints: resolve Filesystem endpoints through `ValidateFilesystem` and add the built-in azure-centralus mapping (`https://azure-centralus.drive9.ai`). - telemetry: accept the azure provider and azure-centralus region code in the CLI normalizer and the backend validator. - README, docs/priciples.md, AGENTS.md, telemetry backend design, and both installers document the new Filesystem region and the Filesystem-only rule. - Regression coverage: placement validation, built-in endpoint routing, Starter rejection at the CLI and binary boundary, stored credentials under an AWS-default profile, token-only companion routing, and telemetry acceptance. `gcp-us-east1` keeps its current behavior in this change; aligning it with the same Filesystem-only model is a separate decision.
There was a problem hiding this comment.
🔵 Needs a closer look
It alters core placement-validation semantics shared by ti db and ti fs and is an explicitly conflicting alternative to #76 where only one approach should merge, which is a human design decision.
0 open findings
What changed in this PR
This PR adds azure-centralus as a Filesystem-only placement. It is explicitly an alternative to #76: rather than adding Azure to the shared placement table (which would also make ti db accept it and send an unsupported region to the Starter API), it introduces a filesystemOnly marker so that ti fs accepts the placement while ti db rejects it locally with an explicit message. The change fits cleanly into the centralized internal/config/region placement model and the built-in Filesystem endpoint mapping, and it is threaded through telemetry (CLI + backend), docs, and installers.
Changes:
- Split region validation into
Validate(Starter, rejects filesystem-only placements) andValidateFilesystem(accepts them), withParsePlacementCode/CanonicalCodenow using a sharedvalidatePlacementso--region,ti configure, profiles, and stored credentials accept every known placement. - Routed
ResolveFSthroughValidateFilesystemand registeredazure-centralus→https://azure-centralus.drive9.aiin the built-in FS region manifest. - Accepted the
azureprovider andazure-centralusregion in both the CLI telemetry normalizer and the backend validator, and updated README,docs/priciples.md,AGENTS.md, the telemetry design doc, and both installers.
| File | Description |
|---|---|
internal/config/region/region.go |
Adds Azure provider/prefix, filesystemOnly marker, and the Validate/ValidateFilesystem/validatePlacement split. |
internal/config/region/region_test.go |
Covers filesystem-only acceptance for FS, Starter rejection, and placement parsing/canonical round-trips. |
internal/api/endpoints/endpoints.go |
FS resolution uses ValidateFilesystem; built-in manifest gains the Azure Central US endpoint. |
internal/api/endpoints/endpoints_test.go |
Verifies Azure FS routing and Starter rejection of the filesystem-only placement. |
internal/telemetry/telemetry.go |
Normalizer accepts the azure provider. |
internal/telemetry/telemetry_test.go |
Asserts Azure placement is preserved end-to-end. |
internal/telemetrybackend/event.go |
Backend validator allows azure provider and azure-centralus region. |
internal/telemetrybackend/event_test.go |
Parameterizes GCP/Azure acceptance; moves azure out of the rejected cases. |
internal/fs/fscred/credential_test.go |
Confirms a filesystem-only region is stored/resolved without mutating profile placement. |
internal/cli/root_test.go |
CLI-level Starter rejection and FS dry-run acceptance for azure-centralus. |
e2e/cli_test.go |
Compiled-binary routing to the Azure FS endpoint plus Starter rejection. |
e2e/installer_test.go |
Installer region-listing assertions include azure-centralus. |
README.md, docs/priciples.md, AGENTS.md, docs/telemetry-backend-design.md |
Document the new Filesystem-only placement and provider mapping. |
scripts/install.sh, scripts/install.ps1 |
Add azure-centralus to the printed ti fs regions list. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Alternative to #76: keep
azure-centralusa Filesystem-only placement instead of adding it to the shared placement table. The two changes conflict ininternal/config/region; only one should merge.Problem
ti fs --region azure-centralus ...fails local region validation even though the Azure Central US Filesystem deployment (https://azure-centralus.drive9.ai) is available.region.supportedis shared by Starter and Filesystem resolution, so only adding azure there also makesti dbaccept the placement locally:README (
Regions supporting TiDB Cloud Starter),docs/priciples.md, and the published regions page do not list Azure as a Starter placement, so that would send an unsupported region to the Starter API instead of failing locally.Change
internal/config/region: addProviderAzureand theazure-centralusplacement plus afilesystemOnlymarker.Validate(Starter) rejects marked placements withplacement "azure-centralus" serves TiDB Cloud Filesystem only, not TiDB Cloud Starter; the newValidateFilesystemaccepts them.ParsePlacementCodeandCanonicalCodekeep accepting every known placement, so--region,ti configure, profiles, and stored credentials are unaffected.internal/api/endpoints: Filesystem resolution usesValidateFilesystem, and the built-in mapping gainsazure-centralus->https://azure-centralus.drive9.ai(mode=tidb_cloud_native).azureprovider and theazure-centralusregion code.docs/priciples.md,AGENTS.md, the telemetry backend design table, and theti fs regionsline of both installers.Resulting behavior:
ti fs ... --region azure-centralushttps://azure-centralus.drive9.ai(dry-run showsazure centralus)ti db ... --region azure-centralusconfig.invalid_region, exit 2, Filesystem-only message, no request sentti configure --region-code azure-centralusgcp-us-east1intentionally keeps its current behavior here; applying the same Filesystem-only model to it is a separate decision, and thefilesystemOnlymarker makes that a one-line follow-up.Verification
gofmt -lis clean on the changed files, andgo mod tidyleavesgo.mod/go.sumunchanged.go test ./...passes.TI_E2E_BIN=bin/ti go test ./e2e/passes except the pre-existingTestTelemetryUsesFakeIngestionServer, which also fails on unmodifiedmainin this environment (local telemetry ingestion fixture, unrelated to this change).ti --region azure-centralus fs create-file-system --dry-run->"message": "azure centralus",/v1/admin/tenants, exit 0.ti --region azure-centralus db create-db-cluster --db-cluster-type starter --db-cluster-name demo --dry-run->ti [ERROR]: placement "azure-centralus" serves TiDB Cloud Filesystem only, not TiDB Cloud Starter, exit 2.ti --region gcp-us-east1 db create-db-cluster ... --dry-run-> unchanged, still proceeds locally.DRIVE9_*isolation, and telemetry acceptance on both sides.Follow-ups (not in this PR)
ti-telemetry-backendmust acceptazure/azure-centralusbefore or with this CLI release. The column is an unconstrainedVARCHAR(32), so no migration is needed.docs/pingcap-docs/docs,ai/ti/reference/ti-regions-security-and-limitations.md) lives in a separate docs repo/submodule and is not updated here. It currently lists neither GCP nor Azure.