Skip to content

cloud: add a doc for plan replayer - #23682

Merged
ti-chi-bot[bot] merged 9 commits into
release-8.5from
plan-replayer-on-premium
Sep 2, 2026
Merged

cloud: add a doc for plan replayer#23682
ti-chi-bot[bot] merged 9 commits into
release-8.5from
plan-replayer-on-premium

Conversation

@qqqdan

@qqqdan qqqdan commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

First-time contributors' checklist

What is changed, added or deleted? (Required)

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

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.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

Summary by CodeRabbit

  • New Features

    • Added a Plan Replayer guide for troubleshooting SQL performance in TiDB Cloud.
    • Documented how to generate Plan Replayer files with execution plans and historical statistics.
    • Added guidance for granting, extending, and revoking temporary Support access.
    • Included security, retention, and file-content review recommendations.
  • Documentation

    • Added Plan Replayer links to the Tune Performance sections of the TiDB Cloud Essentials and Premium table of contents.

@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 Aug 31, 2026
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review 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
📝 Walkthrough

Walkthrough

Plan Replayer documentation was added for TiDB Cloud. It covers file generation, Support access authorization, access management, security, and retention. Essential and Premium table of contents files now link to the guide.

Changes

Plan Replayer User Guide

Layer / File(s) Summary
Plan Replayer overview and prerequisites
tidb-cloud/plan-replayer.md, TOC-tidb-cloud-essential.md, TOC-tidb-cloud-premium.md
Introduces Plan Replayer, its troubleshooting use cases, prerequisites, file contents, and table of contents links.
Plan Replayer file generation
tidb-cloud/plan-replayer.md
Documents PLAN REPLAYER DUMP, execution plan options, historical statistics, and the generated file token.
Support authorization and file retention
tidb-cloud/plan-replayer.md
Documents Support access authorization, access extension and revocation, security considerations, and automatic file removal.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to 265f0

The guide currently gives Premium users an incorrect Plan Replayer download method, which may prevent them from retrieving diagnostic files; this documentation issue should be corrected before merge. Other requested changes are minor clarifications.

Suggested reviewers: huoyao1125, qiancai

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description retains the template but does not provide the required change summary, affected TiDB version, or related links. It also leaves all checkboxes unchanged. Complete the required sections. Describe the documentation changes and purpose, select the applicable TiDB version, add related PR or file links when available, and confirm the checklist items that apply.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main change: adding a TiDB Cloud Plan Replayer document. It is concise and relevant to the files changed.
Full details: Docstring Coverage

Explanation

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 files. (3 skipped: 3 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plan-replayer-on-premium

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.

@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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7842c10b-bb99-44ef-aa92-2d986344a5d0

📥 Commits

Reviewing files that changed from the base of the PR and between ae3312e and 7d30b76.

📒 Files selected for processing (1)
  • tidb-cloud/premium/plan-replayer-user-guide.md

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

Comment thread tidb-cloud/plan-replayer.md Outdated
Comment thread tidb-cloud/plan-replayer.md Outdated
@ti-chi-bot ti-chi-bot Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 31, 2026

@qw4990 qw4990 left a comment

Copy link
Copy Markdown
Contributor

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 commented Aug 31, 2026

Copy link
Copy Markdown

@qw4990: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

LGTM

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.

@ti-chi-bot ti-chi-bot Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 1, 2026

@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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 7e084e23-4f98-4f2a-86d7-a0b41841a9a2

📥 Commits

Reviewing files that changed from the base of the PR and between 311bc87 and 265f0dc.

📒 Files selected for processing (3)
  • TOC-tidb-cloud-essential.md
  • TOC-tidb-cloud-premium.md
  • tidb-cloud/plan-replayer.md

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

Comment thread tidb-cloud/plan-replayer.md Outdated

Plan Replayer is designed to share optimizer and execution-plan context without exporting actual table rows. Nevertheless, SQL text, object names, table definitions, configuration, bindings, and statistics can contain business-sensitive information. Use the minimum necessary access duration and revoke access after the investigation.

Plan Replayer files are temporary diagnostic artifacts. TiDB may remove generated files automatically after their retention period. Generate a new file if the previous identifier has expired or is no longer available.

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

🔎 Supported by static analysis

🏁 Script executed:

printf '%s\n' '--- repository knowledge files ---'
find /tmp/coderabbit-repo-knowledge/pingcap-docs-9c73f70c -maxdepth 2 -type f -print
printf '%s\n' '--- scoped convention headers ---'
head -5 /tmp/coderabbit-repo-knowledge/pingcap-docs-9c73f70c/*/*.md 2>/dev/null
printf '%s\n' '--- target document ---'
cat -n tidb-cloud/plan-replayer.md | sed -n '1,100p'
printf '%s\n' '--- referenced contract ---'
cat -n sql-plan-replayer.md | sed -n '50,90p'

Repository: pingcap/docs

Length of output: 9321


🏁 Script executed:

printf '%s\n' '--- Plan Replayer files and retention references ---'
git ls-files '*plan-replayer*'
rg -n -i -C 2 'at most one hour|retention period|retention policy|Plan Replayer files|SQL Plan Replayer Files Access Authorization' --glob '*.md' --glob '*.mdx' .
printf '%s\n' '--- target diff summary and hunk ---'
git diff --stat -- tidb-cloud/plan-replayer.md
git diff -- tidb-cloud/plan-replayer.md | sed -n '1,180p'

Repository: pingcap/docs

Length of output: 48079


🌐 Web query:

TiDB Cloud release 8.5 Plan Replayer file retention at most one hour

💡 Result:

In TiDB, including version 8.5, ZIP files generated by the PLAN REPLAYER command are stored in the TiDB cluster for a maximum of one hour, after which they are automatically deleted [1][2]. It is important to distinguish this from the PLAN REPLAYER CAPTURE functionality, where the resulting files are retained in the cluster for up to one week [1][2][3]. The one-hour retention for standard PLAN REPLAYER files is a built-in behavior, and users are advised to download the file promptly after generation to avoid data loss [1][4]. While community discussions have noted this constraint and explored potential improvements, the one-hour retention remains the standard behavior in current versions [5].

Citations:


Document the one-hour retention period.

Suggested change
Plan Replayer files are temporary diagnostic artifacts. TiDB may remove generated files automatically after their retention period. Generate a new file if the previous identifier has expired or is no longer available.
Plan Replayer files are temporary diagnostic artifacts. TiDB stores generated ZIP files for at most one hour and deletes them after one hour. Generate a new file if the previous identifier has expired or is no longer available.

qiancai and others added 4 commits September 1, 2026 13:59
@qiancai
qiancai force-pushed the plan-replayer-on-premium branch from 2a936c6 to 1a4c2b4 Compare September 1, 2026 08:41
@qiancai qiancai self-assigned this Sep 1, 2026
@qiancai qiancai added translation/no-need No need to translate this PR. area/tidb-cloud This PR relates to the area of TiDB Cloud. labels Sep 1, 2026
@ti-chi-bot ti-chi-bot Bot removed the missing-translation-status This PR does not have translation status info. label Sep 1, 2026
@qiancai qiancai added the for-cloud-release This PR is related to TiDB Cloud release. label Sep 1, 2026
@qiancai qiancai changed the title Create plan-replayer-user-guide.md cloud: add a doc for plan replayer Sep 1, 2026
@qiancai

qiancai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

/approve

@qiancai qiancai added the lgtm label Sep 2, 2026
@ti-chi-bot ti-chi-bot Bot added the approved label Sep 2, 2026
Comment thread tidb-cloud/plan-replayer.md Outdated
@qiancai qiancai added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 2, 2026
Comment thread tidb-cloud/plan-replayer.md Outdated
Comment thread tidb-cloud/plan-replayer.md Outdated
@qiancai

qiancai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

/approve

@ti-chi-bot

ti-chi-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiancai

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

@qiancai qiancai removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 2, 2026
@ti-chi-bot
ti-chi-bot Bot merged commit 75a79ad into release-8.5 Sep 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved area/tidb-cloud This PR relates to the area of TiDB Cloud. for-cloud-release This PR is related to TiDB Cloud release. lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files. translation/no-need No need to translate this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants