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

ref(lw-deletes): add project_id killswitch and some logging #6677

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MeredithAnya
Copy link
Member

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.

@MeredithAnya MeredithAnya requested review from a team as code owners December 13, 2024 23:09
@@ -94,7 +94,6 @@ delete_allocation_policies:
args:
required_tenant_types:
- referrer
- project_id
Copy link
Member Author

@MeredithAnya MeredithAnya Dec 13, 2024

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_ids, 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}",
Copy link
Member Author

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

Copy link
Member Author

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

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.

1 participant