Date: Thu, 04 Jul 2013 12:55:36 +1200 From: Berend de Boer <berend@pobox.com> To: "Steven Hartland" <killing@multiplay.co.uk> Cc: freebsd-fs@FreeBSD.org Subject: Re: EBS snapshot backups from a FreeBSD zfs file system: zpool freeze? Message-ID: <87bo6j3zzr.wl%berend@pobox.com> In-Reply-To: <BD8B4240539A46FC9FB86615A7F675CA@multiplay.co.uk> References: <87li5o5tz2.wl%berend@pobox.com> <BD8B4240539A46FC9FB86615A7F675CA@multiplay.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
--pgp-sign-Multipart_Thu_Jul__4_12:55:36_2013-1 Content-Type: text/plain; charset=US-ASCII >>>>> "Steven" == Steven Hartland <killing@multiplay.co.uk> writes: Steven> Not been following the thread really so excuse if this has Steven> already been mentioned ;-) Not yet. Steven> There is a zpool freeze <pool> which stops spa_sync() from Steven> doing anything, so that the only way to record changes is Steven> on the ZIL. Pardon my ignorance, I don't really understand this. First of all, is there a way to recover from a freeze? I.e. do I need to unfreeze? What you're saying is that it is a one way street only? I just did this on my semi-production server to see what is going to happen. Nothing so far. I had a look at the code, this is what it calls: static int zfs_ioc_pool_freeze(zfs_cmd_t *zc) { spa_t *spa; int error; error = spa_open(zc->zc_name, &spa, FTAG); if (error == 0) { spa_freeze(spa); spa_close(spa, FTAG); } return (error); } And spa_freeze is this: void spa_freeze(spa_t *spa) { uint64_t freeze_txg = 0; spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); if (spa->spa_freeze_txg == UINT64_MAX) { freeze_txg = spa_last_synced_txg(spa) + TXG_SIZE; spa->spa_freeze_txg = freeze_txg; } spa_config_exit(spa, SCL_ALL, FTAG); if (freeze_txg != 0) txg_wait_synced(spa_get_dsl(spa), freeze_txg); } All nicely undocumented code. Steven> The comment in the zpool_main is: "'freeze' is a vile Steven> debugging abomination" so it's evil but might be what you Steven> want if you're up to writing some code. Yeah! But thanks for digging this up, I hadn't expected undocumented commands for zpool! Steven> For more info have a look at ztest. Another undocumented tool. How would I use this in this case? -- All the best, Berend de Boer ------------------------------------------------------ Awesome Drupal hosting: https://www.xplainhosting.com/ --pgp-sign-Multipart_Thu_Jul__4_12:55:36_2013-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit Content-Description: OpenPGP Digital Signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABCAAGBQJR1MgIAAoJEKOfeD48G3g5opcP/RiBZ7jhoWckQ2cFaz9pCL3l o0LlYgvHGbrkoCVy4tg4CEF2Y+5iKIsVkk728Tehqv4/RG7mQg7ZgsOQwVs7+cX+ 0I/3r6SG8K35/kUKAvJ2z1LAzehZw3tmin2h41vr7B41F7/hSCkuQwIQRLnFGzHp Ic7OYRpWOAGwBzX7AUt4pYr9INH0Wc3ldl4v06l73HswepmwV78GHKZc5XSIqzin qFQengiFScD6d+ms7h5b8M8CAXC7LJdu/pkjiIhS4LDHBvHokYy59siv3nAg5wAw vTRYkhbRhJJHhmK64m9j1ZtyLQINRYLNAHpeSCYR5RzKDkYJ9oHYalFMWQwN26bi 8T+tW57AJw4ppuh1Q2Scu3oonE58gzli/+wH2fzsvZbiWKGG7jpuwse/wjEcLhtg 1rvkt0z1hBe2z0YnjHcPzMab2rvIke7sJPM6Xk/xiIT0SYnCH9Ka2iVSpWi6nMxP R3HlsMNlulSpKuJXafKTk2mwwyveaWnKnKaPY/bI3Mgdp9z3CC5qi0d8glKY2xQH zwumk8pHI9H8v7oH0avMqTM66M2q/AnOpHTFgjJ9ONCmp9Tr+f2s3CWBmKaE7JJW KaQpaIoeBzIKGQCK5JjBQ1edtfWLrZgBn+RpLRQwXRgicVEXGzOIfDoWoTbBc7si 7eL0yxz6n7+YZmoY0piH =iiSX -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Jul__4_12:55:36_2013-1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87bo6j3zzr.wl%berend>