volume status should be updated after terminate_connection is done

Bug #1488857 reported by Huang Zhiteng
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Huang Zhiteng

Bug Description

Current volume API terminate_connection() updates volume's status in DB before volume driver finishes terminate_connection(). In cases where volume driver needs some time complete terminate_connection(), it means volume becomes 'available' before volume driver done cleaning up. And that might end up causing race condition if user try to attach the volume before backend is ready.

Changed in cinder:
assignee: nobody → Huang Zhiteng (zhiteng-huang)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/199015
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=bf5d39277e7c02df3994f3a5019b60f7a64f9b07
Submitter: Jenkins
Branch: master

commit bf5d39277e7c02df3994f3a5019b60f7a64f9b07
Author: Zhiteng Huang <email address hidden>
Date: Tue Jul 7 16:31:32 2015 +0800

    Update volume status AFTER terminate_connection is done

    Current volume API terminate_connection() updates volume's status in
    DB before volume driver finishes terminate_connection(). In cases
    where volume driver needs some time complete terminate_connection(),
    it means volume becomes 'available' before volume driver done cleaning
    up. This fix changes the order of 'unreserve_volume' (updating DB)
    and driver's terminate_connection to make sure when volume is marked
    'available' the client has done cleaning connection.

    Note that terminate_connection volume RPC API is a synchronized call,
    but volume manager/driver doesn't return any value to caller. What's
    more, when volume API extension calls volume terminate_connection API,
    it doesn't expect return values, so this change removes unnecessary
    return values from volume API.

    Closes-bug: #1488857

    Change-Id: If79f7ce9a7d238b41be4c6befa0f3cac30ab06a3

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.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.