adjustment should be allowed when desired is in the scope of min_size/max_size when doing cluster resizing

Bug #1456124 reported by Yanyan Hu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
Fix Released
High
Yanyan Hu

Bug Description

There is a bug in current implementation of truncate_desired(): the cluster's min_size and max_size should only be used when min_size/max_size input parameter is None. Otherwise, the truncation will always be done using cluster's current size scope.

def truncate_desired(cluster, desired, min_size, max_size):
    '''Do truncation of desired capacity for non-strict cases.'''

    if min_size is not None and desired < min_size:
        desired = min_size
        LOG.debug(_("Truncating shrinkage to specified min_size (%s).")
                  % desired)

    if desired < cluster.min_size:
        desired = cluster.min_size
        LOG.debug(_("Truncating shrinkage to cluster's min_size (%s).")
                  % desired)

    if (max_size is not None and max_size > 0 and desired > max_size):
        desired = max_size
        LOG.debug(_("Truncating growth to specified max_size (%s).")
                  % desired)

    if desired > cluster.max_size and cluster.max_size > 0:
        desired = cluster.max_size
        LOG.debug(_("Truncating growth to cluster's max_size (%s).")
                  % desired)

    return desired

Yanyan Hu (yanyanhu)
Changed in senlin:
assignee: nobody → Yanyan Hu (yanyanhu)
Yanyan Hu (yanyanhu)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to senlin (master)

Fix proposed to branch: master
Review: https://review.openstack.org/184173

Changed in senlin:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to senlin (master)

Reviewed: https://review.openstack.org/184173
Committed: https://git.openstack.org/cgit/stackforge/senlin/commit/?id=75e50db76e31fe43e1b021a294aa07882fa2fc34
Submitter: Jenkins
Branch: master

commit 75e50db76e31fe43e1b021a294aa07882fa2fc34
Author: yanyanhu <email address hidden>
Date: Mon May 18 22:26:10 2015 -0400

    Fix a bug in scaleutils.truncate_desired

    The cluster's current min_size/max_size should be used to truncate
    desired capacity only when new min_size/max_size parameter is not
    given. There is bug in current implementation for this logic and
    this patch fixes it.

    Change-Id: I132181fed57d3941ac6131e8b284ad17859e2222
    Closes-Bug: #1456124

Changed in senlin:
status: In Progress → Fix Committed
Qiming Teng (tengqim)
Changed in senlin:
importance: Undecided → High
status: Fix Committed → Fix Released
milestone: none → mitaka-2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.