'attribute' and 'pool_id_attribute' scheduler filters are mutally exclusive

Bug #1749669 reported by Dmitry Galkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
High
Graham Hayes

Bug Description

Hello,

I've recently observed the following problem - the following Designate scheduler filters cannot be used at the same time: attribute, pool_id_attribute.

If we have the following settings in /etc/designate/designate.conf set:

scheduler_filters = attribute, pool_id_attribute, in_doubt_default_pool, fallback

and we try to schedule the newly created zone to a particular pool by id - this will not work, because the 'attribute' filter will throw all the pools out. "Pool_attributes" objects do not have the 'pool_id' set be default.

Creating a new zone with pool_id attribute:

curl -vv -g -i -X POST http://172.29.236.100:9001/v2/zones -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -d'
{
    "attributes": {
        "pool_id": "3ca13c45-6505-4965-b8b9-198522168d13"
    },
    "email": "<email address hidden>",
    "name": "openstacknew3.tech."
}'

The designate-central.log shows us:

2018-02-15 09:38:37.929 374 DEBUG designate.scheduler.filters.attribute_filter [req-bb097515-3fda-4bf5-9dbb-2ae37a54b1b9 8b1040841adf4b3ab2eb1e9efeea5ae0 b8a1e1371d22406cb89afd936cb20d0e - - -] <Pool id:'3ca13c45-6505-4965-b8b9-198522168d13' name:'extra'> did not match list of requested attribute keys - removing from list. Requested: {u'pool_id': u'3ca13c45-6505-4965-b8b9-198522168d13'}. Pool:{} evaluate_pool /openstack/venvs/designate-16.0.3/lib/python2.7/site-packages/designate/scheduler/filters/attribute_filter.py:84

2018-02-15 09:38:37.930 374 DEBUG designate.scheduler.base [req-bb097515-3fda-4bf5-9dbb-2ae37a54b1b9 8b1040841adf4b3ab2eb1e9efeea5ae0 b8a1e1371d22406cb89afd936cb20d0e - - -] 0 candidate pools remaining after attribute filter schedule_zone /openstack/venvs/designate-16.0.3/lib/python2.7/site-packages/designate/scheduler/base.py:84

2018-02-15 09:38:37.930 374 DEBUG designate.scheduler.base [req-bb097515-3fda-4bf5-9dbb-2ae37a54b1b9 8b1040841adf4b3ab2eb1e9efeea5ae0 b8a1e1371d22406cb89afd936cb20d0e - - -] Running pool_id_attribute filter with 0 pools schedule_zone /openstack/venvs/designate-16.0.3/lib/python2.7/site-packages/designate/scheduler/base.py:79

2018-02-15 09:38:37.948 374 DEBUG designate.scheduler.base [req-bb097515-3fda-4bf5-9dbb-2ae37a54b1b9 8b1040841adf4b3ab2eb1e9efeea5ae0 b8a1e1371d22406cb89afd936cb20d0e - - -] 0 candidate pools remaining after pool_id_attribute filter schedule_zone /openstack/venvs/designate-16.0.3/lib/python2.7/site-packages/designate/scheduler/base.py:84

Attribute filter removed all pools.. and than the 'fallback' filter makes zone being scheduled to default pool, so:

[root@aio1-utility-container-10fda1d7 ~]# openstack zone show 5453fc07-be0a-4f0d-8136-dabf11ed2dbd
+----------------+----------------------------------------------+
| Field | Value |
+----------------+----------------------------------------------+
| action | NONE |
| attributes | pool_id:3ca13c45-6505-4965-b8b9-198522168d13 |
| | |
| created_at | 2018-02-15T09:38:37.000000 |
| description | None |
| email | <email address hidden> |
| expire | 91400 |
| id | 5453fc07-be0a-4f0d-8136-dabf11ed2dbd |
| masters | |
| minimum | 3600 |
| name | openstacknew3.tech. |
| pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id | b8a1e1371d22406cb89afd936cb20d0e |
| refresh | 3596 |
| retry | 900 |
| serial | 1518687517 |
| status | ACTIVE |
| transferred_at | None |
| ttl | 3600 |
| type | PRIMARY |
| updated_at | 2018-02-15T09:38:43.000000 |
| version | 2 |
+----------------+----------------------------------------------+

We can change the filter order in configuration, but the final result will be the same as attributes filter will throw out all pools on the second step instead of the first.

Expected:
is that we can use both 'pool_id' and other attributes (like tier; label; etc) for scheduling the zone. If 'pool_id' was explicitly given - we'd like the zone to be exactly in this pool. If labels/attributes were defined - scheduling should happen based on those.

Revision history for this message
Dmitry Galkin (galkindmitrii) wrote :

P.S. the quick workaround is to have 'pool_id' defined in attributes section for each pool defined in /etc/designate/pools.yaml

but in my opinion the 'pool_id_attribute' filter should rater be merged into the 'attribute' filter so that if 'pool_id' was specified with the request -> the zone should be scheduled to pool with the specified id, or in other case - based on any other given attributes.

Revision history for this message
Graham Hayes (grahamhayes) wrote :
Changed in designate:
importance: Undecided → High
assignee: nobody → Graham Hayes (grahamhayes)
status: New → In Progress
Changed in designate:
status: In Progress → Fix Released
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.