Skip to content

ALTER TABLE ADD FOREIGN KEY causes apply error under concurrent and conflicting DML #332

@sciascid

Description

@sciascid

Adding a foreign key to an existing table, and concurrently replicating a statement that changes the parent so that it violates the FK constraint, may result in the applier failing and reporting the constraint violation.
The scenario is as follows:

  1. ALTER adds FK in node1 successfully
  2. On node2 UPDATE/DELETE is in pre_commit (FK is not violated, as FK is not applied yet)
  3. On node2 ALTER BF aborts UPDATE/DELETE, after pre_commit certified it successfully e
  4. Applying of UPDATE/DELETE fails due to FK constraint violation and causes crash

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions