pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #11882: make HAVE_WORKING_LINK an option
4+ messages / 4 participants
[nested] [flat]

* BUG #11882: make HAVE_WORKING_LINK an option
@ 2014-11-05 14:44  gauchard@laas.fr
  0 siblings, 1 reply; 4+ messages in thread

From: gauchard@laas.fr @ 2014-11-05 14:44 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      11882
Logged by:          david gauchard
Email address:      gauchard@laas.fr
PostgreSQL version: 9.4beta2
Operating system:   linux
Description:        

Hi,

This define "HAVE_WORKING_LINK" should not be always enabled. On systems
that support (and surely use) hard links FS, postgresql might be used on a
subFS not supporting it.
In the sources, the comment is (from git's
src/backend/access/transam/xlog.c):

3373      * Prefer link() to rename() here just to be really sure that we
don't
3374      * overwrite an existing logfile.  However, there shouldn't be one,
so
3375      * rename() is an acceptable substitute except for the truly
paranoid.

My thinking is that you may add a '--paranoid' option to use hardlink
instead of rename, or, at least, an option (--relax ?) to disable this
behaviour and use a regular rename() instead.

Just a thought.

david



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #11882: make HAVE_WORKING_LINK an option
@ 2014-11-05 16:35  Andres Freund <andres@2ndquadrant.com>
  parent: gauchard@laas.fr
  0 siblings, 1 reply; 4+ messages in thread

From: Andres Freund @ 2014-11-05 16:35 UTC (permalink / raw)
  To: gauchard@laas.fr; +Cc: pgsql-bugs

Hi,

On 2014-11-05 14:44:48 +0000, gauchard@laas.fr wrote:
> This define "HAVE_WORKING_LINK" should not be always enabled. On systems
> that support (and surely use) hard links FS, postgresql might be used on a
> subFS not supporting it.
> In the sources, the comment is (from git's
> src/backend/access/transam/xlog.c):

Those FS's really shouldn't be used for a database though. Are you
thinking of something concrete?

> 3373      * Prefer link() to rename() here just to be really sure that we
> don't
> 3374      * overwrite an existing logfile.  However, there shouldn't be one,
> so
> 3375      * rename() is an acceptable substitute except for the truly
> paranoid.

> My thinking is that you may add a '--paranoid' option to use hardlink
> instead of rename, or, at least, an option (--relax ?) to disable this
> behaviour and use a regular rename() instead.

I don't think this is really warranted by anything.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #11882: make HAVE_WORKING_LINK an option
@ 2014-11-05 16:52  David Gauchard <gauchard@laas.fr>
  parent: Andres Freund <andres@2ndquadrant.com>
  0 siblings, 1 reply; 4+ messages in thread

From: David Gauchard @ 2014-11-05 16:52 UTC (permalink / raw)
  To: Andres Freund <andres@2ndquadrant.com>; +Cc: pgsql-bugs

On mer., nov. 05, 2014 at 05:35:14 +0100, Andres Freund wrote:
> Hi,
> 
> On 2014-11-05 14:44:48 +0000, gauchard@laas.fr wrote:
> > This define "HAVE_WORKING_LINK" should not be always enabled. On systems
> > that support (and surely use) hard links FS, postgresql might be used on a
> > subFS not supporting it.
> > In the sources, the comment is (from git's
> > src/backend/access/transam/xlog.c):
> 
> Those FS's really shouldn't be used for a database though. Are you
> thinking of something concrete?

Something surely not serious enough for you:
I was working on a fuse filesystem which I test using the
phoronix test suite, which uses postgresql for benchmarking, when
I ran into this bug (hard link is not always implementable).

I understand that this is not consistent enough for making a patch.

However at least a ./configure option (not in the manual config
file) would be welcome for automating processes.  This would
not harm regular postgresql performances (because of no runtime
check for an option) and would be explicit.

> 
> > 3373      * Prefer link() to rename() here just to be really sure that we
> > don't
> > 3374      * overwrite an existing logfile.  However, there shouldn't be one,
> > so
> > 3375      * rename() is an acceptable substitute except for the truly
> > paranoid.
> 
> > My thinking is that you may add a '--paranoid' option to use hardlink
> > instead of rename, or, at least, an option (--relax ?) to disable this
> > behaviour and use a regular rename() instead.
> 
> I don't think this is really warranted by anything.

I agree.
Is a ./configure option acceptable ?
I can provide a patch for that if it be welcome.

Otherwise you tell me and I stay around my playground :)

david


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #11882: make HAVE_WORKING_LINK an option
@ 2014-11-07 00:31  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David Gauchard <gauchard@laas.fr>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2014-11-07 00:31 UTC (permalink / raw)
  To: David Gauchard <gauchard@laas.fr>; +Cc: Andres Freund <andres@2ndquadrant.com>; pgsql-bugs

David Gauchard <gauchard@laas.fr> writes:
> On mer., nov. 05, 2014 at 05:35:14 +0100, Andres Freund wrote:
>> On 2014-11-05 14:44:48 +0000, gauchard@laas.fr wrote:
>>> This define "HAVE_WORKING_LINK" should not be always enabled. On systems
>>> that support (and surely use) hard links FS, postgresql might be used on a
>>> subFS not supporting it.

>> Those FS's really shouldn't be used for a database though. Are you
>> thinking of something concrete?

> I was working on a fuse filesystem which I test using the
> phoronix test suite, which uses postgresql for benchmarking, when
> I ran into this bug (hard link is not always implementable).

Meh.  There's a reason HAVE_WORKING_LINK is defined in pg_config_manual.h:
if you want to adjust it, you're supposed to do so manually.

I don't really want to carry a configure option to support
non-production-quality filesystems.  Even just documenting it
would be painful (are we really going to have an option that
we'd tell people not to use?)

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2014-11-07 00:31 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-11-05 14:44 BUG #11882: make HAVE_WORKING_LINK an option gauchard@laas.fr
2014-11-05 16:35 ` Andres Freund <andres@2ndquadrant.com>
2014-11-05 16:52   ` David Gauchard <gauchard@laas.fr>
2014-11-07 00:31     ` Tom Lane <tgl@sss.pgh.pa.us>

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