You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document database-level read-only mode for migration cutover and data validation:
Add a feature guide covering read-only state changes, transaction draining, SQL restrictions, explicit privilege bypass, MySQL compatibility, and interactions with import, backup, restore, and replication tools.
Add the INFORMATION_SCHEMA.SCHEMATA_EXTENSIONS reference and query example.
Update ALTER DATABASE, SHOW CREATE DATABASE, privilege descriptions, system-variable cross-references, and navigation entries.
Database-level read-only mode is introduced in TiDB v8.5.9. The sequence restore fix in pingcap/tidb#73801 is included in the same release, so no separate version qualification is needed for SQL restoration of sequences in read-only databases.
Validation: Markdown formatting, internal links, link anchors, new-page metadata, and git diff --check passed.
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.
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 database-level read-only mode, including how to enable and check it, its effects on transactions and SQL operations, privilege requirements, compatibility limits, interactions with TiDB tools, and recovery steps.
Documented the READ ONLY option for ALTER DATABASE, its supported values, and examples for enabling read-only mode and restoring write access.
Added documentation for INFORMATION_SCHEMA.SCHEMATA_EXTENSIONS, including its columns, database settings, and a query example, with navigation links to related pages.
Clarified how database-level read-only mode interacts with privileges and cluster-wide restrictions, and how it appears in SHOW CREATE DATABASE output.
In response to a cherrypick label: @expxiaoli once the present PR merges, I will cherry-pick it on top of release-8.5 in a new PR and assign it to you.
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign tangenta 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:
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.
The documentation adds coverage for database-level read-only mode, including SQL controls, transaction behavior, restrictions, privileges, tool interactions, and metadata reporting.
Changes: Database-Level Read-Only Mode
Layer / File(s)
Summary
SQL controls and transition behavior TOC.md, database-read-only.md, sql-statements/sql-statement-alter-database.md, sql-statements/sql-statement-show-create-database.md
Documents how to enable, check, and disable database-level read-only mode. Covers transaction behavior and the read-only setting in SHOW CREATE DATABASE output.
Restrictions and privilege behavior database-read-only.md, privilege-management.md, system-variables.md
Documents SQL restrictions, bypass privilege requirements, cluster-wide read-only restrictions, batch-DML behavior, and interactions with TiDB tools.
Metadata and documentation navigation information-schema/information-schema-schemata-extensions.md, information-schema/information-schema.md, TOC.md, database-read-only.md
Documents SCHEMATA_EXTENSIONS, its OPTIONS values, an example, and related navigation links.
The new read-only mode documentation is mostly complete. Before publishing, state the first supported release and qualify the PITR statement for existing target databases, so readers do not rely on read-only protection that may not be present.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title states the primary change: documentation for database-level read-only mode. The changeset adds a feature guide for that mode and updates related references, so the title matches the main cha…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The PR description follows the repository template. It fills in the required 'What is changed, added, or deleted?' section with a clear list of documentation changes and the reason for them. It also f…
Full details: Title check
Explanation
The title states the primary change: documentation for database-level read-only mode. The changeset adds a feature guide for that mode and updates related references, so the title matches the main change.
Full details: Description check
Explanation
The PR description follows the repository template. It fills in the required 'What is changed, added, or deleted?' section with a clear list of documentation changes and the reason for them. It also fills in the version checklist (master and v8.5), lists related code PRs and a reference link, and records the AI agent involvement checkbox. The author reports validation results. The description leaves out the first-time contributor checklist, which is optional for this check. The 'This PR is translated from' field is blank, which is acceptable because the PR is not a translation. The description is complete and specific enough for reviewers.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Reviewing files that changed from the base of the PR and between 0ddb06f and f59a816.
Files selected for processing: 1
database-read-only.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Reviewing files that changed from the base of the PR and between f59a816 and e6e53b6.
Files selected for processing: 1
database-read-only.md
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
I checked the read-only transition and rollback, privilege enforcement, SCHEMATA_EXTENSIONS output, batch DML, and restore behavior against the merged TiDB implementation and its tests. The Markdown, links, and anchors passed CI.
One P2 remains for the release-8.5 documentation: the guide promises SQL restoration of sequences into read-only databases while the required fix is still open. The table should condition that behavior on a release that includes the fix.
The reason will be displayed to describe this comment to others. Learn more.
Re-reviewed commit dd8f12a910 and the full PR diff.
The previous P2 on SQL sequence restore versioning for release-8.5 is resolved: database-read-only.md now explicitly states Starting from v8.5.9 and removes the version TODO, and on pingcap/tidbrelease-8.5 both the database read-only feature (pingcap/tidb#73575) and the SQL sequence restore fix (pingcap/tidb#73801) are merged after v8.5.8, so they ship together in v8.5.9 without needing a separate version caveat.
All other files in the PR are unchanged since the prior technical verification against the TiDB implementation, and all docs CI checks (vale, linkChecker, and internal link/TOC/anchor checks) pass on dd8f12a910.
Re-reviewed commit dd8f12a910 and the full PR diff.
The previous P2 on SQL sequence restore versioning for release-8.5 is resolved: database-read-only.md now explicitly states Starting from v8.5.9 and removes the version TODO, and on pingcap/tidbrelease-8.5 both the database read-only feature (pingcap/tidb#73575) and the SQL sequence restore fix (pingcap/tidb#73801) are merged after v8.5.8, so they ship together in v8.5.9 without needing a separate version caveat.
All other files in the PR are unchanged since the prior technical verification against the TiDB implementation, and all docs CI checks (vale, linkChecker, and internal link/TOC/anchor checks) pass on dd8f12a910.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first-time-contributorIndicates that the PR was contributed by an external member and is a first-time contributor.missing-translation-statusThis PR does not have translation status info.needs-cherry-pick-release-8.5Should cherry pick this PR to release-8.5 branch.size/LDenotes a PR that changes 100-499 lines, ignoring generated files.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is changed, added, or deleted? (Required)
Document database-level read-only mode for migration cutover and data validation:
INFORMATION_SCHEMA.SCHEMATA_EXTENSIONSreference and query example.ALTER DATABASE,SHOW CREATE DATABASE, privilege descriptions, system-variable cross-references, and navigation entries.Database-level read-only mode is introduced in TiDB v8.5.9. The sequence restore fix in pingcap/tidb#73801 is included in the same release, so no separate version qualification is needed for SQL restoration of sequences in read-only databases.
Validation: Markdown formatting, internal links, link anchors, new-page metadata, and
git diff --checkpassed.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.
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?
Summary by CodeRabbit
READ ONLYoption forALTER DATABASE, its supported values, and examples for enabling read-only mode and restoring write access.INFORMATION_SCHEMA.SCHEMATA_EXTENSIONS, including its columns, database settings, and a query example, with navigation links to related pages.SHOW CREATE DATABASEoutput.