From: Matt Clark <matt@ymogen.net>
To: pgsql-admin@postgresql.org
Subject: Re: LVM snapshots
Date: Fri, 14 Mar 2003 16:28:26 -0000
Message-ID: <OAEAKHEHCMLBLIDGAFELAEAODBAA.matt@ymogen.net> (raw)
In-Reply-To: <996802F75C3CD411B424001083FA445B534D51@CET_PONXX_FP001>
RE: [ADMIN] LVM snapshotsThat's what I thought. The docs are a bit coy on
this point. Section 9.2 says "The database server must be shut down in
order to get a usable backup. Half-way measures such as disallowing all
connections will not work as there is always some buffering going on. For
this reason it is also not advisable to trust file systems that claim to
support "consistent snapshots".
But LVM calls fsync_dev_lockfs() before the snapshot is taken, and
unlockfs() afterwards, so there are guaranteed to be no dirty buffers lying
around - the tradeoff is that calls to write() will block until all the
buffers are written to disk and the snapshot set up, but that shouldn't take
long.
BTW I see I was wrong in my original question about tar &c being unsuitable,
I don't know where I got that idea from, so taking a snapshot every 10 mins
and doing an rsync should be pretty cheap in terms of write IO, though it
will increase the CPU demands above those for a simple copy, and doesn't
save anything on read IO.
Is there some other interpretation of Section 9.2 of the docs that means the
reasoning on fsync_dev_lockfs above is wrong or inadequate?
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Trewern, Ben
Sent: 14 March 2003 16:03
To: 'David F. Skoll'; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] LVM snapshots
I don't see why not. What happens if your server crashes? Hopefully
what's on the disk is consistent (one of the good reasons to use
Postgresql).
BTW I've heard of someone else doing something like this and using rsync.
He was running it just before the snapshot and then again against the
snapshot. This should then reduce the amount of time the actual snapshot
needs to be kept.
Regards,
Ben
-----Original Message-----
From: David F. Skoll [mailto:dfs@roaringpenguin.com]
Sent: 14 March 2003 15:52
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] LVM snapshots
On Fri, 14 Mar 2003, Matt Clark wrote:
> Has anyone tried taking an LVM snapshot of a running DB?
I don't think there's a guarantee that a snapshot of the file system
corresponds to a consistent database, even if the snapshot corresponds
to a single point-in-time.
--
David.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
****************************************************************************
*
This email and any attachments transmitted with it are confidential
and intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the sender and do not store, copy or disclose the content
to any other person.
It is the responsibility of the recipient to ensure that opening this
message and/or any of its attachments will not adversely affect
its systems. No responsibility is accepted by the Company.
****************************************************************************
*
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: matt@ymogen.net
Subject: Re: LVM snapshots
In-Reply-To: <OAEAKHEHCMLBLIDGAFELAEAODBAA.matt@ymogen.net>
References: <996802F75C3CD411B424001083FA445B534D51@CET_PONXX_FP001> <OAEAKHEHCMLBLIDGAFELAEAODBAA.matt@ymogen.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox