Skip to content
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

*: add mydumper #923

Merged
merged 11 commits into from
Oct 29, 2018
Merged

*: add mydumper #923

merged 11 commits into from
Oct 29, 2018

Conversation

CaitinChen
Copy link
Contributor

via pingcap/docs#644
@lilin90 @kennytm PTAL. Thanks!

@kennytm kennytm self-assigned this Oct 12, 2018
FAQ.md Outdated
@@ -656,7 +656,7 @@ TiDB 设计的目标就是针对 MySQL 单台容量限制而被迫做的分库

#### 3.6.1 TiDB 主要备份方式?

目前 TiDB 主要依赖 mydumper 逻辑导出进行备份,具体可以参考 [https://github.com/maxbube/mydumper](https://github.com/maxbube/mydumper),虽然 TiDB 也支持使用 MySQL 官方的 mysqldump 工具来进行数据的备份恢复工作,但相比于 mydumper/loader,性能会慢很多,大量数据的备份恢复会花费很多时间,这里我们并不推荐
目前,推荐的备份方式是使用 [PingCAP fork of mydumper](tools/mydumper.md)。尽管 TiDB 也支持使用 MySQL 官方工具 `mysqldump` 进行数据备份、恢复,但其性能低于 [`mydumper`](tools/mydumper.md)/[`loader`](tools/loader.md),并且该工具备份、恢复大量数量时,要耗费更多时间
Copy link
Contributor

Choose a reason for hiding this comment

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

"PingCAP fork of mydumper" can also be translated to Chinese 「PingCAP 的 mydumper 分支」。

FAQ.md Outdated

具体可以参考 [https://github.com/maxbube/mydumper](https://github.com/maxbube/mydumper)。
参见 [mydumper Instructions](tools/mydumper.md)。
Copy link
Contributor

Choose a reason for hiding this comment

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

"Instructions" → "使用文档"

FAQ.md Outdated

参见 [Loader Instructions](tools/loader.md)。
Copy link
Contributor

Choose a reason for hiding this comment

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

"Instructions" → "使用文档"


> **注意**:虽然 TiDB 也支持使用 MySQL 官方的 `mysqldump` 工具来进行数据的备份恢复工作,但相比于 `mydumper` / `loader`,性能会慢很多,大量数据的备份恢复会花费很多时间,这里我们并不推荐
> **注意**:必须使用 Enterprise Tools package 的 `mydumper`,不要使用你的操作系统的 package manager 提供的 `mydumper`。`mydumper` 的上游版本并不能正确对 TiDB 进行处理 ([#155](https://github.com/maxbube/mydumper/pull/155))。由于使用 `mydumper` 进行数据备份和恢复都要耗费许多时间,这里也并不推荐
Copy link
Contributor

Choose a reason for hiding this comment

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

"package" → 包
"package manager" → (软件)包管理工具

"Enterprise Tools" seems to be named as "企业版工具集" here (from what I've read from the Syncer docs).

由于使用 mydumper 进行数据备份和恢复都要耗费许多时间,这里也并不推荐。

"mydumper" should be mysqldump 🙃

tools/mydumper.md Show resolved Hide resolved

+ `INSERT` 语句中包含隐藏的 `_tidb_rowid` 列

+ 允许 `tidb_snapshot` 为 [configurable](../op-guide/history-read.md#how-tidb-reads-data-from-history-versions) (即备份之前的数据)
Copy link
Contributor

Choose a reason for hiding this comment

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

configurable = "可设置的", so I'd translate it as:

+ [允许设置](......) `tidb_snapshot` 的值 (即是可备份不同时间点的数据)

BTW the anchor #how-tidb-reads-data-from-history-versions probably needs to be updated to match the Chinese title.

```
-z, --tidb-snapshot: Set the tidb_snapshot to be used for the backup.
Default: NOW()-INTERVAL 1 SECOND.
Accepts either a TSO or valid datetime. For example: -z "2016-10-08 16:45:26"
Copy link
Contributor

Choose a reason for hiding this comment

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

This also needs to be translated as well I believe.


PingCAP 的 mydumper 源码 [位于 GitHub](https://github.com/pingcap/mydumper)。

### 是否计划未来让 PingCAP 的 mydumper 对上游的 mydumper 生效?
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be more natural to write this like

未来是否计划让 PingCAP 对 mydumper 的改动合并到上游?

@kennytm kennytm removed their assignment Oct 12, 2018
@CaitinChen
Copy link
Contributor Author

CaitinChen commented Oct 16, 2018

@kennytm Thanks a lot for your sharp eyes! PTAL again.
@lilin90 PTAL


> **注意**:虽然 TiDB 也支持使用 MySQL 官方的 `mysqldump` 工具来进行数据的备份恢复工作,但相比于 `mydumper` / `loader`,性能会慢很多,大量数据的备份恢复会花费很多时间,这里我们并不推荐
> **注意**:必须使用企业版工具集包 的 `mydumper`,不要使用你的操作系统的包管理工具提供的 `mydumper`。`mydumper` 的上游版本并不能正确对 TiDB 进行处理 ([#155](https://github.com/maxbube/mydumper/pull/155))。由于使用 `mysqldump` 进行数据备份和恢复都要耗费许多时间,这里也并不推荐
Copy link
Member

Choose a reason for hiding this comment

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

  • Delete the extra space after "工具集包".
  • It seems that "并不能对 TiDB 进行正确处理" sounds better.


### 新添参数

```
Copy link
Member

Choose a reason for hiding this comment

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

Add bash for the code block.


命令行参数:

```
Copy link
Member

Choose a reason for hiding this comment

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

Ditto


### 未来是否计划让 PingCAP 对 mydumper 的改动合并到上游?

是的,PingCAP 团队计划让此 mydumper 对上游的 mydumper 生效。参见 [PR #155](https://github.com/maxbube/mydumper/pull/155).
Copy link
Member

Choose a reason for hiding this comment

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

让此 mydumper 对上游的 mydumper 生效 -> 将对 mydumper 的改动合并到上游

## 相比于普通的 mydumper,此工具有哪些改进之处?

+ 使用 `tidb_snapshot` 而非 `FLUSH TABLES WITH READ LOCK` 提供备份一致性

Copy link
Member

Choose a reason for hiding this comment

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

For such a list without sublist or detailed explanation, the blank line between each item is unnecessary. You can just remove it.

@CaitinChen
Copy link
Contributor Author

@lilin90 Thanks. PTAL again.

Copy link
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

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

LGTM

@CaitinChen
Copy link
Contributor Author

@lilin90 Thanks.
@kennytm PTAL again.

Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

Rest LGTM.


```bash
-z, --tidb-snapshot: 设置 tidb_snapshot 用于备份
默认值:NOW()-INTERVAL 1 SECOND
Copy link
Contributor

Choose a reason for hiding this comment

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

The default value has been recently changed to the output of SHOW MASTER STATUS 🙂

Copy link

Choose a reason for hiding this comment

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

I've created pingcap/docs#693 to handle the defaults change.

@lilin90 lilin90 merged commit 00387c4 into pingcap:master Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants