Migration finishes before updating share model

Bug #1665072 reported by Rodrigo Barbieri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Rodrigo Barbieri

Bug Description

As captured in a CI, the error below pops up if the tempest test pools the share details between https://github.com/openstack/manila/blob/3d5b2d08d04a0b3eda494e0d43917e203a226b65/manila/share/manager.py#L1437 and https://github.com/openstack/manila/blob/3d5b2d08d04a0b3eda494e0d43917e203a226b65/manila/share/manager.py#L1339

task_state should not be set to migration_success if migration is not finished.

16:53:21 2017-02-15 16:53:21.598 | {1} manila_tempest_tests.tests.api.admin.test_migration.MigrationWithDifferentSnapshotSupportNFSTest.test_migrate_share_to_no_snapshot_capability_share_type_1_True [42.927329s] ... FAILED

16:56:28 2017-02-15 16:56:28.874 | Captured traceback:
16:56:28 2017-02-15 16:56:28.875 | ~~~~~~~~~~~~~~~~~~~
16:56:28 2017-02-15 16:56:28.877 | Traceback (most recent call last):
16:56:28 2017-02-15 16:56:28.878 | File "/usr/local/lib/python2.7/dist-packages/ddt.py", line 139, in wrapper
16:56:28 2017-02-15 16:56:28.879 | return func(self, *args, **kwargs)
16:56:28 2017-02-15 16:56:28.880 | File "/opt/stack/new/manila/manila_tempest_tests/tests/api/admin/test_migration.py", line 621, in test_migrate_share_to_no_snapshot_capability_share_type
16:56:28 2017-02-15 16:56:28.882 | force_host_assisted, False)
16:56:28 2017-02-15 16:56:28.883 | File "/opt/stack/new/manila/manila_tempest_tests/tests/api/admin/test_migration.py", line 314, in _validate_share_migration_with_different_snapshot_capability_type
16:56:28 2017-02-15 16:56:28.884 | self.assertEqual(False, share['snapshot_support'])
16:56:28 2017-02-15 16:56:28.885 | File "/usr/local/lib/python2.7/dist-packages/testtools/testcase.py", line 411, in assertEqual
16:56:28 2017-02-15 16:56:28.887 | self.assertThat(observed, matcher, message)
16:56:28 2017-02-15 16:56:28.888 | File "/usr/local/lib/python2.7/dist-packages/testtools/testcase.py", line 498, in assertThat
16:56:28 2017-02-15 16:56:28.889 | raise mismatch_error
16:56:28 2017-02-15 16:56:28.891 | testtools.matchers._impl.MismatchError: False != True

https://github.com/openstack/manila/blob/3d5b2d08d04a0b3eda494e0d43917e203a226b65/manila_tempest_tests/tests/api/admin/test_migration.py#L314

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/434462

Changed in manila:
assignee: nobody → Rodrigo Barbieri (rodrigo-barbieri2010)
status: New → In Progress
Changed in manila:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/434462
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=41813736718e2b81d1d907bf49feb1940c1e990f
Submitter: Jenkins
Branch: master

commit 41813736718e2b81d1d907bf49feb1940c1e990f
Author: Rodrigo Barbieri <email address hidden>
Date: Wed Feb 15 16:41:34 2017 -0200

    Fix migration_success before completing

    Share task_state was set to migration_success
    before completing migration. There was still
    updates to the share model to be performed
    before completing.

    Also, small refactoring in host-assisted
    migration's migration_complete that was not
    setting the task_state migration_completing
    at the proper time, allowing a bigger window
    for 2 concurrent migration_complete calls.

    Change-Id: I88df15446ffe34f3f12770d53c3e03d232f495c2
    Closes-bug: #1665072

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/435424

Changed in manila:
milestone: none → pike-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/ocata)

Reviewed: https://review.openstack.org/435424
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=d635fffd2109bc98000624e08a2f3e606dca3dad
Submitter: Jenkins
Branch: stable/ocata

commit d635fffd2109bc98000624e08a2f3e606dca3dad
Author: Rodrigo Barbieri <email address hidden>
Date: Wed Feb 15 16:41:34 2017 -0200

    Fix migration_success before completing

    Share task_state was set to migration_success
    before completing migration. There was still
    updates to the share model to be performed
    before completing.

    Also, small refactoring in host-assisted
    migration's migration_complete that was not
    setting the task_state migration_completing
    at the proper time, allowing a bigger window
    for 2 concurrent migration_complete calls.

    Commit 41813736718e2b81d1d907bf49feb1940c1e990f in master
    introduced bug 1667450, so we are including partial commit
    fae08f97f17b3dc6dfaa8df7679660707c518c3a (except release-notes),
    squashing it into this fix.

    Change-Id: I88df15446ffe34f3f12770d53c3e03d232f495c2
    Closes-bug: #1665072
    (cherry picked from commit 41813736718e2b81d1d907bf49feb1940c1e990f)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 5.0.0.0b1

This issue was fixed in the openstack/manila 5.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 4.0.1

This issue was fixed in the openstack/manila 4.0.1 release.

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.