Able to create pool with different protocol than listener protocol

Bug #1556342 reported by Kevin
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
octavia
Fix Released
Low
xuchaochao

Bug Description

When creating a pool with different protocol than listener protocol, a pool is create even though the protocols are not compatible.
Previously, this would not display any pools in neutron lbaas-pool-list since the protocols are not compatible.

Initial state
$ neutron lbaas-loadbalancer-list
+--------------------------------------+------+-------------+---------------------+----------+
| id | name | vip_address | provisioning_status | provider |
+--------------------------------------+------+-------------+---------------------+----------+
| bf449f65-633d-4859-b417-28b35f4eaea2 | lb1 | 10.0.0.3 | ERROR | octavia |
| c6bf0765-47a9-49d9-a2f2-dd3f1ea81a5c | lb2 | 10.0.0.13 | ACTIVE | octavia |
| e1210b03-f440-4bc1-84ca-9ba70190854f | lb3 | 10.0.0.16 | ACTIVE | octavia |
+--------------------------------------+------+-------------+---------------------+----------+

$ neutron lbaas-listener-list
+--------------------------------------+--------------------------------------+-------+----------+---------------+----------------+
| id | default_pool_id | name | protocol | protocol_port | admin_state_up |
+--------------------------------------+--------------------------------------+-------+----------+---------------+----------------+
| 4cda881c-9209-42ac-9c97-e1bfab0300b2 | 6be3dae1-f159-4e0e-94ea-5afdfdab05fc | list2 | HTTP | 80 | True |
+--------------------------------------+--------------------------------------+-------+----------+---------------+----------------+

$ neutron lbaas-pool-list
+--------------------------------------+-------+----------+----------------+
| id | name | protocol | admin_state_up |
+--------------------------------------+-------+----------+----------------+
| 6be3dae1-f159-4e0e-94ea-5afdfdab05fc | pool2 | HTTP | True |
+--------------------------------------+-------+----------+----------------+

Create new listener with TCP protocol
$ neutron lbaas-listener-create --name list3 --loadbalancer lb3 --protocol TCP --protocol-port 22
Created a new listener:
+---------------------------+------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------+
| admin_state_up | True |
| connection_limit | -1 |
| default_pool_id | |
| default_tls_container_ref | |
| description | |
| id | 9574801a-675b-4784-baf0-410d1a1fd941 |
| loadbalancers | {"id": "e1210b03-f440-4bc1-84ca-9ba70190854f"} |
| name | list3 |
| protocol | TCP |
| protocol_port | 22 |
| sni_container_refs | |
| tenant_id | b24968d717804ffebd77803fce24b5a4 |
+---------------------------+------------------------------------------------+

Create pool with HTTP protocol instead of TCP
$ neutron lbaas-pool-create --name pool3 --lb-algorithm ROUND_ROBIN --listener list3 --protocol HTTP
Listener protocol TCP and pool protocol HTTP are not compatible.

Pool list shows pool3 even though the protocols are not compatible and should not be able to create pool
$ neutron lbaas-pool-list
+--------------------------------------+-------+----------+----------------+
| id | name | protocol | admin_state_up |
+--------------------------------------+-------+----------+----------------+
| 6be3dae1-f159-4e0e-94ea-5afdfdab05fc | pool2 | HTTP | True |
| 7e6fbe67-60b0-40cd-afdd-44cddd8c60a1 | pool3 | HTTP | True |
+--------------------------------------+-------+----------+----------------+

From mysql, pool table from octavia DB. No pool3
+--------------------------------------+--------------------------------------+-------+-------------+----------+--------------+------------------+---------+--------------------------------------+
| project_id | id | name | description | protocol | lb_algorithm | operating_status | enabled | load_balancer_id |
+--------------------------------------+--------------------------------------+-------+-------------+----------+--------------+------------------+---------+--------------------------------------+
| b24968d7-1780-4ffe-bd77-803fce24b5a4 | 6be3dae1-f159-4e0e-94ea-5afdfdab05fc | pool2 | | HTTP | ROUND_ROBIN | ONLINE | 1 | c6bf0765-47a9-49d9-a2f2-dd3f1ea81a5c |
+--------------------------------------+--------------------------------------+-------+-------------+----------+--------------+------------------+---------+--------------------------------------+

From mysql, lbaas_pools table from neutron DB. Pool3 is in PENDING_CREATE.
+----------------------------------+--------------------------------------+-------+-------------+----------+--------------+------------------+----------------+---------------------+------------------+--------------------------------------+
| tenant_id | id | name | description | protocol | lb_algorithm | healthmonitor_id | admin_state_up | provisioning_status | operating_status | loadbalancer_id |
+----------------------------------+--------------------------------------+-------+-------------+----------+--------------+------------------+----------------+---------------------+------------------+--------------------------------------+
| b24968d717804ffebd77803fce24b5a4 | 6be3dae1-f159-4e0e-94ea-5afdfdab05fc | pool2 | | HTTP | ROUND_ROBIN | NULL | 1 | ACTIVE | ONLINE | c6bf0765-47a9-49d9-a2f2-dd3f1ea81a5c |
| b24968d717804ffebd77803fce24b5a4 | 7e6fbe67-60b0-40cd-afdd-44cddd8c60a1 | pool3 | | HTTP | ROUND_ROBIN | NULL | 1 | PENDING_CREATE | OFFLINE | e1210b03-f440-4bc1-84ca-9ba70190854f |
+----------------------------------+--------------------------------------+-------+-------------+----------+--------------+------------------+----------------+---------------------+------------------+--------------------------------------+

Revision history for this message
Michael Johnson (johnsom) wrote :

When I run through this scenario:
neutron lbaas-loadbalancer-create --name act-stby-rr-1 private-subnet
neutron lbaas-listener-create --name listener1 --loadbalancer act-stby-rr-1 --protocol TCP --protocol-port 80
neutron lbaas-pool-create --name pool1 --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP

I get the expected response:
Listener protocol TCP and pool protocol HTTP are not compatible.
Neutron server returns request_ids: ['req-f1e015da-a24b-4be5-a1f2-357eeafbc3e7']

I see no record of the pool in the Octavia DB as would be expected.
However, I see a record remains in the neutron database:

| tenant_id | id | name | description | protocol | lb_algorithm | healthmonitor_id | admin_state_up | provisioning_status | operating_status | loadbalancer_id |
+----------------------------------+--------------------------------------+-------+-------------+----------+--------------+------------------+----------------+---------------------+------------------+--------------------------------------+
| 3acdd9326b514a7c8f37f4373f76fdec | f2cf6444-71a6-4978-a583-622859976451 | pool1 | | HTTP | ROUND_ROBIN | NULL | 1 | PENDING_CREATE | OFFLINE | f2b1116a-babd-4355-88ba-81b600885b31 |

This appears to be a neutron-lbaas bug, assigning to neutron-lbaas.

tags: added: lbaas
affects: octavia → neutron
Doug Wiegley (dougwig)
Changed in neutron:
status: New → Confirmed
importance: Undecided → Low
tags: added: low-hanging-fruit
Changed in neutron:
assignee: nobody → j_king (james-agentultra)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lbaas (master)

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

Changed in neutron:
status: Confirmed → In Progress
Changed in neutron:
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-lbaas (master)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/311291
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in neutron:
status: In Progress → Incomplete
assignee: j_king (james-agentultra) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
xuchaochao (xuchaochao)
Changed in neutron:
assignee: nobody → xuchaochao (xuchaochao)
status: Expired → In Progress
Revision history for this message
xuchaochao (xuchaochao) wrote :
affects: neutron → octavia
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lbaas (master)

Reviewed: https://review.openstack.org/492357
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=bfee75e1b31eeb735718ac39092d9c00850d1983
Submitter: Zuul
Branch: master

commit bfee75e1b31eeb735718ac39092d9c00850d1983
Author: xuchaochao <email address hidden>
Date: Thu Aug 10 10:35:17 2017 +0800

    Add a compatible check before creating pool

    When creating pool associated with incompatible protocol of listener,
    pool will be created in the database and cannot delete it by command.
    This patch add a compatible check before creating pool in database.

    Change-Id: I8f749ad49e86c3d891c6965db86ae346a52f9634
    Closes-Bug: #1556342

Changed in octavia:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lbaas 13.0.0.0b1

This issue was fixed in the openstack/neutron-lbaas 13.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lbaas (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/582905

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lbaas (stable/queens)

Reviewed: https://review.openstack.org/582905
Committed: https://git.openstack.org/cgit/openstack/neutron-lbaas/commit/?id=f2947a32220ee77a98170583ee6921064a3ff728
Submitter: Zuul
Branch: stable/queens

commit f2947a32220ee77a98170583ee6921064a3ff728
Author: xuchaochao <email address hidden>
Date: Thu Aug 10 10:35:17 2017 +0800

    Add a compatible check before creating pool

    When creating pool associated with incompatible protocol of listener,
    pool will be created in the database and cannot delete it by command.
    This patch add a compatible check before creating pool in database.

    Change-Id: I8f749ad49e86c3d891c6965db86ae346a52f9634
    Closes-Bug: #1556342
    (cherry picked from commit bfee75e1b31eeb735718ac39092d9c00850d1983)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lbaas queens-eol

This issue was fixed in the openstack/neutron-lbaas queens-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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