Matthew Ahrens wrote On 03/24/07 12:13,:
Kangurek wrote:

Thanks for info.
My idea was to traverse changing filesystem, now I see that it will not work.
I will try to traverse snapshots. Zreplicate will:
1. do snapshot @replicate_leatest and
2. send data to snapshot @replicate_leatest
3. wait X sec   ( X = 20 )
4. remove @replicate_previous, rename @replicate_latest to @replicate_previous
5. repeat from 1.

I'm sure it will work, but taking snapshots will be slow on loaded filesystem.
Do you have any idea how to speed up operations on snapshots.
1. remove @replicate_previous
2. rename @replicate_leatest to @replicate_previous
3. create @replicate_leatest


You can avoid the rename by doing:

zfs create @A
again:
zfs destroy @B
zfs create @B
zfs send @A @B
zfs destroy @A
zfs create @A
zfs send @B @A
goto again

I'm not sure exactly what will be slow about taking snapshots, but one aspect might be that we have to suspend the intent log (see call to zil_suspend() in dmu_objset_snapshot_one()). I've been meaning to change that for a while now -- just let the snapshot have the (non-empty) zil header in it, but don't use it (eg. if we rollback or clone, explicitly zero out the zil header). So you might want to look into that.

I've always thought the slowness was due to the txg_wait_synced().
I just counted 5 for one snapshot:

[0]> $c
zfs`txg_wait_synced+0xc(30005c51dc0, 0, 7aa610d3, 70170800, ...)
zfs`zil_commit_writer+0x34c(30010c55200, 151, 151, 1, 3fe, 7aa84600)
zfs`zil_commit+0x68(30010c55200, 151, 0, 30010c5527c, 151, 0)
zfs`zil_suspend+0xc0(30010c55200, 2a1010db240, 0, 0, 30014b32e00, 0)
zfs`dmu_objset_snapshot_one+0x74(0, 2a1010db420, 7aa60700, 0, 0, 0)
zfs`dmu_objset_snapshot+0xe8(300265bd000, 300265bd400, 0, 0, ...)
zfs`zfsdev_ioctl+0x12c(701cf9f0, 701cf660, ffbfe850, 390, 701cf400, ...)

[0]> $c
zfs`txg_wait_synced+0xc(30005c51dc0, 3, 151, c00431549f, 3fe, 7aa84600)
zfs`zil_destroy+0xc(30010c55200, 0, 0, 30010c5527c, 30014b32e00, 0)
zfs`zil_suspend+0x108(30010c55200, 2a1010db240, 30010c5527c, 0, 30014b32e00, 0)
zfs`dmu_objset_snapshot_one+0x74(0, 2a1010db420, 7aa60700, 0, 0, 0)
zfs`dmu_objset_snapshot+0xe8(300265bd000, 300265bd400, 0, 0, ...)
zfs`zfsdev_ioctl+0x12c(701cf9f0, 701cf660, ffbfe850, 390, 701cf400,...)

[0]> $c
zfs`txg_wait_synced+0xc(30005c51dc0, 36f8, 300000593b0, 1f8, 1f8, 180c000)
zfs`zil_destroy+0x1b0(30010c55200, 0, 701d5760, 30010c5527c, ...)
zfs`zil_suspend+0x108(30010c55200, 2a1010db240, 30010c5527c, 0, 30014b32e00, 0)
zfs`dmu_objset_snapshot_one+0x74(0, 2a1010db420, 7aa60700, 0, 0, 0)
zfs`dmu_objset_snapshot+0xe8(300265bd000, 300265bd400, 0, 0, ...)
zfs`zfsdev_ioctl+0x12c(701cf9f0, 701cf660, ffbfe850, 390, 701cf400, ...)

[0]> $c
zfs`txg_wait_synced+0xc(30005c51dc0, 36f9, 300000593b0, 1f8, 1f8, 180c000)
zfs`dsl_sync_task_group_wait+0x11c(300109a7ac8, 30005c51dc0, 7aa60700, ...)
zfs`dmu_objset_snapshot+0x100(300265bd000, 300265bd400, 0, 0, ...)
zfs`zfsdev_ioctl+0x12c(701cf9f0, 701cf660, ffbfe850, 390, 701cf400, ...)

[0]> $c
zfs`txg_wait_synced+0xc(30005c51dc0, 36fa, 300000593b0, 1f8, 1f8, 180c000)
zfs`dsl_sync_task_group_wait+0x11c(300109a7ac8, 30005c51dc0, ...)
zfs`dsl_sync_task_do+0x28(30005c51dc0, 0, 7aa2d898, 300028f7680,...)
zfs`spa_history_log+0x30(300028f7680, 3000dee1490, 0, 7aa2d800, 1, 18)
zfs`zfs_ioc_pool_log_history+0xd8(7aa64c00, 0, 17, 18, 3000dee1490, 7aa64c00)
zfs`zfsdev_ioctl+0x12c(701cf768, 701cf660, ffbfe850, 108, 701cf400,...)


--matt
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to