Skip to content

Commit

Permalink
ticdc: move the mysql downstream user permission info to the mysql si…
Browse files Browse the repository at this point in the history
…nk doc (pingcap#18390)
  • Loading branch information
qiancai authored Jul 29, 2024
1 parent cd3fbda commit 62314d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
16 changes: 0 additions & 16 deletions ticdc/ticdc-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,6 @@ TiCDC guarantees that all data is replicated at least once. When there is duplic

In versions earlier than v6.1.3, `safe-mode` defaults to `true`, which means all `INSERT` and `UPDATE` statements are converted into `REPLACE INTO` statements. In v6.1.3 and later versions, TiCDC can automatically determine whether the downstream has duplicate data, and the default value of `safe-mode` changes to `false`. If no duplicate data is detected, TiCDC replicates `INSERT` and `UPDATE` statements without conversion.

## When the sink of the replication downstream is TiDB or MySQL, what permissions do users of the downstream database need?

When the sink is TiDB or MySQL, the users of the downstream database need the following permissions:

- `Select`
- `Index`
- `Insert`
- `Update`
- `Delete`
- `Create`
- `Drop`
- `Alter`
- `Create View`

If you need to replicate `recover table` to the downstream TiDB, you should have the `Super` permission.

## Why does TiCDC use disks? When does TiCDC write to disks? Does TiCDC use memory buffer to improve replication performance?

When upstream write traffic is at peak hours, the downstream may fail to consume all data in a timely manner, resulting in data pile-up. TiCDC uses disks to process the data that is piled up. TiCDC needs to write data to disks during normal operation. However, this is not usually the bottleneck for replication throughput and replication latency, given that writing to disks only results in latency within a hundred milliseconds. TiCDC also uses memory to accelerate reading data from disks to improve replication performance.
Expand Down
20 changes: 19 additions & 1 deletion ticdc/ticdc-sink-to-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following are descriptions of sink URI parameters and parameter values that

| Parameter/Parameter value | Description |
| :------------ | :------------------------------------------------ |
| `root` | The username of the downstream database. |
| `root` | The username of the downstream database. To replicate data to TiDB or other MySQL-compatible databases, make sure that the downstream database user has [certain permissions](#permissions-required-for-the-downstream-database-user). |
| `123456` | The password of the downstream database (can be encoded using Base64). |
| `127.0.0.1` | The IP address of the downstream database. |
| `3306` | The port for the downstream data. |
Expand Down Expand Up @@ -82,6 +82,24 @@ MTIzNDU2
>
> When the sink URI contains special characters such as `! * ' ( ) ; : @ & = + $ , / ? % # [ ]`, you need to escape the special characters, for example, in [URI Encoder](https://www.urlencoder.org/).
## Permissions required for the downstream database user

To replicate data to TiDB or other MySQL-compatible databases, the downstream database user needs the following permissions:

- `Select`
- `Index`
- `Insert`
- `Update`
- `Delete`
- `Create`
- `Drop`
- `Alter`
- `Create View`

To replicate [`RECOVER TABLE`](/sql-statements/sql-statement-recover-table.md) to the downstream TiDB, the downstream database user also needs the `Super` permission.

If the downstream TiDB cluster has [read-only mode](/system-variables.md#tidb_restricted_read_only-new-in-v520) enabled, the downstream database user also needs the `RESTRICTED_REPLICA_WRITER_ADMIN` permission.

## Eventually consistent replication in disaster scenarios

Starting from v6.1.1, this feature becomes GA. Starting from v5.3.0, TiCDC supports backing up incremental data from an upstream TiDB cluster to an object storage or an NFS of the downstream cluster. When the upstream cluster encounters a disaster and becomes unavailable, TiCDC can restore the downstream data to the recent eventually consistent state. This is the eventually consistent replication capability provided by TiCDC. With this capability, you can switch applications to the downstream cluster quickly, avoiding long-time downtime and improving service continuity.
Expand Down

0 comments on commit 62314d4

Please sign in to comment.