Bug 1601633

Summary: If upgrading fails, the new LV should be removed in the RPM %post script
Product: [oVirt] imgbased Reporter: Ryan Barry <rbarry>
Component: GeneralAssignee: Yuval Turgeman <yturgema>
Status: CLOSED CURRENTRELEASE QA Contact: Yaning Wang <yaniwang>
Severity: high Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, cshao, huzhao, jiaczhan, obockows, qiyuan, weiwang, yaniwang, yaoxu, ycui, yzhao
Target Milestone: ovirt-4.2.6Flags: rule-engine: ovirt-4.2+
cshao: testing_ack+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: imgbased-1.0.24 Doc Type: Bug Fix
Doc Text:
Cause: When upgrading an ovirt-node-ng image, imgbased creates LVs for the new layer and for some NIST partitions when necessary. If the upgrade fails, those LVs will remain on the system. Consequence: Trying to reapply an image-update rpm will fail on existing LVs Fix: imgbased registers every LV it creates in the upgrade process, so if it fails it will delete those stale LVs Result: No unused LVs are left on the system.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-03 15:08:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1622025    

Description Ryan Barry 2018-07-16 23:18:47 UTC
Description of problem:
If upgrading to the newest version of Node fails, the LV created to hold the new layer is left on the system.

This means that subsequent updates may fail (either because the new LV already exists, or because /etc remediation may copy problematic files from /etc to a newer layer)

Version-Release number of selected component (if applicable):
Any

How reproducible:
100%

Steps to Reproduce:
1. Fail an upgrade to a newer version of Node (unmounted but extant /var/crash, for example)

Actual results:
The new LV is present

Expected results:
The new LV should be removed on failure

Additional info:

Comment 1 Yaning Wang 2018-08-27 07:50:46 UTC
Verified Steps:

1. fresh install rhvh-4.2.3-20180531
2. umount /var/crash
3. upgrade to rhvh-4.2-20180815.0
4. upgrade failed

Actual results:

The new LV should be removed on failure

# imgbase w
You are on rhvh-4.2.3.1-0.20180531.0+1