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

make PDS table unique on host name #913

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

brianolson
Copy link
Contributor

fix old data that had dups on PDS host name

fix old data that had dups on PDS host name
Comment on lines +253 to +261
err = db.Exec("UPDATE users SET pds = ? WHERE pds = ?", minPDSId, xPDSId).Error
if err != nil {
return fmt.Errorf("failed to update user pds %d -> %d: %w", xPDSId, minPDSId, err)
}
err = db.Exec("UPDATE actor_infos SET pds = ? WHERE pds = ?", minPDSId, xPDSId).Error
if err != nil {
return fmt.Errorf("failed to update actor_infos pds %d -> %d: %w", xPDSId, minPDSId, err)
}
err = db.Exec("DELETE FROM pds WHERE id = ?", xPDSId).Error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to do these in a transaction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda? I put it effectively into relay 'boot code' before threads of work are started. I guess the bad case is multiple bigsky processes pointed at the same PostgreSQL, but I bet it handles that badly in many ways.

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.

2 participants