Dropping the placement rules when the table is dropped #18206
Labels
sig/sql-infra
SIG: SQL Infra
type/enhancement
The issue or PR belongs to an enhancement.
type/usability
Development Task
Background
It's a part of project "Placement rules in SQL". It should accomplished after adding placement rules (#18200).
When dropping a table, the placement rules on it should also be dropped. But it's not straightforward: the table might be recovered later, through
FLASHBACK
orRECOVER
statements. Once it's recovered, the placement rules on it should also be recovered. So the placement rules can't be dropped immediately.Solutions
The most straightforward solution is to create a goroutine to check the table periodically. Once the table can't be recovered, notify PD to drop its placement rules. Once the table is recovered, stop the goroutine.
But note that TiDB may shutdown anytime, so the information should be persisted in TiKV and the goroutine should be always running.
The text was updated successfully, but these errors were encountered: