Improve rebuild_tables_by_domain command #34747
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Labels & Review