If your replicated slave threw an error trying to apply packet #104949 (showing the message ERROR: duplicate key value violates unique constraint "artist_alias_idx_primary"
), then you can un-break things by doing the following:
-
- Get the latest code from the
master
branch:
git checkout master && git pull origin master
(OR, if you don’t want to update your code, clear the dbmirror_pending tables instead:
echo 'TRUNCATE dbmirror_pending CASCADE; TRUNCATE dbmirror_pendingdata CASCADE;' | ./admin/psql READWRITE
) - Proceed with replication as normal, either via cron, or by running
./admin/replication/LoadReplicationChanges
- Get the latest code from the
You can also re-import from dump 20170605-031203 or later, and replicate from there. We’re very sorry for the inconvenience.
The issue here was caused by a bug in our alias merge code that interacted strangely with dbmirror. Since that code went untouched for years, the trigger for this issue must have been extremely rare. I’ve put in place a fix for the merge logic to ensure it doesn’t happen there again, and am investigating dbmirror’s behavior to see why it didn’t sequence the updates correctly.
The first command (update the code) doesn’t work for me, you will find the details in the ticket MBS-9366.
The second command (clear the dbmirror_pending tables) works fine.
Thank you for the fast fix @mwiencek!