From: Kevin Brown <kevin@sysexperts.com>
To: pgsql-performance@postgresql.org
Subject: Re: Mount options for Ext3?
Date: Fri, 24 Jan 2003 18:11:59 -0800
Message-ID: <20030125021159.GC28252@filer> (raw)
In-Reply-To: <28176.1043457408@sss.pgh.pa.us>
References: <200301241120.14404.josh@agliodbs.com>
<20030125003011.GA28252@filer>
<28176.1043457408@sss.pgh.pa.us>
Tom Lane wrote:
> > Otherwise you'd have to worry about write transactions
> > to the transaction log committing before the writes to the data files
> > during a savepoint,
>
> Actually, the other way around is the problem. The WAL algorithm works
> so long as log writes hit disk before the data-file changes they
> describe (that's why it's called write *ahead* log).
Hmm...a case where the transaction data gets written to the files
before the transaction itself even manages to get written to the log?
True. But I was thinking about the following:
I was presuming that when a savepoint occurs, a marker is written to
the log indicating which transactions had been committed to the data
files, and that this marker was paid attention to during database
startup.
So suppose the marker makes it to the log but not all of the data the
marker refers to makes it to the data files. Then the system crashes.
When the database starts back up, the savepoint marker in the
transaction log shows that the transactions had already been committed
to disk. But because the OS wrote the requested data (including the
savepoint marker) out of order, the savepoint marker made it to the
disk before some of the data made it to the data files. And so, the
database is in an inconsistent state and it has no way to know about
it.
But then, I guess the easy way around the above problem is to always
commit all the transactions in the log to disk when the database comes
up, which renders the savepoint marker moot...and leads back to the
scenario you were referring to...
If the savepoint only commits the older transactions in the log (and
not all of them) to disk, the possibility of the situation you're
referring would, I'd think, be reduced (possibly quite considerably).
...or is my understanding of how all this works completely off?
--
Kevin Brown kevin@sysexperts.com
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-performance@postgresql.org
Cc: kevin@sysexperts.com
Subject: Re: Mount options for Ext3?
In-Reply-To: <20030125021159.GC28252@filer>
References: <200301241120.14404.josh@agliodbs.com> <20030125003011.GA28252@filer> <28176.1043457408@sss.pgh.pa.us> <20030125021159.GC28252@filer>
* 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