Please sign in to comment.
Reducing the risk of foreign key violations during replication
Props for a great root cause analysis go to TonyB http://groups.google.com/group/rubyrep/browse_thread/thread/0e8f4332326366b1 The best possible solution would be to (1) do the original inserts with the foreign key set to null (2) do an update to the right foreign key as soon as the dependent record is created That solution however would require knowledge of which columns are foreign key columns and to which tables & target columns they map. Additionally the changes would have to be searched for when the referenced records get created. So second best solution (which this commit implements) that should solve the problem in at least most of the cases: Retry inserting the failed record at the end of the replication run.
- Loading branch information...
Showing with 103 additions and 11 deletions.