dm snapshot based asynchronous replication
A message that is not in the archive (sent off-list or not yet received): 137413921.2150341239820262767.JavaMail.root@zimbra16-e3.priv.proxad.net
Quoted 1 line
Should I understand there's no way for userspace to extract from the device mapper the cow'ed chunk list of a vanilla snapshot ?
Replying to myself, I found an instructive post from Lars of the drdb folks : http://markmail.org/message/7qdbp36tohasojuy (thanks for sharing Lars)
This script is easy enough to morph from its original snapshot reverting purpose to the replication model using the cow device as a changelog I described.
Thanks for the inputs. I'll keep posting if I something of general interest comes out of this stuff.
PS:
example per-chunk dump/load dd generated by the script :
root@tstparunx1:/$ /tmp/exceptions.pl /dev/mapper/tstservcva-snap0-cow # found snapshot header for chunk_size=8 sectors # dump: dd if=$lastsnap of=$replayfile seek=125 iflag=direct count=1 bs=8b # load: dd if=$replayfile of=$replica skip=0 seek=125 iflag=direct count=1 bs=8b # dump: dd if=$lastsnap of=$replayfile seek=1250 iflag=direct count=1 bs=8b # load: dd if=$replayfile of=$replica skip=1 seek=1250 iflag=direct count=1 bs=8b # dump: dd if=$lastsnap of=$replayfile seek=50 iflag=direct count=2 bs=8b # load: dd if=$replayfile of=$replica skip=2 seek=50 iflag=direct count=2 bs=8b # dump: dd if=$lastsnap of=$replayfile seek=151 iflag=direct count=1 bs=8b # load: dd if=$replayfile of=$replica skip=4 seek=151 iflag=direct count=1 bs=8b # dump: dd if=$lastsnap of=$replayfile seek=126 iflag=direct count=1 bs=8b # load: dd if=$replayfile of=$replica skip=5 seek=126 iflag=direct count=1 bs=8b # found 6 exceptions (24 kB) ## use these dd commands AT YOUR OWN RISK
Quoted 7 lines · On Wed, Apr 15, 2009 at 08:31:44PM +0200, [email protected] wrote:
Quoted 1 line
Should I understand there's no way for userspace to extract from the device mapper the cow'ed chunk list of a vanilla snapshot ?
Replying to myself, I found an instructive post from Lars of the drdb folks : http://markmail.org/message/7qdbp36tohasojuy (thanks for sharing Lars)
This script is easy enough to morph from its original snapshot reverting purpose to the replication model using the cow device as a changelog I described.
Thanks for the inputs. I'll keep posting if I something of general interest comes out of this stuff.
that perl hack was meanwhile ported to C by someone. posted earlier this year on dm-devel.
also please do not ignore the Zumastor work.
Signature · 5 lines
: Lars Ellenberg : LINBIT | Your Way to High Availability : DRBD/HA support and consulting http://www.linbit.com DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
Quoted 5 lines · Lars Ellenberg
Quoted 4 lines · On Wed, Apr 15, 2009 at 08:31:44PM +0200, [email protected] wrote:
Quoted 1 line
Should I understand there's no way for userspace to extract from the device mapper the cow'ed chunk list of a vanilla snapshot ?
Replying to myself, I found an instructive post from Lars of the drdb folks : http://markmail.org/message/7qdbp36tohasojuy (thanks for sharing Lars)
Quoted 7 lines
Quoted 3 lines
This script is easy enough to morph from its original snapshot reverting purpose to the replication model using the cow device as a changelog I described.
Thanks for the inputs. I'll keep posting if I something of general interest comes out of this stuff.
that perl hack was meanwhile ported to C by someone. posted earlier this year on dm-devel.
also please do not ignore the Zumastor work.
It also seems that the script is not generic enough to handle the variety of exception stores that are coming. I just wrote a 'snapshot-merge' target that will do what you ask. I will post the patch shortly. However, this won't help you in RHEL5.
brassow
Quoted 6 lines
It also seems that the script is not generic enough to handle the variety of exception stores that are coming. I just wrote a 'snapshot- merge' target that will do what you ask. I will post the patch shortly. However, this won't help you in RHEL5.
Jonathan,
thank you for this new snapshot-merge target. This plus the shared exception patches will certainly bring the definitive answer for LVM2-based replication/backup/time-navigation needs for RHEL6. I hope btrfs will even bring to the table an interesting alternative sometime in the el6 lifecycle.
But for those stuck with (entitlements on thousands of) el4 and el5 deployments, here is my contribution to the poor-man's async replication :
http://christophe.varoqui.free.fr/rcow/
* rcow.pl
parse a cow device to generate a delta-file of 2 snapshots
* rcowd
handles full sync of remote device and schedule (one-shot or loop) :
- delta-file creation
- snapshot rotation
- delta-file sending to remote
- delta-file load on remote
Todo:
- more error checking
- sequencing cookies :
o store on remote the last delta-file cookie succesfully loaded
o store {prev_cookie, this_cookie} in delta_files
o verify on remote that delta-file(prev_cookie)==last applied cookie
- replace the dd plumbing, though the readability of delta-file + command-file is quite nice for understanding what happen (and may go wrong). May be port to C.
- delta-file historization and rotation
Comments and contributions welcome.
Regards,
cvaroqui