stack arn is too big for shorter ceilometer resource_id column

Bug #1468916 reported by Steve Baker
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
gordon chung
OpenStack Heat
Fix Released
High
Kairat Kushaev

Bug Description

In ceilometer liberty-1 table resource has reduced column resource_id to 255 chars, which a heat stack arn would frequently exceed.

We should either switch to using the stack id instead of arn, or request ceilometer to revert that change (there are valid reasons for wanting a smaller column size, such as index building)

http://logs.openstack.org/27/195627/1/check/check-heat-dsvm-functional-mysql/6f67bea/logs/screen-ceilometer-collector.txt.gz?level=ERROR

2015-06-25 17:39:36.169 6266 ERROR ceilometer.dispatcher.database [-] Failed to record metering data: (_mysql_exceptions.DataError) (1406, "Data too long for column 'resource_id' at row 1") [SQL: u'INSERT INTO resource (user_id, project_id, source_id, resource_id, resource_metadata, metadata_hash) VALUES (%s, %s, %s, %s, %s, %s)'] [parameters: ('f61654f6c2ee426191ff2a0952b6423b', '22990abeee3941d8aec34c09bf78d009', 'openstack', 'arn:openstack:heat::22990abeee3941d8aec34c09bf78d009:stacks/AutoScalingSignalTest-1278811483-JobServerGroup-g3ohap5jraxp-ghgun47tpqcs-6gd2g27t75xy/ead09b07-4fac-45b0-ad9c-489f997925fe', '{"state_reason": "Stack CREATE completed successfully", "user_id": "demo", "event_type": "orchestration.stack.create.end", "stack_identity": "arn:openstack:heat::22990abeee3941d8aec34c09bf78d009:stacks/AutoScalingSignalTest-1278811483-JobServerGroup-g3ohap5jraxp-ghgun47tpqcs-6gd2g27t75xy/ead09b07-4fac-45b0-ad9c-489f997925fe", "stack_name": "AutoScalingSignalTest-1278811483-JobServerGroup-g3ohap5jraxp-ghgun47tpqcs-6gd2g27t75xy", "tenant_id": "22990abeee3941d8aec34c09bf78d009", "state": "CREATE_COMPLETE", "create_at": "2015-06-25T17:39:35.462814", "host": "orchestration.ubuntu"}', '2012a5727086e717f5343dc41e126b06')]

Changed in heat:
status: New → Triaged
importance: Undecided → High
Revision history for this message
gordon chung (chungg) wrote :

sorry i misspoke on the length, we lowered to 128[1]. this is still twice the longest typical uuid but if there are any issues with this, please raise and we can look to adjust it.

[1] https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/sqlalchemy/migrate_repo/versions/043_reduce_uuid_data_types.py

Changed in heat:
assignee: nobody → Kairat Kushaev (kkushaev)
Revision history for this message
Steven Hardy (shardy) wrote :

@gordon chung: How will you handle migrations in this case? I think this bug proves that you will break many alarms for existing heat stacks when they upgrade to liberty with this change, unless we do something clever during the upgrade to rewrite the arn ID with a UUID?

Maybe it's enough to split the ID from the arn in stack_identifier, e.g

"stack_identity": "arn:openstack:heat::22990abeee3941d8aec34c09bf78d009:stacks/AutoScalingSignalTest-1278811483-JobServerGroup-g3ohap5jraxp-ghgun47tpqcs-6gd2g27t75xy/ead09b07-4fac-45b0-ad9c-489f997925fe",

Could become stack_id: ead09b07-4fac-45b0-ad9c-489f997925fe

And you could drop the stack_identity column?

Revision history for this message
gordon chung (chungg) wrote :

we currently don't have a migration plan. i will look into that. we may need to revert or original item but i think it'd be good to still modify the ids in heat to be less verbose.

Changed in ceilometer:
status: New → Triaged
importance: Undecided → High
assignee: nobody → gordon chung (chungg)
Changed in ceilometer:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ceilometer (master)

Change abandoned by gordon chung (<email address hidden>) on branch: master
Review: https://review.openstack.org/196115
Reason: https://review.openstack.org/#/c/196190/

we need to support trunk chasers

Revision history for this message
Steven Hardy (shardy) wrote :

> i think it'd be good to still modify the ids in heat to be less verbose.

Yeah I agree, that's definitely a historical mistake on heat's part, I just want to ensure we don't break any existing environments in the process :)

Changed in ceilometer:
status: In Progress → Fix Committed
Changed in heat:
status: Triaged → In Progress
Revision history for this message
Zane Bitter (zaneb) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/196123
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=d8c41029b4443fdfac1aaee8c8b704ee527fdc39
Submitter: Jenkins
Branch: master

commit d8c41029b4443fdfac1aaee8c8b704ee527fdc39
Author: kairat_kushaev <email address hidden>
Date: Fri Jun 26 18:49:58 2015 +0300

    Reduce size of stack_identity in heat notifications

    Reduce "stack_identity" field in heat notifications because
    it is too long for other consumers (at least for ceilometer).
    So UUID of the stack will be used as stack identity instead
    of arn in heat notifications.
    NOTE: stack statistics for existing stacks will not be
    considered in ceilometer because we changed stack identity
    and ceilometer recognize stacks with UUIDs as
    "new" resources. I consulted with gordonchung about this
    and it seems that it is not critical for ceilometer.

    Closes-bug: #1468916
    Change-Id: I74d192b8076c344dceab5754681c129a9e0fcd22

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-2 → 5.0.0
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-2 → 5.0.0
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.