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

Remove deprecated hosts table columns (gigs_disk_space_available and percent_disk_space_available) #7855

Closed
mna opened this issue Sep 20, 2022 · 4 comments
Assignees
Labels
~backend Backend-related issue. ~engineering-initiated Engineering-initiated story, such as a bug, refactor, or contributor experience improvement. ~legacy-interface-product-group Associated with the legacy "interface" product group. (No longer exists)
Milestone

Comments

@mna
Copy link
Member

mna commented Sep 20, 2022

Goal

With the work done on #7592 , the host's disk space information has been moved from the hosts table to the host_disks table, and a lazy migration approach was used to make migrating fast (i.e. the information from the hosts table was not copied to the new table, instead we waited for the hosts to report their disk space data again, and inserted it in the new table at that moment - see #7592 (comment)).

In a subsequent release, we should add a migration to remove the now-deprecated gigs_disk_space_available and percent_disk_space_available fields in the hosts table.

How?

Frontend

No impact.

Backend

Implement a migration to remove those two columns. Test with many hosts in the table, to make sure the migration is still reasonably fast.

If os_versions is no longer being used, please remove it. If it is still being used and will take more than an hour to fix, let's address it later.

@mna mna added ~backend Backend-related issue. ~engineering-initiated Engineering-initiated story, such as a bug, refactor, or contributor experience improvement. labels Sep 20, 2022
@mna
Copy link
Member Author

mna commented Sep 20, 2022

@lukeheath as a follow-up to #7592 , we should plan this in a not-too-distance future release, to prevent keeping obsolete columns around.

@lukeheath lukeheath added the ~legacy-interface-product-group Associated with the legacy "interface" product group. (No longer exists) label Sep 20, 2022
@lukeheath lukeheath moved this to 🥚 Prioritized in ⚗️ ‎‎Roadmap Sep 20, 2022
@lukeheath lukeheath moved this from 🥚 Prioritized to 🐥 Specified in ⚗️ ‎‎Roadmap Sep 20, 2022
@lukeheath
Copy link
Member

@mna Great point, thanks for creating this card. I've brought it into the "Specified" column so we can estimate in and get it prioritized.

@lukeheath lukeheath changed the title Remove deprecated hosts table columns (gigs_disk_space_available and percent_disk_space_available) Remove deprecated hosts table columns (gigs_disk_space_available and percent_disk_space_available and os_versions) Sep 21, 2022
@lukeheath lukeheath moved this from 🐥 Specified to 🦤 Estimated in ⚗️ ‎‎Roadmap Sep 21, 2022
@mna mna added this to 🚀 Release Nov 9, 2022
@mna mna moved this to 🥚 Ready in 🚀 Release Nov 9, 2022
@mna mna moved this from 🥚 Ready to 🐣 In progress in 🚀 Release Nov 9, 2022
@mna
Copy link
Member Author

mna commented Nov 9, 2022

If os_versions is no longer being used, please remove it. If it is still being used and will take more than an hour to fix, let's address it later.

The hosts.os_version column is still widely used in host and label queries, from a quick search. Seems like it should be a ticket by itself to remove its use and drop the column.

@mna
Copy link
Member Author

mna commented Nov 9, 2022

Quite fast with 40K+ hosts on my laptop.

mysql> select count(*) from hosts;
+----------+
| count(*) |
+----------+
|    42209 |
+----------+
1 row in set (0.00 sec)
$ time ./build/fleet prepare db --dev
2022/11/09 14:51:26 [2022-11-09] Remove Hosts Disk Space Columns
Migrations completed.

real	0m2.062s
user	0m0.062s
sys	0m0.030s

@mna mna changed the title Remove deprecated hosts table columns (gigs_disk_space_available and percent_disk_space_available and os_versions) Remove deprecated hosts table columns (gigs_disk_space_available and percent_disk_space_available) Nov 9, 2022
@mna mna moved this from 🐣 In progress to ✨ ‎ ‎In review in 🚀 Release Nov 9, 2022
@mna mna moved this from ✨ ‎ ‎In review to ✔️ ‎ ‎‎‎Awaiting QA in 🚀 Release Nov 15, 2022
@xpkoala xpkoala moved this from ✔️ ‎ ‎‎‎Awaiting QA to ✅ Ready for release in 🚀 Release Nov 22, 2022
@lukeheath lukeheath added this to the 4.24.0 milestone Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
~backend Backend-related issue. ~engineering-initiated Engineering-initiated story, such as a bug, refactor, or contributor experience improvement. ~legacy-interface-product-group Associated with the legacy "interface" product group. (No longer exists)
Development

No branches or pull requests

2 participants