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

bugfix: migrate organization usage counts to be statement level #3242

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

cdxker
Copy link
Member

@cdxker cdxker commented Jan 24, 2025

Migrates organization_usage_counts triggers from row level queries to statement level queries. Row level need to acquire a lock on the full table which can very easily cause a deadlock since so many different inserts trigger it.

Things tested to be working:

  • dataset_count increases and decreases properly
  • user_count
  • file_storage
  • chunk_count
    • clearing dataset possible edge case
    • deleting dataset possible edge case
  • message_count (test that deletes do not remove count).

@cdxker cdxker force-pushed the cd/make-migrations-statement branch from 23750d2 to ffdcc7b Compare January 26, 2025 22:14
@cdxker cdxker force-pushed the cd/make-migrations-statement branch from ffdcc7b to 1a21515 Compare January 26, 2025 22:17
@cdxker cdxker requested a review from skeptrunedev January 26, 2025 22:17
@cdxker cdxker marked this pull request as ready for review January 26, 2025 22:17
@cdxker cdxker changed the title wip: working on migrations feature: migrate organization usage counts to be statement level Jan 26, 2025
@cdxker cdxker changed the title feature: migrate organization usage counts to be statement level bugfix: migrate organization usage counts to be statement level Jan 26, 2025
@skeptrunedev skeptrunedev merged commit 966cc39 into main Jan 26, 2025
3 checks passed
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