Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTER DATABASE ... SET TIFLASH REPLICA will add tiflash replica to SEQUENCE table unexpectly #51990

Closed
JaySon-Huang opened this issue Mar 21, 2024 · 2 comments · Fixed by #52348
Labels
component/ddl This issue is related to DDL of TiDB. severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented Mar 21, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

test> create database testdb;
test> use testdb;
testdb> CREATE SEQUENCE seq;

-- adding tiflash replica to sequence table is blocked
testdb> alter table seq set tiflash replica 1;
(1347, "'testdb.seq' is not BASE TABLE")
testdb> select * from information_schema.tiflash_replica;
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+
| TABLE_SCHEMA | TABLE_NAME               | TABLE_ID | REPLICA_COUNT | LOCATION_LABELS | AVAILABLE | PROGRESS |
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+

-- adding tiflash replica to sequence table is added unexpectedly
testdb> alter database testdb set tiflash replica 1;
testdb> select * from information_schema.tiflash_replica;
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+
| TABLE_SCHEMA | TABLE_NAME               | TABLE_ID | REPLICA_COUNT | LOCATION_LABELS | AVAILABLE | PROGRESS |
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+
| testdb       | seq                      | 644      | 1             |                 | 1         | 1.0      |
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+

2. What did you expect to see? (Required)

executing ALTER DATABASE ... SET TIFLASH REPLICA will not add tiflash replica for SEQUENCE table in the database.
And warnings show that the SEQUENCE table is ignored.

3. What did you see instead (Required)

-- adding tiflash replica to sequence table is added unexpectedly
testdb> alter database testdb set tiflash replica 1;
testdb> select * from information_schema.tiflash_replica;
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+
| TABLE_SCHEMA | TABLE_NAME               | TABLE_ID | REPLICA_COUNT | LOCATION_LABELS | AVAILABLE | PROGRESS |
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+
| testdb       | seq                      | 644      | 1             |                 | 1         | 1.0      |
+--------------+--------------------------+----------+---------------+-----------------+-----------+----------+

4. What is your TiDB version? (Required)

affects v6.1 ~ current master

testdb> select tidb_version() \G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v8.0.0-alpha-561-gf4e366e
Edition: Community
Git Commit Hash: f4e366ea0c38d0bea20da9d8bc1f55252c991324
Git Branch: HEAD
UTC Build Time: 2024-03-19 13:40:56
GoVersion: go1.21.4
Race Enabled: false
Check Table Before Drop: false
Store: tikv
@JaySon-Huang JaySon-Huang added the type/bug This issue is a bug. label Mar 21, 2024
@CalvinNeo
Copy link
Member

Add check for sequence in ModifySchemaSetTiFlashReplica

@windtalker windtalker added sig/sql-infra SIG: SQL Infra and removed sig/execution SIG execution labels Mar 22, 2024
@windtalker
Copy link
Contributor

Change to sig/sql-infra since it should be a ddl related bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ddl This issue is related to DDL of TiDB. severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants