-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat(spc,csp): adding support for pool ReadOnly Threshold limit #1609
Conversation
Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
test case: openebs/openebs#2909 |
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.
Provided few comments
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.
Once the pool is set as ReadOnly I think we should avoid creating CVRs on that pool.
Signed-off-by: mayank <mayank.patel@mayadata.io>
@mittachaitu I have addressed your comments. PTAL. |
(cStorPool.Spec.PoolSpec.ROThresholdLimit != 0 && | ||
cStorPool.Spec.PoolSpec.ROThresholdLimit != 100) { | ||
if !cStorPool.Status.ReadOnly { | ||
if err = pool.SetPoolRDMode(cStorPool, true); err != nil { |
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.
did we covered the cases where pool.SetPoolRDMode is done, but, update of cStorPool.Status.ReadOnly as true in etcd is not done due to any reason like restart of pool-mgmt / update to etcd failed?
@@ -134,6 +135,12 @@ func (cb *CasPoolBuilder) withAnnotations(annotations map[string]string) *CasPoo | |||
return cb | |||
} | |||
|
|||
// WithPoolROThreshold set PoolROThreshold value | |||
func (cb *CasPoolBuilder) WithPoolROThreshold(poolROThreshold int) *CasPoolBuilder { |
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.
@kmova Should we add default value for pool readonly threshold, like 80, so if pool storage gets consumed up-to 80% then replica controller will set readonly mode to pool and no IOs will be allowed(volume creation will be alloed) on the pool unless user expand the pool.?
Signed-off-by: mayank <mayank.patel@mayadata.io>
return | ||
} | ||
|
||
func convertToBytes(a []string) (number []int64, err error) { |
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.
@sonasingh46 check whether this fn helps you
Signed-off-by: mayank <mayank.patel@mayadata.io>
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.
changes are good
Signed-off-by: mayank <mayank.patel@mayadata.io>
Signed-off-by: mayank <mayank.patel@mayadata.io>
Changes:
Sample SPC spec
Sample CSP spec:
Sample output :
Note:
roThresholdLimit
on SPC during creation only.roThresholdLimit
.roThresholdLimit
is set to0
.roThresholdLimit
is set to0
or100
:- Writes on the pool will be allowed until it runs out of space
Signed-off-by: mayank mayank.patel@mayadata.io