Menu

#454 Update triggers on replicated tables may corrupt data

1.1 Dev Q
open
nobody
None
2
2013-09-26
2013-09-26
mason_s
No

We noticed that when updating a single row on a replicated table that we were getting duplicate key violations, even though the primary key columns were not involved.

We dug deeper and noticed that the mechanism uses ctid to identify what to update for update triggers that are non-"shippable" and executed on a coordinator. In the case of a replicated table, the ctid value may be different on different nodes for each tuple. It appears that Postgres-XC just uses one ctid value from one of the nodes and then sends down the same UPDATE statement to all of the individual nodes.

It should either get each ctid for each node and update, or determine the corresponding unique key values and use that in the generated WHERE clause.

Discussion


Log in to post a comment.