-
Notifications
You must be signed in to change notification settings - Fork 465
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
Update VPP and software install status summaries and filters for unified queue #25569
Update VPP and software install status summaries and filters for unified queue #25569
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some build issues in the test, but otherwise LGTM.
case fleet.SoftwareInstallPending: | ||
filter += " AND ua.activity_type = 'vpp_app_install'" | ||
case fleet.SoftwareUninstallPending: | ||
// VPP does not have uninstaller yet so to preserve existing behavior of VPP filters we map uninstall to install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the old behaviour had SoftwarePending
mapped to SoftwareInstallPending
, doesn't look like it supported uninstall?
@@ -1212,7 +1285,8 @@ WHERE | |||
max(id) -- ensure we use only the most recent install attempt for each host | |||
FROM host_software_installs | |||
WHERE | |||
software_title_id = :title_id | |||
host_id = hsi.host_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was missing, was that a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it may have been just potential inefficiency in the prior subquery rather than a bug since the subquery is still grouping by hsi.host_id
and being then joined on hosts.id
. This change seemed to improve the EXPLAIN
when I was testing locally.
@@ -67,35 +67,85 @@ func (ds *Datastore) GetSummaryHostVPPAppInstalls(ctx context.Context, teamID *u | |||
) { | |||
var dest fleet.VPPAppStatusSummary | |||
|
|||
// TODO(mna): must consider upcoming queue for pending | |||
stmt := fmt.Sprintf(` | |||
// TODO(uniq): do we need to handle host_deleted_at and removed similar to GetSummaryHostSoftwareInstalls? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, see other comment above.
AND host_id NOT IN(SELECT host_id FROM upcoming) -- antijoin to exclude hosts with upcoming activities | ||
GROUP BY | ||
host_id | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like those CTE approaches, makes it readable/maintainable.
029841c
into
feat-upcoming-activites-queue
For #23921