Re: Fairly serious bug induced by latest guc enum changes - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Fairly serious bug induced by latest guc enum changes
Date
Msg-id 486A812A.4050405@hagander.net
Whole thread Raw
In response to Re: Fairly serious bug induced by latest guc enum changes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Fairly serious bug induced by latest guc enum changes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> Or are you talking about changing the variable "fsync"? If so, doesn't
>> "fsync=off" also change the behavior of other parts of the code, so it's
>> not just WAL, which means it'd be pretty unsafe *anyway* unless you
>> actually "sync" the disks, and not just fsync?
> 
> No, because the other uses of it are controlling whether to issue
> fsync() calls dynamically.  The use in get_sync_bit is the only one
> that sets persistent state.  In fact md.c goes out of its way to ensure
> that changing fsync on the fly behaves as expected.

Not having looked at md.c (I confess...) but don't we have a problem in
case we have closed the file without fsyncing it, and then change the
fsync parameter?

Either way, I see your point, but I doubt it's worth getting upset over.
Funning with fsync=off in the first place is bad, and if it takes you
one WAL segment to "recover", I think that's acceptable...

//Magnus



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fairly serious bug induced by latest guc enum changes
Next
From: Tom Lane
Date:
Subject: Re: Location for pgstat.stat