readyset icon indicating copy to clipboard operation
readyset copied to clipboard

Check how we handle FKs

Open altmannmarcelo opened this issue 8 months ago • 0 comments

Description

Currently when snapshotting, we require to replicate all tables from FK's example:

CREATE TABLE c (ID INT PRIMARY KEY);
CREATE TABLE b (ID INT PRIMARY KEY, c_ID INT, CONSTRAINT `c_id` FOREIGN KEY (c_ID) REFERENCES `c` (ID) ON DELETE CASCADE ON UPDATE CASCADE);

readyset --upstream-db-url=mysql://root:[email protected]:3306/fks --replication-tables=fks.b
. . .
2024-06-25T16:40:07.298905Z  WARN taking database snapshot: replicators::mysql_connector::snapshot: Error extending CREATE TABLE, table will not be used error=Error during RPC (extend_recipe (in readyset-client/src/controller/rpc.rs:49:26)): Table 'fks.c' is not being replicated by ReadySet
2024-06-25T16:40:07.301424Z  INFO taking database snapshot: replicators::table_filter: denying replication schema=fks table=b

Validate if we need FK's for anything other than parsing. If not we should get rid of this limitation

Change in user-visible behavior

Requires documentation change

altmannmarcelo avatar Jun 25 '24 17:06 altmannmarcelo