Test volume race condition between losetup and pvdisplay

Bug #1614467 reported by Jiří Stránský
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-cinder
Fix Released
High
Jiří Stránský

Bug Description

All seems fine on the first creation of loop device and initializing a physical volume on it, but there seems to be a race when Puppet restores an already existing configuration.

Losetup restores the loop device which already contains an existing LVM physical volume, but it seems that the `pvdisplay` command that prevents the following `pvcreate` from executing runs too early, it doesn't see the existing physical volume yet, and then pvcreate command fails because the physical volume already exists:

Setup_test_volume/Exec[pvcreate /dev/loop2]/returns: Can't initialize physical volume "/dev/loop2" of volume group "cinder-volumes" without -ff

This is the code in question:

https://github.com/openstack/puppet-cinder/blob/a97128fb2b8c1b6d1fe8cf999c01e0a56403475c/manifests/setup_test_volume.pp#L40-L50

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-cinder (master)

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

Changed in puppet-cinder:
assignee: nobody → Jiří Stránský (jistr)
status: New → In Progress
Changed in puppet-cinder:
importance: Undecided → High
milestone: none → 9.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-cinder (master)

Reviewed: https://review.openstack.org/357082
Committed: https://git.openstack.org/cgit/openstack/puppet-cinder/commit/?id=8ed56a09b19defbec594ca410e9697fdcd187fe3
Submitter: Jenkins
Branch: master

commit 8ed56a09b19defbec594ca410e9697fdcd187fe3
Author: Jiri Stransky <email address hidden>
Date: Thu Aug 18 12:30:18 2016 +0200

    Loopback volume - prevent race between losetup and pvdisplay

    Wait for udev events to get handled after setting up the loop device, so
    that if there already is an LVM physical volume on the loop device,
    pvdisplay sees it and pvcreate doesn't get called (pvcreate would fail
    in such case).

    Change-Id: I4672471bcd273a350ec0499dffb98b073efce081
    Closes-Bug: #1614467

Changed in puppet-cinder:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/puppet-cinder 9.2.0

This issue was fixed in the openstack/puppet-cinder 9.2.0 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.