Thread: SET FSYNC command?
In 7.0 release note, we have: Add SET FSYNC and SHOW PG_OPTIONS commands(Massimo) I'm confused by this since we don't seem to have SET FSYNC command. test=# set fsync to on; NOTICE: Unrecognized variable fsync SET VARIABLE Am I missing something? Also if we have that command, I wonder it would be safe to issue on the fly. Comments? -- Tatsuo Ishii
> In 7.0 release note, we have: > > Add SET FSYNC and SHOW PG_OPTIONS commands(Massimo) > > I'm confused by this since we don't seem to have SET FSYNC command. > > test=# set fsync to on; > NOTICE: Unrecognized variable fsync > SET VARIABLE > > Am I missing something? > > Also if we have that command, I wonder it would be safe to issue on > the fly. Gee, I think we removed it because we thought it would be unsafe, but then Tom Lane made it safe, forgot to re-enable it. -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
Tatsuo Ishii wrote: > In 7.0 release note, we have: > > Add SET FSYNC and SHOW PG_OPTIONS commands(Massimo) > > I'm confused by this since we don't seem to have SET FSYNC command. If SHOW PG_OPTIONS; is executed, one of the lines iso NOTICE: nofsync=0 now, SET PG_OPTIONS TO 'nofsync=1'; SHOW PG_OPTIONS;o NOTICE: nofsync=1 Does this actually work? Regards Grant -- > Poorly planned software requires a genius to write it > and a hero to use it. Grant Finnemore BSc(Eng) (mailto:gaf@ucs.co.za) Software Engineer Universal Computer Services Tel (+27)(11)712-1366 PO Box 31266 Braamfontein 2017, South Africa Cell (+27)(82)604-5536 20th Floor, 209 Smit St., Braamfontein Fax (+27)(11)339-3421 Johannesburg, South Africa
Grant Finnemore <gaf@ucs.co.za> writes: >> Add SET FSYNC and SHOW PG_OPTIONS commands(Massimo) >> >> I'm confused by this since we don't seem to have SET FSYNC command. > If SHOW PG_OPTIONS; is executed, one of the lines is > o NOTICE: nofsync=0 > now, SET PG_OPTIONS TO 'nofsync=1'; > SHOW PG_OPTIONS; > o NOTICE: nofsync=1 > Does this actually work? It does. The syntax is unnecessarily obscure and arse-backwards :-(. The only defense I can offer is that we had every intention of ripping the variable out completely, until a nearly-last-minute revision of the buffer manager (to fix a different bug report) that had as a side-effect making it safe and reasonable to run different backends with different fsync settings. So the variable got left in as it stood. Once the WAL revisions are done the whole issue will go away anyway, so it's probably not worth spending any time fixing the bizarre user interface for this preference setting... regards, tom lane
Tatsuo Ishii <t-ishii@sra.co.jp> writes: > Also if we have that command, I wonder it would be safe to issue on > the fly. I believe it is safe now, following the changes I made last month to the buffer-sync algorithm. It surely was not safe before to run with different fsync settings in different backends. regards, tom lane
On Wed, 31 May 2000, Tom Lane wrote: > > If SHOW PG_OPTIONS; is executed, one of the lines is > > o NOTICE: nofsync=0 > > now, SET PG_OPTIONS TO 'nofsync=1'; > > SHOW PG_OPTIONS; > > o NOTICE: nofsync=1 > The syntax is unnecessarily obscure and arse-backwards :-(. No kidding. Actually, since yesterday you can disable fsync in a multitude of ways: postmaster -F postmaster -o '-F' postmaster --enable-fsync=off SET ENABLE_FSYNC TO OFF; but feel free to not care because after all ... > Once the WAL revisions are done the whole issue will go away anyway, -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden
> > The syntax is unnecessarily obscure and arse-backwards :-(. > SET ENABLE_FSYNC TO OFF; Hi Peter. I was noticing that several of the SET keywords have redundant elements. In this case, istm that SET FSYNC=ON; would be adequate and preferred; the "ENABLE" is implied by the "ON" in the last example. I realize that you are using a keyword style already present, but perhaps for 7.1 we can shorten all of those keywords having "ENABLE_"? Comments? - Thomas
Thomas Lockhart writes: > In this case, istm that > > SET FSYNC=ON; > > would be adequate and preferred; the "ENABLE" is implied by the "ON" in Actually I just noticed that it actually is that way for FSYNC, but I agree totally. > the last example. I realize that you are using a keyword style already > present, but perhaps for 7.1 we can shorten all of those keywords having > "ENABLE_"? You know me, I would change everything if you guys wouldn't hold me back. :) I could certainly agree to this. -- Peter Eisentraut Sernanders väg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden