Skip to content

lake: update vacuum commands - #23860

Open
lilin90 wants to merge 5 commits into
pingcap:release-8.5from
lilin90:lake-0913
Open

lilin90 wants to merge 5 commits into
pingcap:release-8.5from
lilin90:lake-0913

Conversation

@lilin90

@lilin90 lilin90 commented Sep 15, 2026

Copy link
Copy Markdown
Member

What is changed, added, or deleted? (Required)

Added, deleted, and updated VACUUM command docs.

Note

This PR also removed tidb-cloud-lake/guides/data-management.md because it's an outdated index page that won't be used.

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)?

  • Related code change PR links (if applicable):
  • 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

Documentation

  • Added guidance for VACUUM ALL, VACUUM TABLES, and VACUUM DROPPED OBJECTS, including scopes, privileges, retention, protections, and failure handling.
  • Updated VACUUM TABLE, VACUUM TEMPORARY FILES, and OPTIMIZE TABLE documentation with revised behavior and examples.
  • Updated navigation and command references throughout TiDB Cloud Lake documentation.
  • Replaced VACUUM DROP TABLE guidance with dropped-object cleanup documentation.
  • Removed obsolete vacuum options, references, and the standalone data-management overview.

Align the TiDB Cloud Lake VACUUM documentation with the renamed VACUUM DROPPED OBJECTS pages, remove the obsolete SQL-specific page, and refresh the table of contents to point at the current canonical docs. This also adds the legacy alias for VACUUM TABLE so existing links continue to resolve.
@lilin90
lilin90 requested a review from awxxxxxx September 15, 2026 03:47
@lilin90 lilin90 self-assigned this Sep 15, 2026
@lilin90 lilin90 added translation/no-need No need to translate this PR. lake Related to TiDB Cloud Lake docs. labels Sep 15, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 15, 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 ask for approval from lilin90. 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 the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 15, 2026
@coderabbitai

coderabbitai Bot commented Sep 15, 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
📝 Walkthrough

Walkthrough

The documentation replaces VACUUM DROP TABLE with separate commands for table history, dropped objects, temporary files, and combined cleanup. It updates syntax, privileges, retention rules, failure handling, optimization guidance, and cross-references.

Changes

VACUUM command reference

Layer / File(s) Summary
Command reference pages
tidb-cloud-lake/sql/vacuum-table.md, tidb-cloud-lake/sql/vacuum-dropped-objects.md, tidb-cloud-lake/sql/vacuum-tables.md, tidb-cloud-lake/sql/vacuum-temporary-files.md, tidb-cloud-lake/sql/vacuum-all.md, tidb-cloud-lake/sql/vacuum-drop-table*.md, tidb-cloud-lake/sql/vacuum-table-sql.md
The reference pages define separate cleanup scopes, syntax, privileges, retention behavior, protection rules, and failure handling. The obsolete command pages are removed.
Cleanup workflow guide
tidb-cloud-lake/guides/data-purge-and-recycle.md, tidb-cloud-lake/guides/data-management.md
The guide documents cleanup scope, retention settings, snapshot-tag protection, skipped tables, errors, cancellation, and sequential VACUUM ALL execution. The former data-management overview is removed.
Optimization and cleanup relationship
tidb-cloud-lake/sql/optimize-table.md, tidb-cloud-lake/sql/ddl-table-overview.md
The documentation describes OPTIMIZE TABLE as compaction and VACUUM TABLE as historical-data cleanup. It adds a combined usage example.
Reference navigation updates
TOC-tidb-cloud-lake.md, tidb-cloud-lake/sql/administration-commands.md, tidb-cloud-lake/sql/drop-table.md
Navigation tables and cross-references use the new command names and page targets.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: 🔵 Low · up to ca456

Readers may miss the VACUUM TABLES reference and misunderstand when historical snapshots are eligible for irreversible cleanup. These are localized documentation fixes with no runtime impact.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: updating VACUUM command documentation for Lake.
Description check ✅ Passed The description covers the documentation changes, deleted index page, affected TiDB version, and required template sections. The delete-files checkbox is not selected despite deleted files, but the de…
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.

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 2cba7346-7b00-484a-8703-eb348d860fd4

📥 Commits

Reviewing files that changed from the base of the PR and between cf67bca and 738ad10.

📒 Files selected for processing (14)
  • TOC-tidb-cloud-lake.md
  • tidb-cloud-lake/guides/data-purge-and-recycle.md
  • tidb-cloud-lake/sql/administration-commands.md
  • tidb-cloud-lake/sql/ddl-table-overview.md
  • tidb-cloud-lake/sql/drop-table.md
  • tidb-cloud-lake/sql/optimize-table.md
  • tidb-cloud-lake/sql/vacuum-all.md
  • tidb-cloud-lake/sql/vacuum-drop-table-sql.md
  • tidb-cloud-lake/sql/vacuum-drop-table.md
  • tidb-cloud-lake/sql/vacuum-dropped-objects.md
  • tidb-cloud-lake/sql/vacuum-table-sql.md
  • tidb-cloud-lake/sql/vacuum-table.md
  • tidb-cloud-lake/sql/vacuum-tables.md
  • tidb-cloud-lake/sql/vacuum-temporary-files.md
💤 Files with no reviewable changes (3)
  • tidb-cloud-lake/sql/vacuum-drop-table.md
  • tidb-cloud-lake/sql/vacuum-table-sql.md
  • tidb-cloud-lake/sql/vacuum-drop-table-sql.md

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

Comment thread tidb-cloud-lake/guides/data-purge-and-recycle.md Outdated
Comment thread tidb-cloud-lake/guides/data-purge-and-recycle.md
Comment thread tidb-cloud-lake/sql/drop-table.md Outdated
Comment thread tidb-cloud-lake/sql/optimize-table.md Outdated

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

🟡 Minor · Document the snapshot-count retention override. · tidb-cloud-lake/guides/data-purge-and-recycle.md:79-79

79-79: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document the snapshot-count retention override.

When data_retention_num_snapshots_to_keep is nonzero, it overrides data_retention_time_in_days for table-history VACUUM. The guide omits this rule. Keep the override scoped to table history, not dropped objects.

Committable suggestion
-For table history and dropped objects, use `data_retention_time_in_days` (1 day by default). For example, set a 2-day retention period for the current session:
+For table history and dropped objects, use `data_retention_time_in_days` (1 day by default). For table history, `data_retention_num_snapshots_to_keep` overrides this setting when it is nonzero. For example, set a 2-day retention period for the current session:
🟡 Minor · Document the snapshot-count retention override. · tidb-cloud-lake/sql/vacuum-table.md:23-33

23-33: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document the snapshot-count retention override.

data_retention_num_snapshots_to_keep overrides data_retention_time_in_days during vacuum operations when it is nonzero. Add this rule so users understand which historical snapshots VACUUM TABLE can clean up.

Committable suggestion
-Cleanup respects `data_retention_time_in_days` (1 day by default). Historical data that has been removed cannot be queried through Time Travel or restored with Flashback.
+Cleanup respects `data_retention_time_in_days` (1 day by default). When `data_retention_num_snapshots_to_keep` is nonzero, it overrides `data_retention_time_in_days` during vacuum operations. Historical data that has been removed cannot be queried through Time Travel or restored with Flashback.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: bc608b09-740c-4158-9f77-f1f7d5878f7d

📥 Commits

Reviewing files that changed from the base of the PR and between 738ad10 and 7a6abdd.

📒 Files selected for processing (4)
  • tidb-cloud-lake/guides/data-management.md
  • tidb-cloud-lake/guides/data-purge-and-recycle.md
  • tidb-cloud-lake/sql/drop-table.md
  • tidb-cloud-lake/sql/optimize-table.md
💤 Files with no reviewable changes (1)
  • tidb-cloud-lake/guides/data-management.md

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

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Document snapshot-count retention for VACUUM. · tidb-cloud-lake/guides/data-purge-and-recycle.md:77-92

77-92: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document snapshot-count retention for VACUUM. data_retention_num_snapshots_to_keep defaults to 0 and is ignored at that value. When nonzero, it overrides data_retention_time_in_days; table-level values take precedence over session and global settings, and VACUUM keeps the specified number of most recent snapshots. Add this setting and its precedence to the retention section. Otherwise, users may expect older snapshots to become eligible based on age when count-based retention still preserves them.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 0ea8ae58-11af-4b89-b0f6-d559d61702c5

📥 Commits

Reviewing files that changed from the base of the PR and between 7a6abdd and ca4567d.

📒 Files selected for processing (1)
  • tidb-cloud-lake/sql/vacuum-table.md

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lake Related to TiDB Cloud Lake docs. size/XXL Denotes a PR that changes 1000+ 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.

1 participant