From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Florian G(dot) Pflug" <fgp(at)phlo(dot)org> |
Cc: | August Zajonc <augustz(at)augustz(dot)com>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, Postgresql-Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCH] Lazy xid assingment V2 |
Date: | 2007-09-01 21:45:30 |
Message-ID: | 5837.1188683130@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
"Florian G. Pflug" <fgp(at)phlo(dot)org> writes:
> It might be even worse - I'm not sure that a rename is an atomic operation
> on most filesystems.
rename(2) is specified to be atomic by POSIX, but relinking a file into
a different directory can hardly be --- it's not even provided as a
single kernel call, is it?
And there's still the problem that changing the filename on-the-fly is
going to break tons of low-level stuff, most of which is not supposed to
know about transactions at all, notably bgwriter.
What I was thinking about was a "flag file" separate from the data file
itself, a bit like what we use for archiver signaling. If nnnn is the
new data file, then "touch nnnn.new" to mark the file as needing to be
deleted on restart. Remove these files just *before* commit. This
leaves you with a narrow window between removing the flag file and
actually committing, but there's no risk of having to PANIC --- if the
remove fails, you just abort the transaction.
However, this has nonzero overhead compared to the current behavior.
I'm still dubious that we have a problem that needs solving ...
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | August Zajonc | 2007-09-01 22:17:50 | Re: [PATCH] Lazy xid assingment V2 |
Previous Message | Florian G. Pflug | 2007-09-01 21:13:08 | Re: [PATCH] Lazy xid assingment V2 |