From owner-freebsd-fs@freebsd.org Wed Apr 1 16:47:38 2020 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC191279233 for ; Wed, 1 Apr 2020 16:47:38 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from lwfs1-cam.cam.lispworks.com (mail.lispworks.com [46.17.166.21]) by mx1.freebsd.org (Postfix) with ESMTP id 48ssYt2QhVz3Fv6 for ; Wed, 1 Apr 2020 16:47:29 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (higson.cam.lispworks.com [192.168.1.7]) by lwfs1-cam.cam.lispworks.com (8.15.2/8.15.2) with ESMTP id 031GlHHa022874; Wed, 1 Apr 2020 17:47:17 +0100 (BST) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (localhost.localdomain [127.0.0.1]) by higson.cam.lispworks.com (8.14.4) id 031GlHPU011169; Wed, 1 Apr 2020 17:47:17 +0100 Received: (from martin@localhost) by higson.cam.lispworks.com (8.14.4/8.14.4/Submit) id 031GlHqa011166; Wed, 1 Apr 2020 17:47:17 +0100 Date: Wed, 1 Apr 2020 17:47:17 +0100 Message-Id: <202004011647.031GlHqa011166@higson.cam.lispworks.com> From: Martin Simmons To: mike tancsa CC: freebsd-fs@freebsd.org In-reply-to: <42019eac-4211-8265-e73e-d3b418b870fe@sentex.net> (message from mike tancsa on Wed, 1 Apr 2020 10:09:55 -0400) Subject: Re: zfs promote References: <202004011102.031B2an5008896@higson.cam.lispworks.com> <42019eac-4211-8265-e73e-d3b418b870fe@sentex.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48ssYt2QhVz3Fv6 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of martin@lispworks.com has no SPF policy when checking 46.17.166.21) smtp.mailfrom=martin@lispworks.com X-Spamd-Result: default: False [-0.63 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.87)[-0.869,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.74)[-0.742,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lispworks.com]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[21.166.17.46.list.dnswl.org : 127.0.10.0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:51055, ipnet:46.17.166.0/24, country:GB]; IP_SCORE(-0.01)[country: GB(-0.07)] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2020 16:47:39 -0000 >>>>> On Wed, 1 Apr 2020 10:09:55 -0400, mike tancsa said: > > On 4/1/2020 7:02 AM, Martin Simmons wrote: > > > > Were you intending to keep both nfs3zroot/cyclenet and nfs3zroot/cyclenetlive? > > No, just nfs3zroot/cyclenetlive OK, that simplifies things. > > Not quite. Beware this from the documentation: > > > > "The clone parent-child dependency relationship is reversed, so that the > > origin file system becomes a clone of the specified file system." > > > > and > > > > "The snapshot that was cloned, and any snapshots previous to this snapshot, > > are now owned by the promoted clone." > > > > Therefore doing zfs promote nfs3zroot/cyclenetlive will cause > > nfs3zroot/cyclenet to become a clone of nfs3zroot/cyclenetlive@clean3. If you > > then want to destroy nfs3zroot/cyclenetlive@clean3, you will first need to > > destroy nfs3zroot/cyclenet. > > Hmm, I am trying to get my head around this. I should first simulate > this in a test environment of course.  What you wrote however seems > reversed, but perhaps my perspective is backwards to what is written ? Yes, promote is a snapshot twister :-) > ie Originally I did a > > > zfs clone nfs3zroot/cyclenet@clean3 nfs3zroot/cyclenetlive > > so I read that as I made a clone called cyclenetlive of the snapshot > nfs3zroot/cyclenet@clean3 ? Correct. I.e. before promote, nfs3zroot/cyclenet and nfs3zroot/cyclenetlive share data with the @clean3 snapshot of nfs3zroot/cyclenet: nfs3zroot/cyclenet@clean3 ^ ^ | | | nfs3zroot/cyclenetlive | nfs3zroot/cyclenet > So if promote reverses that, so > nfs3zroot/cyclenet@clean3 becomes a clone of nfs3zroot/cyclenetlive ?  > so I can then delete nfs3zroot/cyclenet@clean3 ? No, that is confused, at least in the names of things: nfs3zroot/cyclenet@clean3 is a snapshot so it cannot itself be a clone. What happens is that the @clean3 snapshot is transferred from nfs3zroot/cyclenet to nfs3zroot/cyclenetlive, so it now called nfs3zroot/cyclenetlive@clean3. ("The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone.") In addition, nfs3zroot/cyclenet ("the origin file system") becomes a clone of nfs3zroot/cyclenetlive ("the specified file system"), joined at the transferred @clean3 snapshot. I.e. after promote, nfs3zroot/cyclenet and nfs3zroot/cyclenetlive share data with the @clean3 snapshot of nfs3zroot/cyclenetlive: nfs3zroot/cyclenetlive@clean3 ^ ^ | | | nfs3zroot/cyclenet | nfs3zroot/cyclenetlive That is why you would then need to destroy nfs3zroot/cyclenet before you can destroy nfs3zroot/cyclenetlive@clean3. __Martin