Extra specs can not be assigned to share type using postgres

Bug #1440089 reported by Valeriy Ponomaryov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Critical
Valeriy Ponomaryov

Bug Description

Here is logs from CI:

http://logs.openstack.org/22/170222/2/check/gate-manila-tempest-dsvm-neutron-postgres/a7b91d3/logs/screen-m-api.txt.gz#_2015-04-03_14_29_41_525

or http://paste.openstack.org/show/198120/

Where we have error:

2015-04-03 14:29:41.527 24140 ERROR manila.share.share_types [req-55a6194b-b1e8-497b-865c-dd33aba77bf8 ] DB error: (ProgrammingError) column "deleted" is of type boolean but expression is of type integer
LINE 1: ...15-04-03T14:29:41.522668'::timestamp, NULL, NULL, 0, 'driver...

for request:

INSERT INTO share_type_extra_specs
(created_at, updated_at, deleted_at, deleted, spec_key, spec_value, share_type_id)

VALUES (%(created_at)s, %(updated_at)s, %(deleted_at)s, %(deleted)s, %(spec_key)s, %(spec_value)s, %(share_type_id)s)

RETURNING share_type_extra_specs.id' {'share_type_id': '35c7fef0-8709-46d7-adc5-6992daea5e63', 'deleted': 0, 'created_at': datetime.datetime(2015, 4, 3, 14, 29, 41, 522668), 'updated_at': None, 'spec_key': u'driver_handles_share_servers', 'deleted_at': None, 'spec_value': u'True'}

It means Manila does not work on PostgreSQL, because this bug is blocker for share creation.

Tags: db postgres
summary: - extra specs can not be assigned using postgres
+ Extra specs can not be assigned to share type using postgres
tags: added: db
tags: added: postgres
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

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

Changed in manila:
assignee: nobody → Valeriy Ponomaryov (vponomaryov)
status: New → In Progress
Changed in manila:
importance: Undecided → Critical
milestone: none → kilo-rc1
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/170555
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=96e049783b94841582f191856c03e62176d4164f
Submitter: Jenkins
Branch: master

commit 96e049783b94841582f191856c03e62176d4164f
Author: Valeriy Ponomaryov <email address hidden>
Date: Fri Apr 3 19:02:37 2015 +0300

    Fix fields 'deleted' in various DB models for PostgreSQL compatibility

    Our migrations set field 'deleted' as Boolean for table
    'share_type_extra_specs', but model 'ShareTypeExtraSpecs' treats it as Integer.
    Same for several other models.
    It works using MySQL as far it uses 'tinyint' storing `1` or `0` there. So, in
    case of MySQL it is always Integer.
    But PostgreSQL fails to write any records there because it distinguishes
    Boolean from Integer. So, fix DB migrations, DB methods and models to make
    mentioned field compatible for PostreSQL backend too.

    Also, reuse func 'model_query' from oslo_db to remove errors with queries that
    contain aggregate functions.

    Change-Id: I0ca00ce86adad893ac786b10324a934d372e2a04
    Closes-Bug: #1440089

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