Creating a configuration with a large parameter value causes HTTP 422

Bug #1308665 reported by Tanis De Luna
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Duk Loi

Bug Description

MySQL has a variable called myisam_sort_buffer_size. Calling /datastores/<etc>/parameters/myisam_sort_buffer_size shows its max value as 18446744073709547520. Creating or updating a configuration with this value causes Trove to return an HTTP 422 error. Example data: '{"configuration": {"name":"configuration_integer", "values": {"myisam_sort_buffer_size": 18446744073709547520}}}'

Steps to Reproduce

1. Make a call to <api>/datastores/mysql/versions/<version>/parameters/myisam_sort_buffer_size.
This returns the parameter details of myisam_sort_buffer_size.
{"max": 18446744073709547520, "min": 4, "type": "integer", "name": "myisam_sort_buffer_size", "restart_required": false}

2. Attempt to create a configuration with myisam_sort_buffer_size's max value. This returns HTTP 422 Unprocessable Entity
<api>/configurations/<configuration_id> POST, Tenant, AuthToken, Data = '{"configuration": {"name":"configuration_integer", "values": {"myisam_sort_buffer_size": 18446744073709547520}}}'

HTTP 422 Unprocessable Entity
{"unprocessableEntity": {"message": "The value provided for the configuration parameter myisam_sort_buffer_size is not of type integer.", "code": 422}}

3. I suspect the value is being limited by python's max_int value (9223372036854775807).

----
9223372036854775808 does not work:
<api>/configurations POST, Tenant, AuthToken, Data = '{"configuration": {"name":"configuration_integer", "values": {"myisam_sort_buffer_size": 9223372036854775808}}}'

HTTP 422 Unprocessable Entity
{"unprocessableEntity": {"message": "The value provided for the configuration parameter myisam_sort_buffer_size is not of type integer.", "code": 422}}

----
9223372036854775807 does work:
<api>/configurations POST, Tenant, AuthToken, Data = '{"configuration": {"name":"configuration_integer", "values": {"myisam_sort_buffer_size": 9223372036854775807}}}'

HTTP 200 OK
{"configuration": {"description": null, "values": {"myisam_sort_buffer_size": 9223372036854775807}, "id": <id>, "datastore_version_id": <datastore_id>, "name": "configuration_integer"}}

----
A GET on this configuration works:
<api>/configurations/<configuration_id> GET, Tenant, AuthToken

HTTP 200 OK
{"configuration": {"description": null, "values": {"myisam_sort_buffer_size": 9223372036854775807}, "id": <id>, "datastore_version_id": <datastore_id>, "name": "configuration_integer"}}

Changed in trove:
status: New → Triaged
importance: Undecided → Medium
Duk Loi (duktesora)
Changed in trove:
assignee: nobody → Duk Loi (duktesora)
Revision history for this message
Amrith Kumar (amrith) wrote :

Retained importance to "Medium" (bugscrub, 2014-10-23)

Changed in trove:
milestone: none → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

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

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

Reviewed: https://review.openstack.org/132108
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=17a28954f1f2ae7dd2219d5f2a4b294289491c7c
Submitter: Jenkins
Branch: master

commit 17a28954f1f2ae7dd2219d5f2a4b294289491c7c
Author: Duk Loi <email address hidden>
Date: Thu Oct 30 15:57:54 2014 -0400

    Added regression test for config with long value

    This bug is fixed by changes from
    https://review.openstack.org/#/c/79850

    The bug was originally caused by ConfigurationsController._find_type()
    only returning an int as the type even for long values. With the
    changes from the above review _find_type() now returns valid types of
    int and long.

    Added a regression test to validate the scenario described in the bug.

    Change-Id: I6df4c919ccccad7481197b8feddaf6f27a5e4e42
    Closes-Bug: #1308665

Changed in trove:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: kilo-1 → 2015.1.0
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.