Skip to content

Commit

Permalink
DTFile supports V3 version (#14460)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiancai authored Aug 8, 2023
1 parent 1841639 commit d9a2e54
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
- [Use TiUP](/upgrade-tidb-using-tiup.md)
- [Use TiDB Operator](https://docs.pingcap.com/tidb-in-kubernetes/stable/upgrade-a-tidb-cluster)
- [TiDB Smooth Upgrade](/smooth-upgrade-tidb.md)
- [TiFlash v6.2.0 Upgrade Guide](/tiflash-620-upgrade-guide.md)
- [TiFlash Upgrade Guide](/tiflash-upgrade-guide.md)
- Scale
- [Use TiUP (Recommended)](/scale-tidb-using-tiup.md)
- [Use TiDB Operator](https://docs.pingcap.com/tidb-in-kubernetes/stable/scale-a-tidb-cluster)
Expand Down
4 changes: 2 additions & 2 deletions releases/release-6.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ In v6.2.0-DMR, the key new features and improvements are as follows:

In TiDB v6.2.0, data is stored in the new storage format by default. Note that if TiFlash is upgraded from earlier versions to v6.2.0, you cannot perform in-place downgrade on TiFlash, because earlier TiFlash versions cannot recognize the new storage format.

For more information about upgrading TiFlash, see [TiFlash v6.2.0 Upgrade Guide](/tiflash-620-upgrade-guide.md).
For more information about upgrading TiFlash, see [TiFlash Upgrade Guide](/tiflash-upgrade-guide.md).

[User document](/tiflash/tiflash-configuration.md#configure-the-tiflashtoml-file) [#3594](https://github.com/pingcap/tiflash/issues/3594) @[JaySon-Huang](https://github.com/JaySon-Huang) @[lidezhu](https://github.com/lidezhu) @[jiaqizho](https://github.com/jiaqizho)

Expand Down Expand Up @@ -301,7 +301,7 @@ In v6.2.0-DMR, the key new features and improvements are as follows:

### Others

- TiFlash `format_version` cannot be downgraded from `4` to `3`. For details, see [TiFlash v6.2.0 Upgrade Guide](/tiflash-620-upgrade-guide.md).
- TiFlash `format_version` cannot be downgraded from `4` to `3`. For details, see [TiFlash Upgrade Guide](/tiflash-upgrade-guide.md).
- In v6.2.0 and later versions, it is strongly recommended to keep the default value `false` of `dt_enable_logical_split` and not to change it to `true`. For details, see known issue [#5576](https://github.com/pingcap/tiflash/issues/5576).
- If the backup cluster has a TiFlash replica, after you perform PITR, the restoration cluster does not contain the data in the TiFlash replica. To restore data from the TiFlash replica, you need to manually configure TiFlash replicas. Executing the `exchange partition` DDL statement might result in a failure of PITR. If the upstream database uses TiDB Lightning's physical import mode to import data, the data cannot be backed up in log backup. It is recommended to perform a full backup after the data import. For other compatibility issues of PITR, see [PITR limitations](/br/backup-and-restore-overview.md#before-you-use).
- Since TiDB v6.2.0, you can restore table in `mysql` schema by specifying the parameter `--with-sys-table=true` when restoring data.
Expand Down
15 changes: 11 additions & 4 deletions tiflash-620-upgrade-guide.md → tiflash-upgrade-guide.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: TiFlash v6.2 Upgrade Guide
summary: Learn the precautions when you upgrade TiFlash to v6.2.
title: TiFlash Upgrade Guide
summary: Learn the precautions when you upgrade TiFlash.
aliases: ['/tidb/dev/tiflash-620-upgrade-guide']
---

# TiFlash v6.2 Upgrade Guide
# TiFlash Upgrade Guide

This document describes the functional changes in TiFlash modules you need to pay attention to when you upgrade TiFlash from earlier versions to v6.2, and recommended actions for you to take.
This document describes the function changes and recommended actions that you need to learn when you upgrade TiFlash.

To learn the standard upgrade process, see the following documents:

Expand Down Expand Up @@ -84,3 +85,9 @@ You can forcibly scale in the target TiFlash node and then replicate data from T
## From v6.1 to v6.2

When you upgrade TiFlash from v6.1 to v6.2, pay attention to the change in data storage format. For details, see [PageStorage](#pagestorage).

## From v6.x or v7.x to v7.3 with `storage.format_version = 5` configured

Starting from v7.3, TiFlash introduces a new DTFile version: DTFile V3 (experimental). This new DTFile version can merge multiple small files into a single larger file to reduce the total number of files. In v7.3, the default DTFile version is still V2. To use V3, you can set the [TiFlash configuration parameter](/tiflash/tiflash-configuration.md) `storage.format_version = 5`. After the setting, TiFlash can still read V2 DTFiles and will gradually rewrite existing V2 DTFiles to V3 DTFiles during subsequent data compaction.

After upgrading TiFlash to v7.3 and configuring TiFlash to use V3 DTFiles, if you need to revert TiFlash to an earlier version, you can use the DTTool offline to rewrite V3 DTFiles back to V2 DTFiles. For more information, see [DTTool Migration Tool](/tiflash/tiflash-command-line-flags.md#dttool-migrate).
3 changes: 2 additions & 1 deletion tiflash/tiflash-command-line-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ This document introduces the command-line flags that you can use when you launch
- If you need to downgrade TiFlash from a version >= v5.4.0 that has enabled data validation to a version < v5.4.0, you can use this tool to downgrade the data format of the DTFile.
- If you upgrade TiFlash to a version >= v5.4.0, and if you hope to enable data validation for existing data, you can use this tool to upgrade the data format of the DTFile.
- Test the space usage and read speed of the DTFile in different configurations.
- If you need to downgrade TiFlash from a version >= v7.3.0 that has enabled small file merging (that is, `storage.format_version` >= 5) to a version < v7.3.0, you can use this tool to downgrade the data format of the DTFile.

- Parameters:
- `--imitative`: When you do not use the encryption feature of the DTFile, you can use this flag to avoid using the configuration file and connecting to PD.
- `--version`: The version of DTFile. The value options are `1` and `2` (default). `1` is the old version, and `2` is the version corresponding to the new checksum.
- `--version`: The target version of DTFile. The value options are `1`, `2` (default), and `3`. `1` is the old version, `2` is the version corresponding to the new checksum, and `3` is the version that supports merging small files.
- `--algorithm`: The hash algorithm used for data validation. The value options are `xxh3` (default), `city128`, `crc32`, `crc64`, and `none`. This parameter is effective only when `version` is `2`.
- `--frame`: The size of the validation frame. The default value is `1048576`. This parameter is effective only when `version` is `2`.
- `--compression`: The target compression algorithm. The value options are `LZ4` (default), `LZ4HC`, `zstd`, and `none`.
Expand Down
1 change: 1 addition & 0 deletions tiflash/tiflash-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ delta_index_cache_size = 0
## * format_version = 2, the default format for versions < v6.0.0.
## * format_version = 3, the default format for v6.0.0 and v6.1.x, which provides more data validation features.
## * format_version = 4, the default format for v6.2.0 and later versions, which reduces write amplification and background task resource consumption
## * format_version = 5, a new format introduced in v7.3.0 (not the default format for v7.3.0) that reduces the number of physical files by merging smaller files. Note that this format is experimental and not recommended to be used in a production environment.
# format_version = 4

[storage.main]
Expand Down

0 comments on commit d9a2e54

Please sign in to comment.