This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 174701 - pvcreate should automatically make a backup of what it overwrites
pvcreate should automatically make a backup of what it overwrites
Status: ASSIGNED
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Petr Rockai
Cluster QE
: FutureFeature
: 236168 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-01 10:46 EST by Alasdair Kergon
Modified: 2013-02-08 06:54 EST (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-04-20 09:05:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
lvm2-pvcreate-undo-prelim (21.41 KB, patch)
2007-04-11 12:43 EDT, Petr Rockai
no flags Details | Diff
lvm2-pvcreate-undo-iter2.diff (24.84 KB, patch)
2007-04-13 06:33 EDT, Petr Rockai
no flags Details | Diff

  None (edit)
Description Alasdair Kergon 2005-12-01 10:46:17 EST
LVM2 pvcreate should make an automatic backup of the part of
the device that it overwrites, so you can undo it.

(Could add as a generic option in the low-level write function, so other
commands could use it too.)

[split off from bugzilla 168330]
Comment 2 RHEL Product and Program Management 2006-08-18 12:54:29 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 9 Petr Rockai 2007-04-11 12:43:35 EDT
Created attachment 152288 [details]
lvm2-pvcreate-undo-prelim

Here comes a preliminary patch implementing basic pvcreate --undo
functionality. It has a few rough edges yet, like there is no configuration
option to disable pvcreate archive creation (easy to fix) and that
offset/length pairs are written out in host byte order (needs ntohll/htonll
which seem to be missing from libc? needs investigation).

The design is simplistic, it provides new device write primitives suffixed
_backup that take an extra file descriptor argument, which they use to write
out a copy of whatever they are going to overwrite, prepended with offset and
length of the block.

The restore function takes a file that contains several such blocks and writes
them over in their original positions, in reverse order from the file. This
allows for easy backup implementation, where a backup file is created and
opened for writing, its fd is passed to every device write operation and file
is closed. Then, restore takes the opened device and a filename of backup file.


Things like further metadata about the operation are left for higher layers, in
this case pvcreate. Current implementation just uses <archive_dir>/<uuid>.pv as
backup file and --undo on a PV looks for this file which when found is used for
restore. There is room for a more elaborate operation logfile, which may
reference the (simplistic) binary backup files. Any checksumming should be
probably done on that (operation logfile) level as well.

To make it possible for format_text to use the backup-enabled device
operations, i have added device_backup_fd to toolcontext. This may need
different addressing as well, although there is not much room for maneuvering
-- probably either way, all dev_write/dev_set calls that need backup
functionality will have to be modified in a way or other (either replace them
with versions that take toolcontext parameter, or the _backup versions).

I will followup with improved patches either tonight or tomorrow.
Comment 10 Petr Rockai 2007-04-13 06:33:16 EDT
Created attachment 152529 [details]
lvm2-pvcreate-undo-iter2.diff

Second iteration of the patch, fixes byte ordering and configuration file
issues, plus minor style cleanups.
Comment 11 RHEL Product and Program Management 2007-05-09 07:04:40 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 13 Suzanne Yeghiayan 2007-09-17 16:05:15 EDT
This request was previously evaluated by Red Hat Product Management
for inclusion in the current Red Hat Enterprise Linux release, but
Red Hat was unable to resolve it in time.  This request will be
reviewed for a future Red Hat Enterprise Linux release.
Comment 14 Petr Rockai 2008-04-15 12:57:35 EDT
We have decided with Alasdair to rework this patch differently, for improved 
maintainability and future-proofness. The feature is not critical in any way 
and can be deferred for next update. I will followup with updates when the 
work on this is resumed.
Comment 15 RHEL Product and Program Management 2008-09-05 13:08:20 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 16 Tom Coughlan 2009-01-26 09:51:44 EST
(In reply to comment #14)

> The feature is not critical in any way 
> and can be deferred for next update.

We have decided that the risk associated with this feature is not worth the benefit at this point in the life of RHEL 4. Instead, we will defer the feature to RHEL 5.
Comment 18 Milan Broz 2009-06-18 10:16:01 EDT
*** Bug 236168 has been marked as a duplicate of this bug. ***
Comment 19 Petr Rockai 2009-09-22 08:48:45 EDT
I'll get to this, now that vg_read and other infrastructure work is mostly settled. I have a good idea what needs to be done so it should be a simple matter of coding.

Actually, there might be some user interface issues to sort out, since the move to implicit pvcreate (but this feature also becomes more relevant due to that change).
Comment 23 Petr Rockai 2010-05-19 10:52:41 EDT
I'm lowering the priority on this, as this has been in progress for a *long* time. The patch exists, it is mostly merge-ready but it has not been a priority so far. Presumably this will get merged sooner or later.
Comment 24 Petr Rockai 2010-10-13 12:28:29 EDT
The latest iteration of this patch is available from https://www.redhat.com/archives/lvm-devel/2010-October/msg00008.html
Comment 25 Petr Rockai 2010-11-25 09:55:30 EST
Superseded by http://www.redhat.com/archives/lvm-devel/2010-November/msg00054.html
Comment 26 RHEL Product and Program Management 2011-01-11 15:11:29 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 27 RHEL Product and Program Management 2011-01-11 18:03:41 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 28 Alasdair Kergon 2011-02-11 15:36:15 EST
Patches awaiting my review.
Comment 29 Petr Rockai 2011-04-11 12:58:19 EDT
According to current plan, we hope to clear this before May, meaning it should comfortably hit 5.8.
Comment 34 RHEL Product and Program Management 2012-04-02 06:21:21 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 36 RHEL Product and Program Management 2012-04-20 09:05:06 EDT
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.