From owner-freebsd-fs@FreeBSD.ORG Thu Jul 4 00:55:41 2013 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C4F6AD4F for ; Thu, 4 Jul 2013 00:55:41 +0000 (UTC) (envelope-from berend@pobox.com) Received: from smtp.pobox.com (b-pb-sasl-quonix.pobox.com [208.72.237.35]) by mx1.freebsd.org (Postfix) with ESMTP id 90C8C112B for ; Thu, 4 Jul 2013 00:55:41 +0000 (UTC) Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 239DB22AD6; Thu, 4 Jul 2013 00:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date :message-id:from:to:cc:subject:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=sasl; bh=G2HHEnFxiiBtBC+C13z5tWEJQnQ=; b=Zhn8KSB4pC0NoolKWbINsliIj1MS MoWMqQdvVlCQ2xCy4YLnFZ80KR10PDbqRTEvVsQkC5z/9DZkbTDDG3a8QcudHepn IrqB6sqKESWn5FTF9aKdZrJry+3RgHtOGetVjZMR08GgdlDW+TyKCi7MvtiWbxtU 0C1p06a2zIx1dA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=date:message-id :from:to:cc:subject:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=h9CTtV lLVBiO5pfsynoJrUOtV+Y9/Xrtyq6LYY7KIV8RmjUy4lgtfuRMf4aWXJjffOuek3 drYwZFA9D5Q0T1JUue8mWcb1wbNZ/GBlZcxkW6z/xzURh2/RIazoBfM8gi6nwMyD uapBTVX8dgZcefpuX1ebIiqYMQYa9g3KxMBdY= Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 19ABE22AD4; Thu, 4 Jul 2013 00:55:40 +0000 (UTC) Received: from bmach.nederware.nl (unknown [27.252.247.84]) by b-sasl-quonix.pobox.com (Postfix) with ESMTPA id 3553922AD2; Thu, 4 Jul 2013 00:55:39 +0000 (UTC) Received: from quadrio.nederware.nl (quadrio.nederware.nl [192.168.33.13]) by bmach.nederware.nl (Postfix) with ESMTP id 096B15C80; Thu, 4 Jul 2013 12:55:32 +1200 (NZST) Received: from quadrio.nederware.nl (quadrio.nederware.nl [127.0.0.1]) by quadrio.nederware.nl (Postfix) with ESMTP id 9696849FB971; Thu, 4 Jul 2013 12:55:36 +1200 (NZST) Date: Thu, 04 Jul 2013 12:55:36 +1200 Message-ID: <87bo6j3zzr.wl%berend@pobox.com> From: Berend de Boer To: "Steven Hartland" Subject: Re: EBS snapshot backups from a FreeBSD zfs file system: zpool freeze? In-Reply-To: References: <87li5o5tz2.wl%berend@pobox.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.3 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: Xplain Technology Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Jul__4_12:55:36_2013-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 71C66F64-E444-11E2-8604-E84251E3A03C-48001098!b-pb-sasl-quonix.pobox.com Cc: freebsd-fs@FreeBSD.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 00:55:41 -0000 --pgp-sign-Multipart_Thu_Jul__4_12:55:36_2013-1 Content-Type: text/plain; charset=US-ASCII >>>>> "Steven" == Steven Hartland 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 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--