TiFlash Table Synchronization Issue

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiflash表同步问题

| username: wenyi

I am working on database-level TiFlash, such as ALTER DATABASE xx SET TIFLASH REPLICA 1;. After a while, if a new table is created in the database, the new table will not automatically create a TiFlash replica, right? It needs to manually create the TiFlash replica for the new table, right?

| username: tidb菜鸟一只 | Original post link

Yes, it is necessary to manually create a replica.

| username: wenyi | Original post link

The database-level TiFlash replica is equivalent to batch table TiFlash, which is not very meaningful. Achieving automatic TiFlash replicas for new tables at the database level is what truly makes sense.

| username: tidb菜鸟一只 | Original post link

The command alter database xx set tiflash replica 1; essentially performs a set tiflash replica operation on all existing tables under the specified database, just to save some effort… If you want to achieve that functionality, you would need a scheduled task to periodically check all databases to see if replicas are configured and if there are any new tables, and then execute the set tiflash replica operation on the new tables. This feature might be available in the future, but it probably doesn’t exist right now.

| username: Running | Original post link

This question is very meaningful. We encountered a similar issue in our scenario. We isolated a tidbserver instance specifically for tiflash queries, but newly added tables need to be reset before they can be used.

| username: wenyi | Original post link

How many rows of data in a table require a TiFlash replica?

| username: tidb菜鸟一只 | Original post link

Looking at the queries you are running, if they are all aggregate queries, TiFlash is faster even for very small tables…