Snapshot merge in the background?
Last night I tested out the new snapshot merge feature by taking a snapshot, running a dist-upgrade, then lvconvert --merge. After rebooting, it merged the snapshot back into the origin, but it waited for the merge to complete before finishing the boot. Can't the merge be completed in the background while the volume is mounted and the boot continues?
Quoted 4 lines · Phillip Susi
Last night I tested out the new snapshot merge feature by taking a snapshot, running a dist-upgrade, then lvconvert --merge. After rebooting, it merged the snapshot back into the origin, but it waited for the merge to complete before finishing the boot.
"Before finishing the boot"... can you be more specific? Where was it stopped waiting for a snapshot merge? How did you know it was waiting for snapshot merge? Which distro are you using?
Quoted 2 lines
Can't the merge be completed in the background while the volume is mounted and the boot continues?
Yes that is how it _should_ work.
Mike
Quoted 3 lines · Mike Snitzer
"Before finishing the boot"... can you be more specific? Where was it stopped waiting for a snapshot merge? How did you know it was waiting for snapshot merge? Which distro are you using?
It seemed to be stopped waiting for the initial activation of the root lv before continuing with the boot. This manifested as a several minute delay before the gui came up, and when I checked the bootchart image, it was indeed sitting running lvm for a long time before everything else. This is with Ubuntu 10.10.
After some more testing, I have found that the udev rule was running lvchange -a y whenever a PV is added or changed. It seems that nearly any lvm command causes a change event to be emitted on the PVs. Why is this? After I removed the |change clause from the udev rule so that lvchange is no longer run on these change events, I now see that indeed, running lvchange -a manually to reactivate an origin volume with a pending merge does cause it to activate and merge in the background, during which time it can be mounted. Strangely though, while the merge is taking place in the background, I still see change events on the underlying PVs being emitted. Also running lvs while the merge is still on going reports IO errors trying to read the snapshot volume, which makes sense since according to dmsetup table, it consists only of the error target.
With the change to the udev rule, the system boots immediately and finishes the merge in the background, as it should, leading me to conclude that the problem was all of the udev event ping-pong causing udevadm settle to hold up the boot.
Quoted 10 lines · Phillip Susi
Quoted 3 lines · Mike Snitzer
"Before finishing the boot"... can you be more specific? Where was it stopped waiting for a snapshot merge? How did you know it was waiting for snapshot merge? Which distro are you using?
It seemed to be stopped waiting for the initial activation of the root lv before continuing with the boot. This manifested as a several minute delay before the gui came up, and when I checked the bootchart image, it was indeed sitting running lvm for a long time before everything else. This is with Ubuntu 10.10.