Inconsistent usage of 'server_default' parameter in models and migrations

Bug #1295539 reported by Ann Taraday
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Ann Taraday

Bug Description

In ml2 models parameter 'default' is used for vnic_type, profile and vif_details, but in migrations 27cc183af192_ml2_vnic_type, 157a5d299379_ml2_binding_profile and 50d5ba354c23_ml2_binding_vif_details 'server_default' parameter is used. So in database there is default values for this columns http://paste.openstack.org/show/85634/.

Also if in models mentions 'default' it is better to add this into db, as this default could be reached only via code. This situation happened for the following models http://paste.openstack.org/show/85631/

Tags: db
Changed in neutron:
assignee: nobody → Ann Kamyshnikova (akamyshnikova)
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/82073

Changed in neutron:
status: New → In Progress
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/82073
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=40223f44d6e48e09d65c8a0b71ed587c434ed97c
Submitter: Jenkins
Branch: master

commit 40223f44d6e48e09d65c8a0b71ed587c434ed97c
Author: Ann Kamyshnikova <email address hidden>
Date: Fri Mar 21 12:33:30 2014 +0400

    Fix 'server_default' parameter usage in models

    In ml2 models parameter 'default' is used for vnic_type, profile and
    vif_details, but in migrations 27cc183af192_ml2_vnic_type,
    157a5d299379_ml2_binding_profile and
    50d5ba354c23_ml2_binding_vif_details is used 'server_default' parameter.
    Usage 'default' and 'server_default' should be equal in models and
    migration. So models in models is added 'server_default' parameter.

    Partial-bug: #1295539

    Change-Id: If6a17f381d2550daf64916ad3c1b120f41406d56

Kyle Mestery (mestery)
Changed in neutron:
milestone: none → juno-2
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit ffdfd3368db157f2c178dd319a28b00c505b2da1
Author: Ann Kamyshnikova <email address hidden>
Date: Tue Jul 8 12:52:44 2014 +0400

    Add 'server_default' parameter

    If a model mentions 'default' it is better to set 'server_default'
    as well because this 'defaut' can be reached only via code. This
    change adds 'server_default' parameter to models and in database,
    so if someone will use SQL query it will also use default value.

    For model Router added parameter server_default. In migration it was
    added by this change https://review.openstack.org/105212.

    For model MeteringLabelRule added parameter server_default.
    In migration it will be added by heal script due to problems
    with Metering plugin and grenade.

    Partial-Bug: #1295539

    Change-Id: Iab6fb4eca73e4918c16dac2945fd8552ae2a0c73

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-2 → 2014.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/166739

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Ann Kamyshnikova (<email address hidden>) on branch: master
Review: https://review.openstack.org/166739
Reason: Not needed

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

Related fix proposed to branch: master
Review: https://review.openstack.org/167233

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

Reviewed: https://review.openstack.org/167233
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4c6b565371cef95b63cb81f2ee90f65c2d560a80
Submitter: Jenkins
Branch: master

commit 4c6b565371cef95b63cb81f2ee90f65c2d560a80
Author: Ann Kamyshnikova <email address hidden>
Date: Tue Mar 24 16:57:55 2015 +0300

    Add some useful notes in devref/db_layer.rst

    Added information about difference between default and server_default
    parameters for columns.

    This was suggested in comments to I466202ac8c378f1e19e42ec2880d0c8fbc35fd28.

    Related-bug: #1295539

    Change-Id: I605ab8a4f3af80497fb8ad21d43fa13d8d533325

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.