-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
db: Add project_id to EventTag queries and deletes #6549
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
Conversation
| {'event_id__in': [i.id for i in instance_list]}, | ||
| { | ||
| 'event_id__in': [i.id for i in instance_list], | ||
| 'project_id__in': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
master_1 | ERROR: cannot run DELETE command which targets multiple shards
master_1 | HINT: Consider using an equality filter on partition column "project_id" to target a single shard. If you'd like to run a multi-shard operation, use master_modify_multiple_shards().
master_1 | STATEMENT: DELETE FROM "sentry_eventtag" WHERE "id" IN (2)
Can't do IN across shards either. Deletion code will have to be refactored to allow for one query per project_id. Which sucks, because I think when we delete groups we're just iterating by date? So the project constantly varies. Will be a large refactor I think to get that correct/fast.
Other option: https://docs.citusdata.com/en/v7.0/reference/user_defined_functions.html#master-modify-multiple-shards
mattrobenolt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's hold off on this. If we end up needing to do anything Citus specific, we can do this in backend.
mattrobenolt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's punt on this now. Or at least revisit later. Since we can do DELETEs unqualified just fine. If anything, we just should address the SELECT queries.
SELECTside helps Citus, so it doesn't hit all shards.DELETEside is required or Citus throws and error.