Update ‘--max-kbps’ and ‘--max-burst-kbps’ parameter to 2147483648 or greater than 2147483648 using qos-bandwidth-limit-rule-update command,Neutron server thrown an exception

Bug #1600708 reported by xiewj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
QunyingRan

Bug Description

In Mitaka,
Update ‘--max-kbps’ and ‘--max-burst-kbps’ parameter to 2147483648 or greater than 2147483648 using qos-bandwidth-limit-rule-update command,
Neutron server thrown an exception "DBDataError: (pymysql.err.DataError) (1264, u"Out of range value for column 'max_kbps' at row 1")"

[root@devstack218 devstack]# neutron qos-bandwidth-limit-rule-update 11a8e94a-92d0-41b5-a7bf-36f2a55f4573 bw-limiter --max-kbps 2147483648
Request Failed: internal server error while processing your request.
Neutron server returns request_ids: ['req-82a00cf8-3efd-4c82-830e-8295560866f0']

[root@devstack218 devstack]# neutron qos-bandwidth-limit-rule-update 11a8e94a-92d0-41b5-a7bf-36f2a55f4573 bw-limiter --max-burst-kbps 2147483648
Request Failed: internal server error while processing your request.
Neutron server returns request_ids: ['req-52fd2986-5076-42c4-b564-10d58984f87f']
[root@devstack218 devstack]#

Similarly, Creating qos-bandwidth-limit-rule specified the ‘--max-kbps’ and ‘--max-burst-kbps’ parameter to 2147483648 or greater than 2147483648 also leads to abnormal

[root@devstack218 devstack]# neutron qos-bandwidth-limit-rule-create bw-limiter --max-kbps 2147483648
Request Failed: internal server error while processing your request.
Neutron server returns request_ids: ['req-54f916f1-cde3-4998-9bc4-1882e376b1cc']
[root@devstack218 devstack]# neutron qos-bandwidth-limit-rule-create bw-limiter --max-kbps 2147483647 --max-burst-kbps 2147483648
Request Failed: internal server error while processing your request.
Neutron server returns request_ids: ['req-72dbf5c5-c8f7-4b23-8537-3aebc29758f5']
[root@devstack218 devstack]#

The detail info of Neutron-Server,please see http://paste.openstack.org/show/529609/

QunyingRan (ran-qunying)
Changed in neutron:
assignee: nobody → QunyingRan (ran-qunying)
xiewj (36429515-3)
description: updated
description: updated
Revision history for this message
John Perkins (john-d-perkins-deactivatedaccount) wrote :

2147483648 is the max for a signed mysql integer. Since 2147483648 kbps is only 2 gigabit, it seems reasonable to make this unsigned and bump that up to 4294967295kbps.

CREATE TABLE `qos_bandwidth_limit_rules` (
  `id` varchar(36) NOT NULL,
  `qos_policy_id` varchar(36) NOT NULL,
  `max_kbps` int(11) DEFAULT NULL,
  `max_burst_kbps` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `qos_policy_id` (`qos_policy_id`),
  CONSTRAINT `qos_bandwidth_limit_rules_ibfk_1` FOREIGN KEY (`qos_policy_id`) REFERENCES `qos_policies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Changed in neutron:
importance: Undecided → Low
status: New → Confirmed
tags: added: low-hanging-fruit
tags: added: qos
Revision history for this message
John Perkins (john-d-perkins-deactivatedaccount) wrote :

We don't use sa.Column(sa.dialects.mysql.INTEGER(unsigned=True)) anywhere else, so I really doubt anyone would +2 doing it just for these two cases. If there's already a way to store large integers in a shared utility or library in openstack, I can't find it. We could also change them to something bigger than a kbps (or store the rate value separately). There's a number of ways to solve this.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

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

Change abandoned by QunyingRan (<email address hidden>) on branch: master
Review: https://review.openstack.org/346708
Reason: confilct can't be resolved

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Revision history for this message
Hirofumi Ichihara (ichihara-hirofumi) wrote :

QoS greater than 2147483648kbps? Who uses?

Revision history for this message
Akihiro Motoki (amotoki) wrote :

2,147,483,648 kbps is about 2Tbps (not 2Gbps as commented in #1).
I think we can check the maximum value allowed for max-kbps.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/350491
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=58316f7a8c07a4fbe912624a3bf9e08fdc6696f2
Submitter: Jenkins
Branch: master

commit 58316f7a8c07a4fbe912624a3bf9e08fdc6696f2
Author: QunyingRan <email address hidden>
Date: Wed Aug 3 05:56:50 2016 -0400

    Add error informations for users when value is invalid in database

    User can set bandwidth max-kbps or max-burst-kbps in QOS and
    the value may be bigger than definiton in database. We need give
    error information for users but throw exception in neutron server

    Change-Id: Id18fbd2331a470dd175648e27890d766ead26871
    Closes-Bug:1600708

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

This issue was fixed in the openstack/neutron 9.0.0.0b3 development milestone.

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.