Skip to content

i18n(ja): fix mistranslations and dropped particles across the br/ directory - #23886

Open
yahonda wants to merge 16 commits into
pingcap:i18n-ja-release-8.5from
yahonda:fix-br-defects
Open

yahonda wants to merge 16 commits into
pingcap:i18n-ja-release-8.5from
yahonda:fix-br-defects

Conversation

@yahonda

@yahonda yahonda commented Sep 16, 2026

Copy link
Copy Markdown
Member

What is changed, added or deleted? (Required)

Fixes defects found during a full-corpus JA-vs-EN review of br/ (batch 4 of the ongoing review campaign, 15 files/~62 sites). Highlights:

Meaning-changing mistranslations:

  • backup-and-restore-use-cases.md: a dropped negation reversed "at no specific time" into "at a specific time"; the version-template placeholder v{{{ .tidb-version }}} had been hardcoded to v8.5.5 in 3 sites, breaking the site's version-templating mechanism; a severely scrambled S3 permission list (a directory reference misplaced mid-list, breaking up 5 permission names)
  • backup-and-restore-overview.md: an RPO gloss inconsistency (two different Japanese terms for "Recovery Point Objective" in one file); "log backup data" (a noun, the log-backup feature's data) mistranslated as if "log" were a verb; a heading and 2 link texts using 回復する ("recover") instead of the parallel 復元 (restore) terminology used everywhere else; a vector-search compatibility table row where the link and its modified noun were split apart, leaving a dangling particle and a nonsensical sentence
  • br-log-architecture.md: "ts" (timestamp) mistranslated as "タスク" (task), contradicting the correct rendering used elsewhere in the same file
  • br-incremental-guide.md: a mistranslation restructured "backs up data AND DDLs" into "data between [ts-range] and [DDLs]" as if DDLs were a range endpoint
  • br-checkpoint-restore.md: the tool name br (the sentence's actual subject) confused with a configurable "parameter" that must be "specified" -- invented a nonexistent option
  • br-pitr-guide.md: a dropped "output" verb reading as nonsensical passive "information is br-ed"
  • br-snapshot-guide.md: a dropped clause ("superset of that in the backup data") lost its comparison object entirely, becoming an incomplete statement
  • br-use-overview.md: まで (until) used instead of a purpose construction, turning "run the command to install" into "run the command until installing"
  • backup-and-restore-storages.md: a bold span folded "for backup and restore" into "access key" as a modifier, changing which method the sentence describes

Other real defects:

  • br-batch-create-table.md: a sentence ending abruptly with no copula; a severely scrambled formula sentence
  • br-monitoring-and-alert.md: 警告項目/アラート項目 terminology inconsistency for "alert item" (6 sites)
  • use-br-command-line-tool.md: a dropped に particle that self-contradicted a parallel sentence later in the file; a missing opening backtick in the frontmatter
  • br-snapshot-manual.md: a dropped "コマンド" word ("br command-line tool" -> "br line tool"); an unclosed parenthesis
  • br-snapshot-architecture.md: a duplicated "TiDB" before a link
  • Recurring dropped は/が/を particles right after a closing code span or link across most of the above files, including a systemic 9-site cluster in br-checkpoint-backup.md (nearly every paragraph)

All fixes were individually re-verified against the live file and the EN source (upstream/release-8.5) before being applied.

Which TiDB version(s) do your changes apply to? (Required)

  • i18n-ja-release-8.5 (TiDB Japanese documentation for TiDB 8.5 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

🤖 Generated with Claude Code

Summary by CodeRabbit

  • ドキュメント
    • バックアップ・復元に関する日本語ドキュメントの表現、文法、書式、リンクを改善しました。
    • RPO、PITR、増分バックアップ、復元対象、S3権限、ベクトル検索の互換性に関する説明を明確化しました。
    • TiDBおよびBRのバージョン表記をテンプレート化しました。
    • スナップショット復元時、既存のデータベースやテーブルは自動的にスキップされることを明記しました。
    • ログバックアップのGCセーフポイントがチェックポイントを超えた場合のアラート項目を追加しました。

yahonda and others added 11 commits September 16, 2026 11:48
…estore-overview/use-cases

- backup-and-restore-use-cases.md: fixed a dropped negation reversing
  "at no specific time" into "at a specific time"; restored the
  version-template placeholder v{{{ .tidb-version }}} that had been
  hardcoded to v8.5.5 in 3 sites; fixed a severely scrambled S3
  permission list (a directory reference misplaced mid-list, breaking
  up 5 permission names); a dropped は after two consecutive links.
- backup-and-restore-overview.md: fixed an RPO gloss inconsistency
  (two different Japanese terms for the same "Recovery Point
  Objective" in one file); "log backup data" (a noun, the log-backup
  feature's data) mistranslated as if "log" were a verb; a heading and
  2 link texts using 回復する ("recover") instead of matching the
  parallel 復元 (restore) terminology used everywhere else for this
  concept; a dangling "を参照してください" with its link misplaced
  earlier in the sentence; a vector-search compatibility table row
  where the link and its modified noun were split apart, leaving a
  dangling "で" and a nonsensical sentence.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…iles

- br-log-architecture.md: "ts" (timestamp) mistranslated as "タスク"
  (task) in one site, contradicting the correct rendering used
  elsewhere in the same file; an untranslated bold bullet label
  ("Read kv Change data") while every sibling bullet label is
  translated.
- br-incremental-guide.md: a mistranslation restructured "backs up
  data AND DDLs" into "data between [ts-range] and [DDLs]" as if DDLs
  were a range endpoint.
- br-checkpoint-restore.md: the tool name `br` (the sentence's actual
  subject) confused with a configurable "parameter" that the user must
  "specify" -- invented a nonexistent option.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e.md

- Dropped "output" (出力する) verb reading as nonsensical passive
  "information is \`br\`-ed"
- A missing opening paren left a stray closing one and a dropped
  particle before the NORMAL/PAUSED/ERROR status list

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…es in br-snapshot-guide.md

- A dropped clause ("superset of that in the backup data") lost its
  comparison object entirely, becoming an incomplete statement.
- A link text conjugated as a complete polite-form sentence
  (インストールします) instead of dictionary form, breaking the
  grammar of the following 必要があります.
- A run-on sentence missing a period between two EN sentences.
- A dropped は particle before a verb.
- 3 sites where the object particle を was trapped inside a bold span
  instead of following it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…erview.md

- まで (until) used instead of a purpose construction, turning "run
  the command to install" into "run the command until installing"
- An object particle を trapped inside an <a> anchor tag instead of
  following it
- A missing し in デプロイて (should be デプロイして)
- 2 more dropped を particles found during review

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…d-line-tool.md

- A dropped に particle self-contradicted the correctly-formed
  parallel sentence for tiup br debug's sub-commands later in the
  same file.
- A missing opening backtick in the frontmatter summary.
- A run-on sentence missing a period, inconsistent with its sibling
  bullet's correct punctuation.
- 3 more dropped particles (を x2, が x1) found during review.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
EN uses "alert item" consistently for both the bold bullet labels and
surrounding prose; JA had 警告項目 for the 6 bullet labels but アラート
項目 everywhere else. Unified on アラート項目 (the prose majority).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…p-and-restore-storages.md

- Bold span folded "for backup and restore" into "access key" as a
  modifier, changing which method the sentence describes, and
  diverging from the method's own title used elsewhere in the file.
- A scrambled intro sentence duplicating "external storage services"
  awkwardly instead of listing the three things being introduced.
- A severely scrambled minimum-privileges bullet (TiKV/BR subject
  displaced, an HTML entity artifact, permission names broken up by
  misplaced clauses), rebuilt to match its correctly-formed sibling
  bullet right below it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…atch-create-table.md

- A dropped を before ご覧ください
- A sentence ending abruptly on a bare value with no copula (です)
- A severely scrambled sentence where \`tikv_count\` was severed from
  its division formula and misplaced at the sentence end

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nt-backup.md

Restored a missing opening backtick in the frontmatter summary, and
fixed 8 sites (nearly every paragraph in the file) where は/が/を was
dropped right after \`br\` or \`gcttl\`, a systemic pattern across this
directory.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… 2 br files

- br-snapshot-architecture.md: duplicated "TiDB" before a link
  ("TiDB [TiDB GCメカニズム]").
- br-snapshot-manual.md: a dropped "コマンド" (br command-line tool ->
  br line tool), an unclosed parenthesis, and 4 dropped particles
  (は x3, を x1) found while fixing the above.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ti-chi-bot

ti-chi-bot Bot commented Sep 16, 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 jackysp 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 added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 16, 2026
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 0db533b1-59ba-4adc-b2df-c80e2f561110

📥 Commits

Reviewing files that changed from the base of the PR and between fd24172 and ba7a9bd.

📒 Files selected for processing (1)
  • br/backup-and-restore-overview.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The pull request updates Japanese BR documentation. It clarifies backup, restore, PITR, compatibility, permissions, monitoring, and command descriptions. It also corrects wording, links, formatting, and version templates.

Changes

BR documentation updates

Layer / File(s) Summary
Backup and restore concepts
br/backup-and-restore-overview.md, br/backup-and-restore-storages.md, br/backup-and-restore-use-cases.md
The documentation revises RPO, PITR, compatibility, storage permissions, audit requirements, and version examples.
Checkpoint and log backup documentation
br/br-checkpoint-*.md, br/br-incremental-guide.md, br/br-log-architecture.md, br/br-monitoring-and-alert.md, br/br-pitr-guide.md
The documentation clarifies checkpoint, incremental backup, log backup, alert, and PITR descriptions.
Snapshot backup and restore documentation
br/br-snapshot-*.md, br/br-use-overview.md
The documentation corrects Japanese wording, links, parameter descriptions, and compatibility statements.
BR command reference
br/br-batch-create-table.md, br/use-br-command-line-tool.md
The documentation clarifies the average-speed calculation and corrects command reference wording and formatting.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~10 minutes

Change: Other

Merge Risk: 🟡 Moderate · up to ba7a9

Incorrect Japanese guidance can lead operators to configure invalid S3 permissions or misunderstand restore compatibility and command syntax, so these documentation fixes should be completed before merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies Japanese translation and particle fixes across the br/ directory. It is concise and related to the primary changes.
Description check ✅ Passed The description explains the changes in detail, identifies the affected TiDB version, records AI involvement, and includes the required checklist sections. Blank reference-link fields are non-critical…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Revise the earlier RPO gloss fix (リカバリポイント目標) to 目標復旧時点,
matching the more widely established pairing used across
tidb-cloud/backup-and-restore.md, tidb-cloud/backup-and-restore-concepts.md,
tidb-cloud/serverless-high-availability.md, and faq/backup-and-restore-faq.md,
all of which render RTO as 目標復旧時間 and RPO as 目標復旧時点 together.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@coderabbitai coderabbitai 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.

Actionable comments posted: 6


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 14c9f0e4-7453-47d9-b747-88f463ce891b

📥 Commits

Reviewing files that changed from the base of the PR and between 09ec082 and 7fabc39.

📒 Files selected for processing (15)
  • br/backup-and-restore-overview.md
  • br/backup-and-restore-storages.md
  • br/backup-and-restore-use-cases.md
  • br/br-batch-create-table.md
  • br/br-checkpoint-backup.md
  • br/br-checkpoint-restore.md
  • br/br-incremental-guide.md
  • br/br-log-architecture.md
  • br/br-monitoring-and-alert.md
  • br/br-pitr-guide.md
  • br/br-snapshot-architecture.md
  • br/br-snapshot-guide.md
  • br/br-snapshot-manual.md
  • br/br-use-overview.md
  • br/use-br-command-line-tool.md

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.

2. BRとTiKVがS3ディレクトリにアクセスするための権限を設定します。S3バケットにアクセスする最も安全な方法であるIAMメソッドを使用して権限を付与することをお勧めします。詳細な手順については、 [AWS ドキュメント: ユーザーポリシーによるバケットへのアクセスの制御](https://docs.aws.amazon.com/AmazonS3/latest/userguide/walkthrough1.html)を参照してください。必要な権限は次のとおりです。

- バックアップ クラスター内の TiKV とBRには`s3:GetObject` `s3://tidb-pitr-bucket/backup-data`ディレクトリ`s3:DeleteObject` `s3:ListBucket` 、および`s3:PutObject` `s3:AbortMultipartUpload`権限が必要です。
- バックアップクラスター内のTiKVとBRには、 `s3://tidb-pitr-bucket/backup-data`ディレクトリの`s3:ListBucket`、 `s3:GetObject`、 `s3:DeleteObject`、 `s3:PutObject`、および`s3:AbortMultipartUpload`権限が必要です。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use the bucket resource for s3:ListBucket.

s3:ListBucket is a bucket-level action. Restrict backup-data/ with the s3:prefix condition. The other actions require object resources. An object-scoped s3:ListBucket statement can leave backup or restore access denied. Apply the same distinction to the restore-cluster line.

Apply this replacement
-    - バックアップクラスター内のTiKVとBRには、 `s3://tidb-pitr-bucket/backup-data`ディレクトリの`s3:ListBucket`、 `s3:GetObject`、 `s3:DeleteObject`、 `s3:PutObject`、および`s3:AbortMultipartUpload`権限が必要です。
-    - 復元クラスター内の TiKV とBRには、 `s3://tidb-pitr-bucket/backup-data`ディレクトリの`s3:ListBucket`と`s3:GetObject`権限が必要です。
+    - バックアップクラスター内の TiKV と BR には、`tidb-pitr-bucket` バケットに対して `s3:prefix` 条件で `backup-data/` プレフィックスに制限した `s3:ListBucket` 権限と、`s3://tidb-pitr-bucket/backup-data/` 配下のオブジェクトに対する `s3:GetObject`、`s3:DeleteObject`、`s3:PutObject`、および `s3:AbortMultipartUpload` 権限が必要です。
+    - 復元クラスター内の TiKV と BR には、`tidb-pitr-bucket` バケットに対して `s3:prefix` 条件で `backup-data/` プレフィックスに制限した `s3:ListBucket` 権限と、`s3://tidb-pitr-bucket/backup-data/` 配下のオブジェクトに対する `s3:GetObject` 権限が必要です。

```

テスト結果から、1つの TiKV インスタンスを復元する平均速度は 181.65 MB/秒 ( `average-speed`に相当) であること`tikv_count`わかります
テスト結果から、1つの TiKV インスタンスを復元する平均速度は 181.65 MB/秒`average-speed`/`tikv_count`に相当)であることがわかります

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- target context ---'
cat -n br/br-batch-create-table.md | sed -n '45,75p'
printf '%s\n' '--- average-speed references ---'
rg -n -i --glob '*.md' --glob '*.yaml' --glob '*.yml' --glob '*.json' 'average-speed|2\.661GB/s|181\.65|tikv_count' . | head -200

Repository: pingcap/docs

Length of output: 4173


🤖 get_repo_knowledge executed:

get_repo_knowledge pingcap/docs /tmp/coderabbit-repo-knowledge/pingcap-docs-9c73f70c/conventions

Length of output: 1294


🌐 Web query:

TiDB BR collector.go average-speed humanize 2.661GB/s unit implementation

💡 Result:

<search_synthesis>
In TiDB&#39;s Backup & Restore (BR) tool, the average-speed reported in logs is calculated in the collector.go file [1][2]. The implementation computes the speed by dividing the total data size (TotalBytes) by the total duration of the operation (totalDureTime), and then formats the result using a humanize utility [1][2]. The relevant code snippet typically looks like this: zap.String("average-speed", units.HumanSize(float64(data)/totalDureTime.Seconds)+"/s") This implementation uses the HumanSize function from a Go units package (often github.com/dustin/go-humanize or a similar internal utility) to convert the calculated float64 value (bytes per second) into a human-readable format such as "2.661GB/s" [1][2]. The value 2.661GB/s is a representation of the throughput derived from the total transferred bytes divided by the elapsed time [1][2]. Historical issues, such as GitHub issue pingcap/br#1405, have addressed accuracy concerns regarding how this average speed is computed, ensuring that the total time taken includes all relevant phases of the backup or restore process (such as checksumming) rather than just the core data transfer time [3][4].
</search_synthesis>

<source_evidence>

<title>tidb collector 源码 - seaxiang</title> https://seaxiang.com/blog/55ced6c4ee23491881c5e94100d61b65 tidb collector 源码 - seaxiang # tidb collector 源码 2022-09-19 浏览 (644) ## tidb collector 代码 文件路径:/br/pkg/summary/collector.go ``` / Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0. package summary import ( "context" "strings" "sync" "time" "github.com/docker/go-units" berror "github.com/pingcap/errors" "github.com/pingcap/log" "go.uber.org/zap" ) const ( / BackupUnit tells summary in backup BackupUnit = "backup" / RestoreUnit tells summary in restore RestoreUnit = "restore" / TotalKV is a field we collect during backup/restore TotalKV = "total kv" / TotalBytes is a field we collect during backup/restore TotalBytes = "total bytes" / BackupDataSize is a field we collect after backup finish BackupDataSize = "backup data size(after compressed)" / RestoreDataSize is a field we collection after restore finish RestoreDataSize = "restore data size(after compressed)" ) / LogCollector collects infos into summary log. type LogCollector interface { SetUnit(unit string) CollectSuccessUnit(name string, unitCount int, arg interface{}) CollectFailureUnit(name string, reason error) CollectDuration(name string, t time.Duration) CollectInt(name string, t int) CollectUInt(name string, t uint64) SetSuccessStatus(success bool) Summary(name string) Log(msg string, fields ...zap.Field) } type logFunc func(msg string, fields ...zap.Field) var collector = NewLogCollector(log.Info) / InitCollector initilize global collector instance. func InitCollector( / revive:disable-line:flag-parameter hasLogFile bool, ) { logF := log.L().Info if hasLogFile { conf := new(log.Config) / Always duplicate summary to stdout. logger, _, err := log.InitLogger(conf) if err == nil { logF = func(msg string, fields ...zap.Field) { logger.Info(msg, fields...) log.Info(msg, fields...) } } } collector = NewLogCollector(logF) } type logCollector struct { mu sync.Mutex unit string successUnitCount int failureUnitCount int successCosts map[string]time.Duration successData map[string]uint64 failureReasons map[string]error durations map[string]time.Duration ints map[string]int uints map[string]uint64 successStatus bool startTime time.Time log logFunc } / NewLogCollector returns a new LogCollector. func NewLogCollector(logf logFunc) LogCollector { return &logCollector{ successUnitCount: 0, failureUnitCount: 0, successCosts: make(map[string]time.Duration), successData: make(map[string]uint64), failureReasons: make(map[string]error), durations: make(map[string]time.Duration), ints: make(map[string]int), uints: make(map[string]uint64), log: logf, startTime: time.Now(), } } func (tc *logCollector) SetUnit(unit string) { tc.mu.Lock() defer tc.mu.Unlock() tc.unit = unit } func (tc *logCollector) CollectSuccessUnit(name string, unitCount int, arg interface{}) { tc.mu.Lock() defer tc.mu.Unlock() switch v := arg.(type) { case time.Duration: tc.successUnitCount += unitCount tc.successCosts[name] += v case uint64: tc.successData[name] += v } } func (tc *logCollector) CollectFailureUnit(name string, reason error) { tc.mu.Lock() defer tc.mu.Unlock() if _, ok := tc.failureReasons[name]; !ok { tc.failureReasons[name] = reason tc.failureUnitCount++ } } func (tc *logCollector) CollectDuration(name string, t time.Duration) { tc.mu.Lock() defer tc.mu.Unlock() tc.durations[name] += t } func (tc *logCollector) CollectInt(name string, t int) { tc.mu.Lock() defer tc.mu.Unlock() tc.ints[name] += t } func (tc *logCollector) CollectUInt(name string, t uint64) { tc.mu.Lock() defer tc.mu.Unlock() tc.uints[name] += t } func (tc *logCollector) SetSuccessStatus(success bool) { tc.mu.Lock() defer tc.mu.Unlock() tc.successStatus = success } func logKeyFor(key string) string { return strings.ReplaceAll(key, " ", "-") } func (tc *logCollector) Summary(name string) { tc.mu.Lock() defer func() { tc.durations = make(map[string]time.Duration) tc.…[truncated] <title>tidb collector 源码 - seaxiang</title> https://m.seaxiang.com/blog/55ced6c4ee23491881c5e94100d61b65 tidb collector 源码 - seaxiang # tidb collector 源码 2022-09-19 浏览 (644) ## tidb collector 代码 文件路径:/br/pkg/summary/collector.go ``` / Copyright 2020 PingCAP, Inc. Licensed under Apache-2.0. package summary import ( "context" "strings" "sync" "time" "github.com/docker/go-units" berror "github.com/pingcap/errors" "github.com/pingcap/log" "go.uber.org/zap" ) const ( / BackupUnit tells summary in backup BackupUnit = "backup" / RestoreUnit tells summary in restore RestoreUnit = "restore" / TotalKV is a field we collect during backup/restore TotalKV = "total kv" / TotalBytes is a field we collect during backup/restore TotalBytes = "total bytes" / BackupDataSize is a field we collect after backup finish BackupDataSize = "backup data size(after compressed)" / RestoreDataSize is a field we collection after restore finish RestoreDataSize = "restore data size(after compressed)" ) / LogCollector collects infos into summary log. type LogCollector interface { SetUnit(unit string) CollectSuccessUnit(name string, unitCount int, arg interface{}) CollectFailureUnit(name string, reason error) CollectDuration(name string, t time.Duration) CollectInt(name string, t int) CollectUInt(name string, t uint64) SetSuccessStatus(success bool) Summary(name string) Log(msg string, fields ...zap.Field) } type logFunc func(msg string, fields ...zap.Field) var collector = NewLogCollector(log.Info) / InitCollector initilize global collector instance. func InitCollector( / revive:disable-line:flag-parameter hasLogFile bool, ) { logF := log.L().Info if hasLogFile { conf := new(log.Config) / Always duplicate summary to stdout. logger, _, err := log.InitLogger(conf) if err == nil { logF = func(msg string, fields ...zap.Field) { logger.Info(msg, fields...) log.Info(msg, fields...) } } } collector = NewLogCollector(logF) } type logCollector struct { mu sync.Mutex unit string successUnitCount int failureUnitCount int successCosts map[string]time.Duration successData map[string]uint64 failureReasons map[string]error durations map[string]time.Duration ints map[string]int uints map[string]uint64 successStatus bool startTime time.Time log logFunc } / NewLogCollector returns a new LogCollector. func NewLogCollector(logf logFunc) LogCollector { return &logCollector{ successUnitCount: 0, failureUnitCount: 0, successCosts: make(map[string]time.Duration), successData: make(map[string]uint64), failureReasons: make(map[string]error), durations: make(map[string]time.Duration), ints: make(map[string]int), uints: make(map[string]uint64), log: logf, startTime: time.Now(), } } func (tc *logCollector) SetUnit(unit string) { tc.mu.Lock() defer tc.mu.Unlock() tc.unit = unit } func (tc *logCollector) CollectSuccessUnit(name string, unitCount int, arg interface{}) { tc.mu.Lock() defer tc.mu.Unlock() switch v := arg.(type) { case time.Duration: tc.successUnitCount += unitCount tc.successCosts[name] += v case uint64: tc.successData[name] += v } } func (tc *logCollector) CollectFailureUnit(name string, reason error) { tc.mu.Lock() defer tc.mu.Unlock() if _, ok := tc.failureReasons[name]; !ok { tc.failureReasons[name] = reason tc.failureUnitCount++ } } func (tc *logCollector) CollectDuration(name string, t time.Duration) { tc.mu.Lock() defer tc.mu.Unlock() tc.durations[name] += t } func (tc *logCollector) CollectInt(name string, t int) { tc.mu.Lock() defer tc.mu.Unlock() tc.ints[name] += t } func (tc *logCollector) CollectUInt(name string, t uint64) { tc.mu.Lock() defer tc.mu.Unlock() tc.uints[name] += t } func (tc *logCollector) SetSuccessStatus(success bool) { tc.mu.Lock() defer tc.mu.Unlock() tc.successStatus = success } func logKeyFor(key string) string { return strings.ReplaceAll(key, " ", "-") } func (tc *logCollector) Summary(name string) { tc.mu.Lock() defer func() { tc.durations = make(map[string]time.Duration) tc.…[truncated] <title>restore: the average speed isn&`#39`;t accurate · Issue `#1405` · pingcap/br</title> GitHub issue 1405 in pingcap/br (link omitted to avoid creating a cross-reference) # Issue: pingcap/br `#1405` - Repository: pingcap/br | A command-line tool for distributed backup and restoration of the TiDB cluster data | 127 stars | Go ## restore: the average speed isn&`#39`;t accurate - Author: [`@YuJuncen`](https://github.com/YuJuncen) - Association: COLLABORATOR - State: closed (completed) - Locked: true - Labels: type/bug, severity/major, component/backup, component/restore - Created: 2021-08-03T09:11:00Z - Updated: 2021-10-27T09:54:15Z - Closed: 2021-10-27T09:54:15Z - Closed by: [`@YuJuncen`](https://github.com/YuJuncen) Please answer these questions before submitting your issue. Thanks! 1. What did you do? Simply run a restore, and it succeed. [Image: image | https://user-images.githubusercontent.com/36239017/127989634-310f8c64-cb22-4b4a-856a-7375054b3e00.png] 1. What did you expect to see? The rate should be computed by `totalKVSize / realTimeTake` (according to the log, it should be about `680 MB/s`). 1. What did you see instead? `[average-speed=2.424MB/s] ` 1. What version of BR and TiDB/TiKV/PD are you using? ``` cluster : v5.1.0 BR : master ``` --- ### Timeline **YuJuncen** added label `type/bug`; added label `component/backup`; added label `component/restore` · Aug 3, 2021 at 9:11am **fubinzh** added label `severity/major` · Aug 3, 2021 at 9:56am **joccau** mentioned this in PR [`#1408`: Fix speed compute](https://github.com/pingcap/br/pull/1408) · Aug 4, 2021 at 2:22am **ti-chi-bot** mentioned this in PR [`#1410`: Fix speed compute (`#1408`)](https://github.com/pingcap/br/pull/1410) · Aug 4, 2021 at 8:57am **ti-chi-bot** mentioned this in PR [`#1411`: Fix speed compute (`#1408`)](https://github.com/pingcap/br/pull/1411); mentioned this in PR [`#1412`: Fix speed compute (`#1408`)](https://github.com/pingcap/br/pull/1412) · Aug 4, 2021 at 8:59am **`@YuJuncen`** commented · Oct 27, 2021 at 9:54am · Author > should be fixed by `#1408` :) **YuJuncen** closed this · Oct 27, 2021 at 9:54am <title>summary: add real time cost to log collector (`#480`) · Issue `#486` · pingcap/br</title> GitHub issue 486 in pingcap/br (link omitted to avoid creating a cross-reference) # Issue: pingcap/br `#486` - Repository: pingcap/br | A command-line tool for distributed backup and restoration of the TiDB cluster data | 127 stars | Go ## summary: add real time cost to log collector (`#480`) - Author: [`@ti-srebot`](https://github.com/ti-srebot) - Association: CONTRIBUTOR - State: closed - Locked: true - Labels: status/LGT2 - Created: 2020-09-02T05:49:08Z - Updated: 2020-09-03T07:17:52Z - Closed: 2020-09-03T07:17:52Z - Closed by: [`@ti-srebot`](https://github.com/ti-srebot) cherry-pick `#480` to release-4.0 --- Signed-off-by: Hillium <maruruku@stu.csust.edu.cn> ### What problem does this PR solve? implement `#478` ### What is changed and how it works? We make serval changes to make the log of time cost correct: 1. collect kv and size each time of importing. https://github.com/pingcap/br/blob/d9d6207c0aa7bad470093683427338053435e1ba/pkg/restore/import.go#L328-L331 1. a log of real time cost is added to the summary. 2. collect the success unit when checksumming, so the total cost field would be (the time of restoring + the time of checksumming) instead of just the time of restoring. ### Check List Tests [Image: image | https://user-images.githubusercontent.com/36239017/91679842-f7da3900-eb7b-11ea-987d-e6e4c066a616.png] - Manual test (add detailed scripts or steps below) ### Release Note - Add real time cost to log. --- ### Timeline **Hillium** pushed commit `bc29f55`: summary: add real time cost to log collector; pushed commit `06f36c1`: summary: rename TiKV service time to $name time; pushed commit `06cd25a`: restore: fix a typo · Sep 2, 2020 at 5:49am **ti-srebot** mentioned this in PR [`#480`: summary: add real time cost to log collector](https://github.com/pingcap/br/pull/480); added label `cherry-pick`; requested review from [`@3pointer`](https://github.com/3pointer); requested review from [`@kennytm`](https://github.com/kennytm); requested review from [`@overvenus`](https://github.com/overvenus) · Sep 2, 2020 at 5:49am **`@3pointer`** commented · Sep 2, 2020 at 8:52am > **Review (approved):** > LGTM **ti-srebot** added label `status/LGT1` · Sep 2, 2020 at 8:52am **overvenus** reviewed: approved · Sep 3, 2020 at 4:50am **ti-srebot** removed label `status/LGT1`; added label `status/LGT2` · Sep 3, 2020 at 4:50am **`@kennytm`** commented · Sep 3, 2020 at 7:10am > /merge **ti-srebot** added label `CanMerge` · Sep 3, 2020 at 7:10am **`@ti-srebot`** commented · Sep 3, 2020 at 7:10am · Author > /run-all-tests **ti-srebot** merged this pull request; closed this · Sep 3, 2020 at 7:17am <title>Duplicate attributes in BR json log for pitr · Issue `#53645` · pingcap/tidb</title> GitHub issue 53645 in pingcap/tidb (link omitted to avoid creating a cross-reference) # Issue: pingcap/tidb `#53645` - Repository: pingcap/tidb | TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications. | 40K stars | Go ## Duplicate attributes in BR json log for pitr - Author: [`@dveeden`](https://github.com/dveeden) - Association: CONTRIBUTOR - State: closed (completed) - Labels: type/bug, severity/minor, component/br - Created: 2024-05-29T06:57:29Z - Updated: 2024-05-31T08:28:25Z - Closed: 2024-05-31T08:28:25Z - Closed by: [`@ti-chi-bot`[bot]](https://github.com/ti-chi-bot[bot]) ## Bug Report The `"restore log success summary"` looks like this in the output of `br`: ``` [2024/05/29 08:40:10.537 +02:00] [INFO] [collector.go:77] ["restore log success summary"] [total-take=3.607614879s] [restore-from=450091587356590086] [restore-to=450091627315200000] [restore-from="2024-05-29 08:12:27.57 +0200"] [restore-to="2024-05-29 08:15:00 +0200"] [total-kv-count=2] [skipped-kv-count-by-checkpoint=0] [total-size=191B] [skipped-size-by-checkpoint=0B] [average-speed=52.94B/s] ``` And when using `--log-format json` this looks like this: ```json {"level":"INFO","time":"2024/05/29 08:43:01.784 +02:00","caller":"collector.go:78","message":"restore log success summary","total-take":"3.595453335s","restore-from":450091587356590086,"restore-to":450091627315200000,"restore-from":"2024-05-29 08:12:27.57 +0200","restore-to":"2024-05-29 08:15:00 +0200","total-kv-count":2,"skipped-kv-count-by-checkpoint":0,"total-size":"191B","skipped-size-by-checkpoint":"0B","average-speed":"53.12B/s"} ``` When using `jq` to do display/filtering/etc it looks like this: ```json { "level": "INFO", "time": "2024/05/29 08:43:01.784 +02:00", "caller": "collector.go:78", "message": "restore log success summary", "total-take": "3.595453335s", "restore-from": "2024-05-29 08:12:27.57 +0200", "restore-to": "2024-05-29 08:15:00 +0200", "total-kv-count": 2, "skipped-kv-count-by-checkpoint": 0, "total-size": "191B", "skipped-size-by-checkpoint": "0B", "average-speed": "53.12B/s" } ``` The problem here is that there are duplicate keys in this output for `restore-to` and `restore-from`. Once with the TS and once with the human readable timestamp. Suggestion: Rename one of these for each group to avoid duplicate attributes. --- ### Timeline **dveeden** added label `type/bug`; added label `component/br` · May 29, 2024 at 6:57am **dveeden** mentioned this in PR [`#53649`: br: Enhance stream restore logs](https://github.com/pingcap/tidb/pull/53649) · May 29, 2024 at 7:08am **dveeden** added label `severity/minor` · May 29, 2024 at 7:09am **ti-chi-bot[bot]** closed this; closed this · May 31, 2024 at 8:28am

Citations:


🌐 Web query:

site:github.com/pingcap/br v6.0.0 pkg/summary/collector.go github.com/docker/go-units HumanSize average-speed

💡 Result:

<search_synthesis>
I can’t directly answer “v6.0.0 pkg/summary/collector.go github.com/docker/go-units HumanSize average-speed” as a single coherent statement without knowing which specific repository/version “v6.0.0” refers to and what you want (e.g., the exact code snippet for average-speed logging, or how HumanSize formats it). What I can say from the sources I found is that “average-speed” in a Go collector for backup/restore is computed from total size divided by a measured “real time” duration, and there were known bugs where the computed average speed was incorrect. For example, an issue describes that the expected rate should be computed by totalKVSize / realTimeTake, but the logs showed an incorrect average-speed value (2.424MB/s instead of ~680MB/s) [1]. Another issue describes “Full restore success summary” logging an “average-speed=584.5kB/s” field in collector.go output [2]. Additionally, in that same codebase, the PRs clarify summary field semantics: the restore summary’s “size” corresponds to “restore data size(after decompressed)”, and “data-size” was renamed to “total-kv-size” [3]. A separate PR (“summary: add real time cost to log collector”) indicates the collector was updated to include real time cost [4]. If you tell me: 1) which exact GitHub repo/tag “v6.0.0” is from, 2) whether you want the formula used for average-speed in pkg/summary/collector.go, 3) whether you want how docker/go-units HumanSize is applied to that value, …I can re-run targeted searches to locate the exact collector.go implementation for that version and provide a precise, code-referenced answer.
</search_synthesis>

<source_evidence>

<title>restore: the average speed isn&`#39`;t accurate · Issue `#1405` · pingcap/br</title> GitHub issue 1405 in pingcap/br (link omitted to avoid creating a cross-reference) # Issue: pingcap/br `#1405` - Repository: pingcap/br | A command-line tool for distributed backup and restoration of the TiDB cluster data | 127 stars | Go ## restore: the average speed isn&`#39`;t accurate - Author: [`@YuJuncen`](https://github.com/YuJuncen) - Association: COLLABORATOR - State: closed (completed) - Locked: true - Labels: type/bug, severity/major, component/backup, component/restore - Created: 2021-08-03T09:11:00Z - Updated: 2021-10-27T09:54:15Z - Closed: 2021-10-27T09:54:15Z - Closed by: [`@YuJuncen`](https://github.com/YuJuncen) Please answer these questions before submitting your issue. Thanks! 1. What did you do? Simply run a restore, and it succeed. [Image: image | https://user-images.githubusercontent.com/36239017/127989634-310f8c64-cb22-4b4a-856a-7375054b3e00.png] 1. What did you expect to see? The rate should be computed by `totalKVSize / realTimeTake` (according to the log, it should be about `680 MB/s`). 1. What did you see instead? `[average-speed=2.424MB/s] ` 1. What version of BR and TiDB/TiKV/PD are you using? ``` cluster : v5.1.0 BR : master ``` --- ### Timeline **YuJuncen** added label `type/bug`; added label `component/backup`; added label `component/restore` · Aug 3, 2021 at 9:11am **fubinzh** added label `severity/major` · Aug 3, 2021 at 9:56am **joccau** mentioned this in PR [`#1408`: Fix speed compute](https://github.com/pingcap/br/pull/1408) · Aug 4, 2021 at 2:22am **ti-chi-bot** mentioned this in PR [`#1410`: Fix speed compute (`#1408`)](https://github.com/pingcap/br/pull/1410) · Aug 4, 2021 at 8:57am **ti-chi-bot** mentioned this in PR [`#1411`: Fix speed compute (`#1408`)](https://github.com/pingcap/br/pull/1411); mentioned this in PR [`#1412`: Fix speed compute (`#1408`)](https://github.com/pingcap/br/pull/1412) · Aug 4, 2021 at 8:59am **`@YuJuncen`** commented · Oct 27, 2021 at 9:54am · Author > should be fixed by `#1408` :) **YuJuncen** closed this · Oct 27, 2021 at 9:54am <title>br restore statistics not correct if restore with -f parameters · Issue `#1270` · pingcap/br</title> GitHub issue 1270 in pingcap/br (link omitted to avoid creating a cross-reference) [2021/06/23 01:56:29.793 -04:00] [INFO] [collector.go:66] ["Full restore success summary"] [total-ranges=44] [ranges-succeed=44] [ranges-failed=0] [split-region=601.358689ms] [restore-checksum=43.793886ms] [restore-ranges=19] [total-take=6.156156669s] ["restore data size(after decompressed)"=7.426GB] [total-kv=3345] [total-kv-size=287kB] [average-speed=584.5kB/s] ... 2.log ... Full restore <---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|> 100.00%[2021/06/23 01:56:29.111 -04:00] [WARN] [systable_restore.go:94] ["error during merging temporary tables into system tables"] [error="[BR:Restore:ErrUnsupportedSysTable]restoring stats via `mysql` schema isn&`#39`;t support yet: the table ID is out-of-date and may corrupt existing statistics"] [table=stats_meta] ... [2021/06/23 01:56:29.793 -04:00] [INFO] [collector.go:66] ["Full restore success summary"] [total-ranges=44] [ranges-succeed=44] [ranges-failed=0] [split-region=601.358689ms] [restore-checksum=43.793886ms] [restore-ranges=19] [total-take=6.156156669s] ["restore data size(after decompressed)"=7.426GB] [total-kv=3345] [total-kv-size=287kB] [average-speed=584.5kB/s] ... > For problem 1, the `restore data size` field is read from backup meta file, so this statistics is not correct, we will fix it soon. As for problem 2, can you provide more info, like before the backup you having two tables, and after the restore, you only get one table restored? ... > For problem 2, I mean the restore data size is not correct if I only restore one table from the backup (which contains 2 tables). > It is not restore failure or data loss, only stats issue. Sorry for confusion. ... > `@fubinzh` We will fix the restore data size problem soon ... ZipFast** mentioned this in PR ... , 2 <title>err_msg: clarify some ambiguous error message (`#1076`) · Pull Request `#1132` · pingcap/br</title> GitHub pull request 1132 in pingcap/br (link omitted to avoid creating a cross-reference) Clarify the summary info including: ... - `data-size => total kv size` - `size => backup data size(after compressed)` ... 1. Adjust the backup and restore summary: ... - the `data-size` field has been changed to `total-kv-size` - the `size` field in backup summary has been changed to `backup data size(after compressed)` - the `size` field in restore summary has been changed to `restore data size(after decompressed)` ... [20 ... 37:28.517 +08:00] ... push.go:147] ["backup occur unknown error"] [error="Io(Os { code: 13, kind: PermissionDenied...})"] [stack=" ... .com/pingcap/br/pkg ... backup.(*pushDown ... pushBackup\n\ ... pingcap/br ... pkg/backup ... Client).Backup ... 2.1\n\ ... /home/ ... j/log_improve/br/pkg/backup/client. ... 76\ ... /pingcap ... br/pkg/utils ... WorkerPool).ApplyOnError ... /home/ ... j/log_improve/br/pkg/utils/worker.go:63\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/root/go/pkg/mod/golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57"] ... ``` [2021/05/19 15:43:43.305 +08:00] [ERROR] [push.go:175] [error="[BR:KV:ErrKVStorage]tikv storage occur I/O error: I/O permission denied error occurs on TiKV Node(store id: 1; Address: 127.0.0.1:20162)"] ["work around"="please ensure tikv has permission to read from & write to the storage."] [stack="github.com/pingcap/br/pkg/backup.(*pushDown).pushBackup\n\t/home/zwj/log_improve/br/pkg/backup/push.go:175\ngithub.com/pingcap/br/pkg/backup.(*Client).BackupRange\n\t/home/zwj/log_improve/br/pkg/backup/client.go:540\ngithub.com/pingcap/br/pkg/backup.(*Client).BackupRanges.func2.1\n\t/home/zwj/log_improve/br/pkg/backup/client.go:476\ngithub.com/pingcap/br/pkg/utils.(*WorkerPool).ApplyOnErrorGroup.func1\n\t/home/zwj/log_improve/br/pkg/utils/worker.go:63\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/root/go/pkg/mod/golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9/errgroup/errgroup.go:57"] ... 1. Summary message have improve, data-size => total-kv-size and size => backup data size(after compressed) [Image: image | https://user-images.githubusercontent.com/23160968/118622459-ec0dd000-b7f9-11eb-952d-e90c47879624.png] <title>summary: add real time cost to log collector (`#480`)</title> GitHub pull request 486 in pingcap/br (link omitted to avoid creating a cross-reference) # summary: add real time cost to log collector (`#480`) - State: merged - Author: ti-srebot - Created: 2020-09-02T05:49:08Z - Updated: 2020-09-03T07:17:52Z - Repository: pingcap/br - Number: `#486` - +7 -3 in 3 files - Merged: 2020-09-03T07:17:52Z - Merge commit: 89879c7bf40d70fe9383a9b9d4f9205a7fdb8496 - Reviewers: kennytm ## Labels - status/LGT2 --- cherry-pick `#480` to release-4.0 --- Signed-off-by: Hillium <maruruku@stu.csust.edu.cn> <title>collector: remove cputime (`#970`)</title> GitHub pull request 1009 in pingcap/br (link omitted to avoid creating a cross-reference) # collector: remove cputime (`#970`) - State: merged - Author: ti-srebot - Created: 2021-04-14T08:18:32Z - Updated: 2021-04-15T09:43:55Z - Repository: pingcap/br - Number: `#1009` - +35 -35 in 4 files - Merged: 2021-04-15T09:43:55Z - Merge commit: 6ec2592e02d7587b65d48bd11ccb3ccc28e6dd11 - Reviewers: kennytm, 3pointer ## Labels - status/LGT2 - status/can-merge - component/backup - component/restore - type/5.0-cherry-pick - size/M - cherry-pick-approved --- cherry-pick `#970` to release-5.0 You can switch your code base to this Pull Request by using [git-extras](https://github.com/tj/git-extras): ```bash # In br repo: git pr https://github.com/pingcap/br/pull/1009 ``` After apply modifications, you can push your change to this PR via: ```bash git push git@github.com:ti-srebot/br.git pr/1009:release-5.0-aa5729a5a16f ``` ---

Citations:

  • 1: GitHub issue 1405 in pingcap/br (link omitted to avoid creating a cross-reference)
  • 2: GitHub issue 1270 in pingcap/br (link omitted to avoid creating a cross-reference)
  • 3: GitHub pull request 1132 in pingcap/br (link omitted to avoid creating a cross-reference)
  • 4: GitHub pull request 486 in pingcap/br (link omitted to avoid creating a cross-reference)

Use the decimal per-instance speed.

BR formats average-speed with decimal prefixes, so 2.661GB/s ÷ 15 is approximately 177.4 MB/s. 181.65 is not supported by the logged value, and changing the unit to MiB/s would not correct the calculation.

Suggested replacement
Suggested change
テスト結果から、1つの TiKV インスタンスを復元する平均速度は 181.65 MB/秒( `average-speed`/`tikv_count`に相当)であることがわかります。
テスト結果から、1つの TiKV インスタンスを復元する平均速度は約 177.4 MB/秒( `average-speed`/`tikv_count`に相当)であることがわかります。

Source: Path instructions

Comment thread br/br-log-architecture.md
3. ログバックアップオブザーバーは、KVの変更ログを継続的にバックアップします。

- **Read kv Change data** : KV 変更データを読み取り、変更ログ[カスタム形式でバックアップファイル](#log-backup-files)に保存します。
- **KV変更データの読み取り**:KV 変更データを読み取り、変更ログ[カスタム形式でバックアップファイル](#log-backup-files)に保存します。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the Japanese sentence and link phrase.

The source statement says that the change log is saved to backup files in custom format. Add after 変更ログ and use カスタム形式のバックアップファイル as the linked noun phrase.

Suggested change
- **KV変更データの読み取り**:KV 変更データを読み取り、変更ログ[カスタム形式でバックアップファイル](#log-backup-files)に保存します。
- **KV変更データの読み取り**:KV 変更データを読み取り、変更ログを[カスタム形式のバックアップファイル](`#log-backup-files`)に保存します。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **KV変更データの読み取り**:KV 変更データを読み取り、変更ログ[カスタム形式でバックアップファイル](#log-backup-files)に保存します。
- **KV変更データの読み取り**:KV 変更データを読み取り、変更ログを[カスタム形式のバックアップファイル](#log-backup-files)に保存します。

Comment thread br/br-snapshot-guide.md
- ターゲットクラスタは、バックアップデータと同じシステムテーブルを持っています。
- 対象クラスタのシステム権限テーブルの**列数は**、バックアップデータの列数と同じです。列の順序は重要ではありません。
- 対象クラスタのシステム権限テーブルの列は、バックアップデータの列と互換性があります。列のデータ型が長さを持つ型(整数や文字列など)の場合、対象クラスタの長さはバックアップデータの長さ以上でなければなりません。列のデータ型が`ENUM`型の場合、対象クラスタの`ENUM`値の数のスーパーセットでなければなりません。
- 対象クラスタのシステム権限テーブルの列は、バックアップデータの列と互換性があります。列のデータ型が長さを持つ型(整数や文字列など)の場合、対象クラスタの長さはバックアップデータの長さ以上でなければなりません。列のデータ型が`ENUM`型の場合、対象クラスタの`ENUM`値の数は、バックアップデータの`ENUM`値の数のスーパーセットでなければなりません。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Describe ENUM compatibility as value-set containment.

BR’s utils.IsTypeCompatible checks that every backup ENUM value exists in the target value set. A target count that is only greater than or equal to the backup count is not sufficient.

Suggested change
- 対象クラスタのシステム権限テーブルの列は、バックアップデータの列と互換性があります。列のデータ型が長さを持つ型(整数や文字列など)の場合、対象クラスタの長さはバックアップデータの長さ以上でなければなりません。列のデータ型が`ENUM`型の場合、対象クラスタの`ENUM`値の数は、バックアップデータの`ENUM`値の数のスーパーセットでなければなりません
- 対象クラスタのシステム権限テーブルの列は、バックアップデータの列と互換性があります。列のデータ型が長さを持つ型(整数や文字列など)の場合、対象クラスタの長さはバックアップデータの長さ以上でなければなりません。列のデータ型が`ENUM`型の場合、対象クラスタの`ENUM`値は、バックアップデータの`ENUM`値のスーパーセットでなければなりません

Comment thread br/use-br-command-line-tool.md Outdated
---
title: br Command-line Manual
summary: br` コマンドラインツールは、TiDB クラスターのスナップショットバックアップ、ログバックアップ、およびポイントインタイムリカバリ (PITR) に使用されます。サブコマンド、オプション、およびパラメータで構成されており、PD サービスアドレスの `--pd` やストレージパスの `-s` などの共通オプションがあります。サブコマンドには、それぞれ特定の機能を持つ `tiup br backup`、`tiup br log`、`tiup br restore` などがあります。バックアップコマンドには `full`、`db`、`table` オプションがあり、ログバックアップおよびリストアコマンドには、バックアップ操作を管理するためのさまざまなタスクがあります。
summary: `br` コマンドラインツールは、TiDB クラスターのスナップショットバックアップ、ログバックアップ、およびポイントインタイムリカバリ (PITR) に使用されます。サブコマンド、オプション、およびパラメータで構成されており、PD サービスアドレスの `--pd` やストレージパスの `-s` などの共通オプションがあります。サブコマンドには、それぞれ特定の機能を持つ `tiup br backup`、`tiup br log`、`tiup br restore` などがあります。バックアップコマンドには `full`、`db`、`table` オプションがあり、ログバックアップおよびリストアコマンドには、バックアップ操作を管理するためのさまざまなタスクがあります。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Call full, db, and table subcommands.

The summary calls these tokens “オプション”, but the page defines them as “サブコマンド”. This mismatch can lead readers to construct commands incorrectly. Apply this replacement:

Suggested change
summary: `br` コマンドラインツールは、TiDB クラスターのスナップショットバックアップ、ログバックアップ、およびポイントインタイムリカバリ (PITR) に使用されます。サブコマンド、オプション、およびパラメータで構成されており、PD サービスアドレスの `--pd` やストレージパスの `-s` などの共通オプションがあります。サブコマンドには、それぞれ特定の機能を持つ `tiup br backup``tiup br log``tiup br restore` などがあります。バックアップコマンドには `full``db``table` オプションがあり、ログバックアップおよびリストアコマンドには、バックアップ操作を管理するためのさまざまなタスクがあります。
summary: `br` コマンドラインツールは、TiDB クラスターのスナップショットバックアップ、ログバックアップ、およびポイントインタイムリカバリ (PITR) に使用されます。サブコマンド、オプション、およびパラメータで構成されており、PD サービスアドレスの `--pd` やストレージパスの `-s` などの共通オプションがあります。サブコマンドには、それぞれ特定の機能を持つ `tiup br backup``tiup br log``tiup br restore` などがあります。バックアップコマンドには `full``db``table` サブコマンドがあり、ログバックアップおよびリストアコマンドには、バックアップ操作を管理するためのさまざまなタスクがあります。

Source: Path instructions

## `br`コマンドラインの説明 {#br-command-line-description}

`br`コマンドは、サブコマンド、オプション、パラメータで構成されます。サブコマンドとは、 `-`または`--`含まない文字です。オプションとは、 `-`または`--`で始まる文字です。パラメータとは、サブコマンドまたはオプションの直後に続く文字で、サブコマンドまたはオプションに渡されます。
`br`コマンドは、サブコマンド、オプション、パラメータで構成されます。サブコマンドとは、 `-`または`--`を含まない文字です。オプションとは、 `-`または`--`で始まる文字です。パラメータとは、サブコマンドまたはオプションの直後に続く文字で、サブコマンドまたはオプションに渡されます。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Describe command components as strings, not characters.

The changed definition uses 文字, but backup, --pd, and their values are multi-character tokens. Use 文字列 so the definition matches the examples and the command syntax.

Suggested change
`br`コマンドは、サブコマンド、オプション、パラメータで構成されます。サブコマンドとは、 `-`または`--`を含まない文字です。オプションとは、 `-`または`--`で始まる文字です。パラメータとは、サブコマンドまたはオプションの直後に続く文字で、サブコマンドまたはオプションに渡されます
`br`コマンドは、サブコマンド、オプション、パラメータで構成されます。サブコマンドとは、`-`または`--`を含まない文字列です。オプションとは、`-`または`--`で始まる文字列です。パラメータとは、サブコマンドまたはオプションの直後に続き、サブコマンドまたはオプションに渡される文字列です

Source: Path instructions

yahonda and others added 4 commits September 16, 2026 13:12
Matches the "value + unit/time-unit" suffix style already used for
the sibling MB/秒 and GiB/秒 rates in the same file, rather than
leaving the literal EN abbreviation "h" unstyled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…tool.md

An unquoted YAML summary value starting with a backtick breaks the
website-docs HTML build (confirmed on PR pingcap#23824). The earlier fix in
this PR restored the missing opening backtick but left the value
unquoted; wrap the whole value in double quotes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The file predominantly uses パラメータ (no long vowel, 5+ occurrences
including the frontmatter summary); 3 sites used パラメーター instead.
Unified on the dominant form.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-command-line-tool.md

Per the standing no-space-between-katakana convention: "PD サービス
アドレス" unified to "PDサービスアドレス" (3 different spacings existed
across the file), plus "クラスター データ" and "リスニング アドレス"
each collapsed to a single compound.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant