-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
Ensure all states have been migrated to use timestamps #134007
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
It took less than a second to cleanup the unmigrated rows with the test database provided
|
same for MariaDB
|
same with PostgreSQL
|
Tested more widely on more production systems. All good |
Proposed change
If there are any un-migrated states rows, the new optimized queries for finding unused
attributes_ids
andmetadata_ids
will not be able to see them because it relies on scanning the index forlast_updated_ts
. Additionally, these rows could never have been purged because the purge also relies on this column/index. While its unclear how these rows could even exist since the original query was unbounded, ensure they are migrated since the issue report shows that it does happen on a production system in #134002.fixes #134002
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: