pingcap / pingcap/tidb

The behavior of setting the TiFlash replica to 0 for tables with a vector index should be properly handled

Open
#59,514 0 comments 1 reaction 0 assignees View on GitHub
severity/moderate sig/vector type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

case 1
```
CREATE TABLE `t` (
`a` int DEFAULT NULL,
`b` vector DEFAULT NULL,
`c` vector(3) DEFAULT NULL,
`d` vector(4) DEFAULT NULL,
VECTOR INDEX `vecIdx`((VEC_COSINE_DISTANCE(`c`))));

alter table t set tiflash replica 0;
```

case2
```
create database db SET TIFLASH REPLICA 1;
CREATE TABLE `t` (
`a` int DEFAULT NULL,
`b` vector DEFAULT NULL,
`c` vector(3) DEFAULT NULL,
`d` vector(4) DEFAULT NULL,
VECTOR INDEX `vecIdx`((VEC_COSINE_DISTANCE(`c`))));

ALTER DATABASE db SET TIFLASH REPLICA 0;
```

### 2. What did you expect to see? (Required)
Return a warning like "After this operation, vector indexes are unavailable".
Or
Return an error like "This table has vector indexes, please remove it before setting tiflash replica 0". It may be more appropriate to handle this behavior in the future, such as when the TiFlash replica becomes available and is bound to the vector index publicly.

### 3. What did you see instead (Required)
```
Query OK, 0 rows affected (0.13 sec)
```

### 4. What is your TiDB version? (Required)

master

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.