-
Notifications
You must be signed in to change notification settings - Fork 201
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
Recalc subscriptions #1380
Conversation
This function is responsible calculate subscription usage for each show and it's previous version had a bug that could lead to negative values.
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.
Thanks, @DiegoTavares
Approved!
f5f0110
into
AcademySoftwareFoundation:master
-- | ||
-- concatenates all tags in host_tag and sets host.str_tags | ||
-- | ||
UPDATE subscription SET int_cores = 0; |
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.
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 |
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.
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; |
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.
Missing int_burst = r.c
:
int_burst = r.c, int_gpus = r.d
This function is responsible calculate subscription usage for each show and it's previous version had a bug that could lead to negative values.