X-Original-To: pgsql-admin@postgresql.org Received: from biscay.ymogen.com (biscay.ymogen.net [194.164.6.62]) by postgresql.org (Postfix) with SMTP id BFE83474E53 for ; Mon, 17 Mar 2003 10:16:20 -0500 (EST) Received: (qmail 32143 invoked from network); 17 Mar 2003 15:16:24 -0000 Received: from unknown (HELO solent) (mailuser@213.165.136.12) by 0 with SMTP; 17 Mar 2003 15:16:24 -0000 From: "Matt Clark" To: "Tom Lane" Cc: =?iso-8859-1?Q?Ragnar_Kj=C3zrstad?= , "Peter Eisentraut" , "Murthy Kambhampaty" , Subject: Re: LVM snapshots Date: Mon, 17 Mar 2003 15:16:19 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: <6139.1047913167@sss.pgh.pa.us> X-Archive-Number: 200303/258 X-Sequence-Number: 7898 > Ah, I see: so while the freeze is on, writes to the frozen volume cost > about 3x normal (1 write -> 1 read + 2 writes), but establishing and > discontinuing the freeze cost nothing. And if you have a crash the > volume is still in the proper state. Good. I think that should be 1 read + 2 writes for the first write to a given block, but just 1 write from then on. > No, you only have to drop the freeze; the original volume is not broken. Yeah, only the snapshot is damaged > > I would wonder though about the datastructure that LVM uses to remember > which blocks of the frozen volume have been copied (and where) on the > snapshot area. I assume this table lives in kernel memory --- what > happens if it gets large? > /* copy on write tables in disk format */ typedef struct lv_COW_table_disk_v1 { uint64_t pv_org_number; uint64_t pv_org_rsector; uint64_t pv_snap_number; uint64_t pv_snap_rsector; } lv_COW_table_disk_t; Looks like 256 bytes per disk block. At a default LVM block size of 64KB that's a 4MB table for 1GB of dirty blocks, plus whatever hash table overhead there might be. Not much at any rate.