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

Don't allow excess claims to create extra CDs #1463

Closed
wants to merge 1 commit into from

Conversation

2uasimojo
Copy link
Member

@2uasimojo 2uasimojo commented Jul 16, 2021

Previously, due to a math error, if the number of pending claims exceeded the pool size, we would create the surplus number of CDs, assign them, and then delete them. This commit fixes the math error: any excess claim will remain Pending until capacity becomes available to create a CD for it.

NOTE:
The above also applies to the edge case where the pool size is zero. A claim against such a pool will remain Pending until the pool is edited to have a nonzero size.

This differs from other scenarios when we're at capacity:

  • If we've reached MaxSize, capacity becomes available when a CD is deleted (which may be prompted by its claim being deleted).
  • If we've reached MaxConcurrent, capacity becomes available when a CD finishes provisioning or deprovisioning.

Due to this discrepancy, the argument could be made to treat a zero-size pool specially and simply fail any claim against it. We can debate that separately; this commit doesn't address it.

HIVE-1593

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2uasimojo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2021
@2uasimojo
Copy link
Member Author

/assign @dgoodwin
/cc @jnpacker

@codecov
Copy link

codecov bot commented Jul 16, 2021

Codecov Report

Merging #1463 (43d1dc1) into master (667abfc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1463   +/-   ##
=======================================
  Coverage   41.08%   41.09%           
=======================================
  Files         334      334           
  Lines       30052    30054    +2     
=======================================
+ Hits        12348    12350    +2     
  Misses      16658    16658           
  Partials     1046     1046           
Impacted Files Coverage Δ
...g/controller/clusterpool/clusterpool_controller.go 60.16% <100.00%> (+0.13%) ⬆️

Previously, due to a math error, if the number of pending claims
exceeded the pool size, we would create the surplus number of CDs,
assign them, and then delete them. This commit fixes the math error: any
excess claim will remain Pending until capacity becomes available to
create a CD for it.

**NOTE:**
The above also applies to the edge case where the pool size is zero.
A claim against such a pool will remain Pending *until the pool is
edited to have a nonzero size*.

This differs from other scenarios when we're at capacity:
- If we've reached `MaxSize`, capacity becomes available when a *CD* is
deleted (which may be prompted by its *claim* being deleted).
- If we've reached `MaxConcurrent`, capacity becomes available when a
*CD* finishes provisioning or deprovisioning.

Due to this discrepancy, the argument could be made to treat a zero-size
pool specially and simply fail any claim against it. We can debate that
separately; this commit doesn't address it.

HIVE-1593
@abhinavdahiya
Copy link
Contributor

// Size is the default number of clusters that we should keep provisioned and waiting for use.
// +kubebuilder:validation:Minimum=0
// +required
Size int32 `json:"size"`

https://github.com/openshift/hive/blame/master/docs/clusterpools.md#L5-L8

those things make it sound like the pool is supposed to keep some warm clusters for immediate claim, but technically allow as many claims are requested.. (unless limited my other configuration)

so "Don't allow excess claims to create extra CDs" kind of seems to go against the purpose?

@abhinavdahiya
Copy link
Contributor

we would create the surplus number of CDs, assign them, and then delete them

the delete part seem like the incorrect behavior based on the current expectations.. 🤔

@2uasimojo
Copy link
Member Author

To me, the documentation as written makes no indication one way or the other as to what the behavior of excess claims should be. One could make a case for either interpretation of "pool size". It's just an architectural decision we need to make. @dgoodwin care to make the call here?

@2uasimojo
Copy link
Member Author

We decided in scrum today (20210721) that we do want to allow claims to generate CDs in excess of the pool size. The capacity is controlled by MaxSize. Closing this in favor of whatever comes out of HIVE-1599.

@2uasimojo 2uasimojo closed this Jul 21, 2021
@2uasimojo 2uasimojo deleted the HIVE-1593 branch July 21, 2021 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants