Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete records on secondary on fkey constraint error #1638

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

dmanjunath
Copy link
Contributor

Description

Sometimes the secondary gets into a weird state (either bad export from primary or bad sync into secondary) where there's a fkey constraint. This fix allows for two things to happen

  1. Delete the existing files to unblock future syncs (currently all future syncs will fail since this issue is not resolved)
  2. Upon the next sync, there's a chance it works and it catches up. If not it clears the state to not block upon a future fix

Tests

I first verified that clearing the state and re-syncing fixes the constraint error and it does.

I couldn't repro the exact scenario with the fkey constraint in the db locally. What I did was verify the error in loggly to determine what I should look for and added it to an existing flow I have already tested for non-contiguous clock values..

How will this change be monitored?

https://audius.loggly.com/search#terms=%22Sync%20error%20for%22&from=2021-07-11T18:35:54.997Z&until=2021-07-12T18:35:54.997Z&source_group=

@dmanjunath dmanjunath requested a review from SidSethi July 12, 2021 18:46
@dmanjunath dmanjunath merged commit 852e682 into master Jul 12, 2021
@dmanjunath dmanjunath deleted the dm-sync-fkey-bugfix branch July 12, 2021 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants