pingcap / pingcap/tidb

Active-Active Replication Feature

Open
#64,281 0 comments 0 reactions 0 assignees View on GitHub
affects-8.5 type/feature-request
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

Design Doc: https://github.com/pingcap/tidb/pull/64294

# Development Tasks

## Feature Branches

Please merge the PRs to the feature branches:

- PD: https://github.com/tikv/pd/tree/feature/active-active
- TiDB: https://github.com/pingcap/tidb/tree/feature/active-active
- TiKV: https://github.com/tikv/tikv/tree/feature/active-active
- Client-go: https://github.com/tikv/client-go/tree/feature/active-active
- kvproto: https://github.com/pingcap/kvproto/tree/feature/active-active

##

1. **M1** : Milestone 1 (12/15): E2E MVP
2. **M2** : Milestone 2 (1/07): All Features

## SoftDelete

### TiDB

#### Parser & Optimizer

**M1**

- [x] https://github.com/pingcap/tidb/pull/64610
- [x] https://github.com/pingcap/tidb/pull/64892
- [x] https://github.com/pingcap/tidb/pull/64918
- [x] https://github.com/pingcap/tidb/pull/64993
- [x] https://github.com/pingcap/tidb/pull/65033
- [x] https://github.com/pingcap/tidb/pull/65013

**M2**

- [x] #65409
- [x] https://github.com/pingcap/tidb/pull/65053
- [x] https://github.com/pingcap/tidb/pull/65057
- [x] https://github.com/pingcap/tidb/pull/65199
- [x] https://github.com/pingcap/tidb/pull/65389

#### DDL

**M1**

- [x] #64512
- [x] #64856
- [x] #64962

**M2**

- [x] Create system table at bootstrap
- [x] Add `information_schema.tidb_softdelete_table_stats` system table. https://github.com/pingcap/tidb/pull/65409
- [x] Forbid hidden column in `CREATE TABLE/ADD COLUMN`
- [x] new DDL `ActionType` must be determined
- [x] https://github.com/pingcap/tidb/issues/64919#issue-3708768918
- [x] forbid creating indexes on `_tidb_commit_ts`
- [x] #65354
- [x] forbid creating unique indexes and constraits on `_tidb_origin_ts` and `_tidb_softdelete_time`
- [x] #65354

**M3**:

- [x] https://github.com/pingcap/tidb/pull/65400#discussion_r2675043203
- [x] https://github.com/pingcap/tidb/pull/65537
- [x] https://github.com/pingcap/tidb/pull/65638
- [ ] merge master branch for bootstrap refactor, cp master https://github.com/pingcap/tidb/pull/65400/changes#r2668084107 https://github.com/pingcap/tidb/pull/65409/changes#diff-01b1e4d5a7741315754aaa061f875bde2969c3f05c4670cc9623a74b3550fc2bR359
- [x] Parsing bug
```
TiDB root@localhost:test> CREATE TABLE `t4_gi` (
-> `id` int NOT NULL,
-> PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
-> /*T![softdelete] KEY `i1` (`_tidb_softdelete_time`) GLOBAL */,
-> KEY `i2` (`id`),
-> KEY `i3` (`id`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
-> PARTITION BY HASH (`id`) PARTITIONS 4
-> SOFTDELETE_JOB_INTERVAL='24h';
(1064, 'You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 9 column 24 near "SOFTDELETE_JOB_INTERVAL=\'24h\'" ')
TiDB root@localhost:test> CREATE TABLE `t4_gi` (
-> `id` int NOT NULL,
-> PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
-> /*T![softdelete] , KEY `i1` (`_tidb_softdelete_time`) GLOBAL */,
-> KEY `i2` (`id`),
-> KEY `i3` (`id`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
-> SOFTDELETE=RETENTION 7 DAY SOFTDELETE_JOB_INTERVAL='24h';
(1072, 'column does not exist: _tidb_softdelete_time')
```

#### Executors

**M1**

- [x] #64701
- [x] #64702
- [x] https://github.com/pingcap/tidb/pull/64961

**M2**

- [x] #65346
- [x] #65469
- [x] #65171
- [x] #65427
- [x] #64960

**M3**

- [x] https://github.com/pingcap/tidb/pull/65905
- [x] https://github.com/pingcap/tidb/pull/65923

## Active-Active Support

### PD

**M1**

- [x] https://github.com/tikv/pd/pull/9982

### proto

**M1**

- [x] https://github.com/pingcap/kvproto/issues/1373
- [x] https://github.com/pingcap/kvproto/pull/1371
- [x] [Merge active-active kvproto to master](https://github.com/pingcap/kvproto/pull/1382)

### TiKV

**M1**

- [x] https://github.com/tikv/tikv/pull/19103
- [x] https://github.com/tikv/tikv/pull/19166

### client-go

**M1**

- [x] https://github.com/tikv/client-go/issues/1795
- https://github.com/tikv/client-go/pull/1796
- https://github.com/tikv/client-go/pull/1798
- [x] #64797
- [x] Replace TiDB deps as the feature branch
- [x] Replace kvproto with master version

### TiDB

#### Parser & Optimizer

**M1**

- [x] Optimizer supports filtering new hidden columns.
- [x] Optimizer supports outputting the `_tidb_commit_ts` hidden column and passing corresponding information to the executor.

**M2**

- [x] https://github.com/pingcap/tidb/pull/65507

**M3**

- [x] https://github.com/pingcap/tidb/pull/65635

#### DDL

**M1**

- [x] Add `active_active` options and AST in parser, including comment format in restore
- [x] #64856
- [x] #64962

#### Executors & Transaction

**M1**

- [x] #64537
- #64538
- [x] #64893
- [x] #64721
- [x] #64720
- [x] https://github.com/pingcap/tidb/pull/64901
- [x] https://github.com/pingcap/tidb/pull/65174

**M2**

- [x] #65106
- [x] #65268
- [x] https://github.com/pingcap/tidb/pull/65443
- [x] https://github.com/pingcap/tidb/pull/65238

**M3**

- [x] https://github.com/pingcap/tidb/pull/65830

#### Observability

**M2**

- [x] #65269

#### TTL

- [x] https://github.com/pingcap/tidb/pull/65638

#### CDC

**M1**

- [x] https://github.com/pingcap/ticdc/pull/3299

**M2**

- [x] Support LWW Mode SQL as LWW
- [x] Create ticdcProgressTable to ensure data consistency
- [x] Support active table syncing in non-active-active mode
- [x] Support to collect metrics about how many rows skipped per changefeed / table

## Others

### Tool compatibility

**M3**

- [x] BR
- [x] Import into
- [x] lightning

## Master Cherry Pick

### TiKV

- [x] https://github.com/tikv/tikv/pull/19230
- [x] https://github.com/tikv/tikv/pull/19300
- [x] https://github.com/tikv/tikv/pull/19301
- [x] https://github.com/tikv/tikv/pull/19394
- [ ] https://github.com/tikv/tikv/pull/19333

### Client-go

- [x] https://github.com/tikv/client-go/pull/1831
- [x] https://github.com/tikv/client-go/pull/1842
- [x] https://github.com/tikv/client-go/pull/1847
- [x] https://github.com/tikv/client-go/pull/1864

### TiDB

- [x] https://github.com/pingcap/tidb/pull/64512
- [x] https://github.com/pingcap/tidb/pull/65295
- [x] https://github.com/pingcap/tidb/pull/65282
- [x] https://github.com/pingcap/tidb/pull/65306
- [x] https://github.com/pingcap/tidb/pull/65620

## Release-8.5

### kvproto

- [x] https://github.com/pingcap/kvproto/pull/1398

### client-go

- https://github.com/tikv/client-go/issues/1854
- [x] https://github.com/tikv/client-go/pull/1850
- [x] https://github.com/tikv/client-go/pull/1861
- [x] https://github.com/tikv/client-go/pull/1875

### TiKV

- https://github.com/tikv/tikv/issues/19312
- [x] https://github.com/tikv/tikv/pull/19295
- [x] https://github.com/tikv/tikv/pull/19397

### TiDB

- [x] https://github.com/pingcap/tidb/pull/65871
- [x] https://github.com/pingcap/tidb/pull/67544

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.