Skip to content

Commit 189a68f

Browse files
authored
tidb-binlog: support binlog for clustered index (pingcap#5779) (pingcap#5788)
1 parent cbc96e6 commit 189a68f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

clustered-indexes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,15 @@ mysql> SELECT TIDB_PK_TYPE FROM information_schema.tables WHERE table_schema = '
140140

141141
## Limitations
142142

143-
Currently, there are two types of limitations for the clustered index feature. See the following:
143+
Currently, there are several different types of limitations for the clustered index feature. See the following:
144144

145145
- Situations that are not supported and not in the support plan:
146-
- Using the clustered index feature together with TiDB Binlog is not supported. After TiDB Binlog is enabled, TiDB only allows creating a single integer primary key as a clustered index. TiDB Binlog does not replicate data changes of existing tables with clustered indexes to the downstream. If you need to replicate tables with clustered indexes, use [TiCDC](/ticdc/ticdc-overview.md) instead.
147146
- Using clustered indexes together with the attribute [`SHARD_ROW_ID_BITS`](/shard-row-id-bits.md) is not supported. Also, the attribute [`PRE_SPLIT_REGIONS`](/sql-statements/sql-statement-split-region.md#pre_split_regions) does not take effect on tables with clustered indexes.
148147
- Downgrading tables with clustered indexes is not supported. If you need to downgrade such tables, use logical backup tools to migrate data instead.
149148
- Situations that are not supported yet but in the support plan:
150149
- Adding, dropping, and altering clustered indexes using `ALTER TABLE` statements are not supported.
150+
- Limitations for specific versions:
151+
- In v5.0, using the clustered index feature together with TiDB Binlog is not supported. After TiDB Binlog is enabled, TiDB only allows creating a single integer column as the clustered index of a primary key. TiDB Binlog does not replicate data changes (such as insertion, deletion, and update) on existing tables with clustered indexes to the downstream. If you need to replicate tables with clustered indexes to the downstream, upgrade your cluster to v5.1 or use [TiCDC](/ticdc/ticdc-overview.md) for replication instead.
151152

152153
After TiDB Binlog is enabled, if the clustered index you create is not a single integer primary key, TiDB returns the following error:
153154

tidb-binlog/tidb-binlog-overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ The TiDB Binlog cluster is composed of Pump and Drainer.
5353

5454
## Notes
5555

56-
* TiDB Binlog is not compatible with the following features introduced in TiDB v5.0 and they cannot be used together. It is recommended to use [TiCDC](/ticdc/ticdc-overview.md) instead of TiDB Binlog:
56+
* TiDB Binlog is incompatible with the following features introduced in TiDB v5.0 and they cannot be used together.
5757

58-
- [TiDB Clustered Index](/clustered-indexes.md#limitations): After TiDB Binlog is enabled, TiDB does not allow creating clustered indexes with non-single integer columns as primary keys; data insertion, deletion, and update of the created clustered index tables will not be replicated downstream via TiDB Binlog.
59-
- TiDB system variable [tidb_enable_async_commit](/system-variables.md#tidb_enable_async_commit-new-in-v50): After TiDB Binlog is enabled, performance cannot be improved by enabling this option.
60-
- TiDB system variable [tidb_enable_1pc](/system-variables.md#tidb_enable_1pc-new-in-v50): After TiDB Binlog is enabled, performance cannot be improved by enabling this option.
58+
- [TiDB Clustered Index](/clustered-indexes.md#limitations): After TiDB Binlog is enabled, TiDB does not allow creating clustered indexes with non-single integer columns as primary keys; data insertion, deletion, and update of the created clustered index tables will not be replicated downstream via TiDB Binlog. If you need to replicate tables with clustered indexes, upgrade your cluster to v5.1 or use [TiCDC](/ticdc/ticdc-overview.md) instead.
59+
- TiDB system variable [tidb_enable_async_commit](/system-variables.md#tidb_enable_async_commit-new-in-v50): After TiDB Binlog is enabled, performance cannot be improved by enabling this option. It is recommended to use [TiCDC](/ticdc/ticdc-overview.md) instead of TiDB Binlog.
60+
- TiDB system variable [tidb_enable_1pc](/system-variables.md#tidb_enable_1pc-new-in-v50): After TiDB Binlog is enabled, performance cannot be improved by enabling this option. It is recommended to use [TiCDC](/ticdc/ticdc-overview.md) instead of TiDB Binlog.
6161

6262
* TiDB Binlog is incompatible with the following feature introduced in TiDB v4.0.7 and they cannot be used together:
6363

0 commit comments

Comments
 (0)