-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
ref(lw-deletes): add project_id killswitch and some logging #6677
base: master
Are you sure you want to change the base?
Conversation
@@ -94,7 +94,6 @@ delete_allocation_policies: | |||
args: | |||
required_tenant_types: | |||
- referrer | |||
- project_id |
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.
This is intentional - now that we have the batching approach, the allocation policy won't have a project_id
because it will be (potentially) multiple project_id
s, so we can ratelimit based on that. This allocation policy will work similar to the subscriptions executor where there is one referrer for those queries.
|
||
self.__next_step.submit(message) | ||
|
||
def _get_attribute_info(self) -> AttributionInfo: | ||
return AttributionInfo( | ||
app_id=AppID("lw-deletes"), | ||
tenant_ids={}, | ||
referrer="lw-deletes", | ||
referrer=f"lw-deletes-{self.__storage_name}", |
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.
There are no tenant ids passed from the batch of messages, just the referrer which I've added to be by storage so that we can change the allocation policy per storage
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.
Although now that I think about it, the policy is defined on the storage... so this might just be redundant
This PR has a couple improvements and additions to the lw delete pipeline, the main one being the killswitch for the project.
Most storages should have the
project_id
as one of the allowed columns so the assumption right now is that they do and so the killswitch will work for that case. If we add more storages in the future that don't have that, we can update the killswitch logic. The config will be based on the storage:lw_deletes_killswitch_search_issues
The killswitch is added at the API level because the moment it's produced to the consumer it's batched with other messages, most likely with other
project_id
's. Another option would be to add another strategy step prior to the batch step that filters based on the killswitch, but I felt like not producing to the topic at all made more sense right now.