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

when exchange partition, info schema report "failed to load schema diff" and do full load on "Found a row that does not match the partition" error #56685

Closed
D3Hunter opened this issue Oct 16, 2024 · 0 comments · Fixed by #56686
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@D3Hunter
Copy link
Contributor

D3Hunter commented Oct 16, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

for the integration test db_partition.test, the exchange partition will fail with Found a row that does not match the partition, it's expected, but info schema report "failed to load schema diff" and do full load, this part is not.

CREATE TABLE t1 (
	d date NOT NULL ,
	name varchar(10)  NOT NULL,
	UNIQUE KEY (d,name)
);
CREATE TABLE t1p (
	d date NOT NULL ,
	name varchar(10)  NOT NULL,
	UNIQUE KEY (d,name)
)
PARTITION BY RANGE COLUMNS(d)
(PARTITION p202307 VALUES LESS THAN ('2023-08-01'),
 PARTITION p202308 VALUES LESS THAN ('2023-09-01'),
 PARTITION p202309 VALUES LESS THAN ('2023-10-01'),
 PARTITION p202310 VALUES LESS THAN ('2023-11-01'),
 PARTITION p202311 VALUES LESS THAN ('2023-12-01'),
 PARTITION p202312 VALUES LESS THAN ('2024-01-01'),
 PARTITION pfuture VALUES LESS THAN (MAXVALUE));
insert into t1 values ("2023-08-06","0000");
-- error 1737
alter table t1p exchange partition p202307 with table t1 with validation;
[2024/10/14 18:06:08.766 +08:00] [ERROR] [domain.go:356] ["failed to load schema diff"] [error="[schema:1146]Table '(Schema ID 2887).(Table ID 3156)' doesn't exist"]
[2024/10/14 18:06:08.786 +08:00] [INFO] [domain.go:392] ["full load InfoSchema success"] [isV2=true] [currentSchemaVersion=5616] [neededSchemaVersion=5617] ["elapsed time"=20.049449ms]

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

error, but no full load

3. What did you see instead (Required)

error and full load

4. What is your TiDB version? (Required)

master

@D3Hunter D3Hunter added type/bug The issue is confirmed as a bug. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. severity/moderate labels Oct 16, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 5e1423c Oct 17, 2024
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants