Skip to content

sql-statements: BR / PITR SQL enhancement #13663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BornChanger
Copy link
Contributor

@BornChanger BornChanger commented Apr 10, 2023

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 (in Chinese).

  • master (the latest development version)
  • v7.1 (TiDB 7.1 versions)
  • v7.0 (TiDB 7.0 versions)
  • v6.6 (TiDB 6.6 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)

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

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

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

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 10, 2023
@BornChanger
Copy link
Contributor Author

/cc @YuJuncen

@ti-chi-bot ti-chi-bot requested a review from YuJuncen April 10, 2023 13:20
@BornChanger
Copy link
Contributor Author

/cc @qiancai

@ti-chi-bot ti-chi-bot requested a review from qiancai April 10, 2023 13:21
@BornChanger
Copy link
Contributor Author

/cc @benmaoer

@ti-chi-bot ti-chi-bot requested a review from benmaoer April 10, 2023 13:22
@qiancai qiancai added the translation/doing This PR’s assignee is translating this PR. label Apr 10, 2023
@ti-chi-bot ti-chi-bot removed the missing-translation-status This PR does not have translation status info. label Apr 10, 2023
@qiancai qiancai self-assigned this Apr 10, 2023
@qiancai qiancai added missing-translation-status This PR does not have translation status info. v7.1 This PR/issue applies to TiDB v7.1. area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. and removed missing-translation-status This PR does not have translation status info. labels Apr 10, 2023
---
title: TiDB 日志备份与 PITR 语句
summary: 介绍 TiDB 日志备份与 PITR 的 SQL 语句。
aliases: ['/zh/tidb/dev/br-log-statement/']
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
aliases: ['/zh/tidb/dev/br-log-statement/']

Copy link
Collaborator

Choose a reason for hiding this comment

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

新文档不需要 aliases,aliases 用于添加被删除的文档的别名

Comment on lines +55 to +56
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

Comment on lines +75 to +76
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

Comment on lines +100 to +101
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

Comment on lines +139 to +140
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

Comment on lines +158 to +159
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

Comment on lines +183 to +184
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

Comment on lines +223 to +224
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

Comment on lines +28 to +29
{{< copyable "sql" >}}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< copyable "sql" >}}

summary: TiDB 数据库中 BR 作业管理语句的使用概况。
aliases: ['/docs-cn/dev/sql-statements/sql-statement-br-job-admin']
---

Copy link
Collaborator

Choose a reason for hiding this comment

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

缺少一级标题

Copy link
Collaborator

Choose a reason for hiding this comment

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

SHOW BR JOB [QUERY] 和 CANCEL BR JOB

Comment on lines +35 to +47
+----------+------------+-----------+-------------+---------------------+---------------------+
| Database | Table | Total_kvs | Total_bytes | Time_range_start | Time_range_end |
+----------+------------+-----------+-------------+---------------------+---------------------+
| tpcc | warehouse | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | district | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | stock | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | orders | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | customer | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | new_order | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | item | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | history | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | order_line | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
+----------+------------+-----------+-------------+---------------------+---------------------+
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
+----------+------------+-----------+-------------+---------------------+---------------------+
| Database | Table | Total_kvs | Total_bytes | Time_range_start | Time_range_end |
+----------+------------+-----------+-------------+---------------------+---------------------+
| tpcc | warehouse | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | district | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | stock | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | orders | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | customer | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | new_order | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | item | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | history | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
| tpcc | order_line | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 |
+----------+------------+-----------+-------------+---------------------+---------------------+
+----------+------------+-----------+-------------+------------------+---------------------+
| Database | Table | Total_kvs | Total_bytes | Time_range_start | Time_range_end |
+----------+------------+-----------+-------------+------------------+---------------------+
| tpcc | history | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | district | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | new_order | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | orders | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | order_line | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | customer | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | stock | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | warehouse | 0 | 0 | <null> | 2023-04-10 11:18:21 |
| tpcc | item | 0 | 0 | <null> | 2023-04-10 11:18:21 |
+----------+------------+-----------+-------------+------------------+---------------------+

I have made a change, which returns <nil> for full backups.


本文介绍 TiDB BR (BACKUP & RESTORE) 作业管理语句,包括下面几种语句:
```sql
SHOW BR JOB --show information of a br task
Copy link
Contributor

Choose a reason for hiding this comment

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

admin show br job 还是 show br job ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

admin show br job

```sql
SHOW BR JOB --show information of a br task
SHOW BR JOB QUERY --show the query statement of a br task
CANCEL BR JOB --cancel a br task
Copy link
Contributor Author

Choose a reason for hiding this comment

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

admin cancel br job

Copy link
Contributor

Choose a reason for hiding this comment

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

DDL 的 CANCEL 时使用 CANCEL DDL JOBS 关键字,是否和 DDL 保持一致

ADMIN CANCEL DDL JOBS job_id [, job_id] ...;

@qiancai qiancai added for-future-release This PR only applies to master for now and might cherry-pick to a future release. and removed v7.1 This PR/issue applies to TiDB v7.1. labels Apr 13, 2023
@Oreoxmt Oreoxmt added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 13, 2023
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 22, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented May 22, 2023

PR needs rebase.

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/test-infra repository.

@qiancai qiancai removed the for-future-release This PR only applies to master for now and might cherry-pick to a future release. label Jul 6, 2023
@qiancai qiancai added the v7.3 This PR/issue applies to TiDB v7.3. label Jul 6, 2023
@qiancai qiancai added for-future-release This PR only applies to master for now and might cherry-pick to a future release. and removed v7.3 This PR/issue applies to TiDB v7.3. labels Jul 19, 2023
{{< copyable "sql" >}}

```sql
SHOW BR JOB 13456;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SHOW BR JOB 13456;
SHOW BR JOBS where job_id = 13456;

Copy link
Contributor

@benmaoer benmaoer Sep 25, 2023

Choose a reason for hiding this comment

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

-- 100 是分页展示历史
SQL> SHOW BR JOBS 100;

-- 100 是 job_id
SQL> SHOW BR JOBS where job_id = 100;

-- 展示原始执行的 SQL 语句
SQL> SHOW BR JOB QUERIES 58;

{{< copyable "sql" >}}

```sql
SHOW BR JOB QUERY 13456;
Copy link
Contributor

Choose a reason for hiding this comment

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

建议添加上 SHOW BR JOB QUERIES where job_id = 13456 的返回结果

```sql
SHOW BR JOB --show information of a br task
SHOW BR JOB QUERY --show the query statement of a br task
CANCEL BR JOB --cancel a br task
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
CANCEL BR JOB --cancel a br task
CANCEL BR JOBS --cancel br tasks

Copy link

ti-chi-bot bot commented Jan 26, 2024

@BornChanger: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify b6dbf74 link true /test pull-verify

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. for-future-release This PR only applies to master for now and might cherry-pick to a future release. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. translation/doing This PR’s assignee is translating this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants