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

fix: Disable grant_new_user_template_team_access trigger on DB sync #2315

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Oct 17, 2023

The nightly database sync failed yesterday with the following error -

psql:write/team_members.sql:8: ERROR:  duplicate key value violates unique constraint "team_members_user_id_team_id_key"
DETAIL:  Key (user_id, team_id)=(117, 29) already exists.
CONTEXT:  COPY team_members, line 174
Database sync failed!

I think what's happening here is a race condition between the trigger inserting record in team_members and the script inserting them. This could explain the flakiness we've seen on recent Pizzas with the sync sometimes working and sometimes failing.

I'd tested this locally a few times (including adding a new user to check the trigger is still active) and it seems to work as expected without a hitch.

@github-actions
Copy link

github-actions bot commented Oct 17, 2023

Removed vultr server and associated DNS entries

@DafyddLlyr DafyddLlyr marked this pull request as ready for review October 17, 2023 08:28
@DafyddLlyr DafyddLlyr merged commit 102393e into main Oct 17, 2023
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/disable-template-team-trigger-on-db-sync branch October 17, 2023 09:08
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