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

Improve rebuild_tables_by_domain command #34747

Merged
merged 2 commits into from
Jan 6, 2025
Merged

Conversation

gherceg
Copy link
Contributor

@gherceg gherceg commented Jun 10, 2024

Product Description

Technical Summary

I'm not sure if I actually intend to merge this PR, but mainly creating this to review prior to sharing this branch with a customer to run in their migration to on-prem.

Multiple DataSourceConfigurations referencing one SQL UCR table

It is possible for multiple data source configurations to reference the same backing SQL table if the table_id properties match. There isn't anything about the configuration besides the table_id and domain that factor into the name used when creating the SQL table.

Support asynchronous option

Since rebuild_indicators is already a celery task, it seems easy and safe to provide an option in this command to asynchronously rebuild tables. This way, the concurrency that celery enables can be put to use.

Feature Flag

Safety Assurance

Safety story

This preserves existing behavior in that the last DataSourceConfiguration referencing a SQL table will ultimately win, however this change just makes it so that we don't spend time rebuilding the table for other configurations that overlap and will ultimately be overwritten anyway.

Automated test coverage

QA Plan

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

gherceg added 2 commits June 10, 2024 16:07
It is possible for multiple data source configurations to reference the
same backing SQL table. In those cases, we don't want to rebuild the
same SQL table multiple times since that isn't necessary.
@gherceg gherceg requested a review from calellowitz as a code owner June 10, 2024 20:20
@gherceg gherceg requested a review from millerdev June 10, 2024 20:20
@gherceg gherceg merged commit d4f6396 into master Jan 6, 2025
13 checks passed
@gherceg gherceg deleted the gh/ucr/rebuild-once branch January 6, 2025 16:13
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