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

Recalc subscriptions #1380

Conversation

DiegoTavares
Copy link
Collaborator

This function is responsible calculate subscription usage for each show and it's previous version had a bug that could lead to negative values.

This function is responsible calculate subscription usage for each show and it's previous version had a bug that could lead to negative values.
Copy link
Collaborator

@ramonfigueiredo ramonfigueiredo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @DiegoTavares

Approved!

@DiegoTavares DiegoTavares merged commit f5f0110 into AcademySoftwareFoundation:master Jun 17, 2024
12 checks passed
--
-- concatenates all tags in host_tag and sets host.str_tags
--
UPDATE subscription SET int_cores = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include:

UPDATE subscription SET int_gpus = 0;

-- concatenates all tags in host_tag and sets host.str_tags
--
UPDATE subscription SET int_cores = 0;
FOR r IN (select show.str_name as show_name, proc.pk_show, alloc.pk_alloc, alloc.str_name as alloc_name, sum(proc.int_cores_reserved) as c
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include sum(proc.int_gpus_reserved) as d after sum(proc.int_cores_reserved) as c,:

sum(proc.int_cores_reserved) as c,
sum(proc.int_gpus_reserved) as d

BEGIN
SELECT int_burst INTO cur_burst FROM subscription WHERE pk_alloc=r.pk_alloc AND pk_show=r.pk_show;
-- Also changing int_burst here to bypass VERIFY_SUBSCRIPTION trigger
UPDATE subscription SET int_cores = r.c, int_burst = r.c WHERE pk_alloc=r.pk_alloc AND pk_show=r.pk_show;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing int_burst = r.c:

int_burst = r.c, int_gpus = r.d

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