Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2001-01-22 Thread Bruce Momjian
Added to TODO: * Delay fsync() when other backends are about to commit too [ Charset ISO-8859-1 unsupported, converting... ] > > > BUT, do we know for sure that sleep(0) is not optimized in > > > the library to just return? > > > > We can only do our best here. I think guessing wheth

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-19 Thread Don Baccus
At 07:05 PM 11/19/00 +0100, [EMAIL PROTECTED] wrote: >Cam I ask what BAR is ? Backup and recovery, presumably... - Don Baccus, Portland OR <[EMAIL PROTECTED]> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert Service and other goodies at http://donb.photo.net.

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-19 Thread Vadim Mikheev
> > > Ok, so with CHECKPOINTS, we could move the offline log files to > > > somewhere else so that we could archive them, in my > > > undertstanding. Now question is, how we could recover from disaster > > > like losing every table files except log files. Can we do this with > > > WAL? If so, how

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-19 Thread devik
"Mikheev, Vadim" wrote: > > > > > > No. Checkpoints are to speedup after crash recovery and > > > > > to remove/archive log files. With WAL server doesn't write > > > > > any datafiles on commit, only commit record goes to log > > > > > (and log fsync-ed). Dirty buffers remains in memory long > >

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-17 Thread Larry Rosenman
* Bruce Momjian <[EMAIL PROTECTED]> [001117 11:39]: > > * Bruce Momjian <[EMAIL PROTECTED]> [001117 11:23]: > > > > > sleep(3) should conform to POSIX specification, if anyone has the > > > > > reference they can check it to see what the effect of sleep(0) > > > > > should be. > > > > > > > > Y

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-17 Thread Larry Rosenman
* Bruce Momjian <[EMAIL PROTECTED]> [001117 11:23]: > > > sleep(3) should conform to POSIX specification, if anyone has the > > > reference they can check it to see what the effect of sleep(0) > > > should be. > > > > Yes, but Posix also specifies sched_yield() which rather explicitly > > allow

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Tom Samplonius
On Thu, 16 Nov 2000, Alfred Perlstein wrote: > * Larry Rosenman <[EMAIL PROTECTED]> [001116 12:09] wrote: > > * Bruce Momjian <[EMAIL PROTECTED]> [001116 14:02]: > > > > > This sounds like an interesting approach, yes. > > > > Question: Is sleep(0) guaranteed to at least give up control? > > >

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Tom Lane
"Mikheev, Vadim" <[EMAIL PROTECTED]> writes: > A long ago you, Bruce, made me gift - book about transaction processing > (thanks again -:)). This sleeping before fsync in commit is described > there as standard technique. And the reason is cleanest. > Men, cost of fsync is very high! { write (64 b

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Tom Lane
Alfred Perlstein <[EMAIL PROTECTED]> writes: >> That's the hard way to do it. We just need to keep track of the >> endpoint of the log as of the last fsync. > Well that breaks when you move to a overwriting storage manager, No, because the log is just a series of records written sequentially --

RE: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Mikheev, Vadim
> > > > No. Checkpoints are to speedup after crash recovery and > > > > to remove/archive log files. With WAL server doesn't write > > > > any datafiles on commit, only commit record goes to log > > > > (and log fsync-ed). Dirty buffers remains in memory long > > Ok, so with CHECKPOINTS, we could

RE: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Mikheev, Vadim
> > You are going to kernel call/yield anyway to fsync, so why > > not try and if someone does the fsync, we don't need to do it. > > I am suggesting re-checking the need for fsync after the return > > from sleep(0). > > It might make more sense to keep a private copy of the last time > the file

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Alfred Perlstein
* Bruce Momjian <[EMAIL PROTECTED]> [001116 12:31] wrote: > > > In OS kernel design, you try to avoid process herding bottlenecks. > > > Here, we want them herded, and giving up the CPU may be the best way to > > > do it. > > > > Yes, but if everyone yeilds you're back where you started, and wit

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Alfred Perlstein
* Tom Lane <[EMAIL PROTECTED]> [001116 13:31] wrote: > Alfred Perlstein <[EMAIL PROTECTED]> writes: > > It might make more sense to keep a private copy of the last time > > the file was modified per-backend by that particular backend and > > a timestamp of the last fsync shared globally so one can

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Tom Lane
Alfred Perlstein <[EMAIL PROTECTED]> writes: > It might make more sense to keep a private copy of the last time > the file was modified per-backend by that particular backend and > a timestamp of the last fsync shared globally so one can forgo the > fsync if "it hasn't been dirtied by me since the

RE: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Mikheev, Vadim
> > BUT, do we know for sure that sleep(0) is not optimized in > > the library to just return? > > We can only do our best here. I think guessing whether other backends > are _about_ to commit is pretty shaky, and sleeping every time is a > waste. This seems the cleanest. A long ago you, Bruc

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Peter Eisentraut
Bruce Momjian writes: > > The way I read my UnixWare 7's man page, it might not, since alarm(0) > > just cancels the alarm... > > Well, it certainly is a kernel call, and most OS's re-evaluate on kernel > call return. In glibc, sleep(0) just does "return 0;", so if the compiler has a good day t

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Alfred Perlstein
* Larry Rosenman <[EMAIL PROTECTED]> [001116 12:09] wrote: > * Bruce Momjian <[EMAIL PROTECTED]> [001116 14:02]: > > > > This sounds like an interesting approach, yes. > > > Question: Is sleep(0) guaranteed to at least give up control? > > > > > > The way I read my UnixWare 7's man page, it migh

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-16 Thread Bruce Momjian
> > In OS kernel design, you try to avoid process herding bottlenecks. > > Here, we want them herded, and giving up the CPU may be the best way to > > do it. > > Yes, but if everyone yeilds you're back where you started, and with > 128 or more backends do you really want to cause possibly that m

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Alfred Perlstein
* Bruce Momjian <[EMAIL PROTECTED]> [001116 11:59] wrote: > > At 02:13 PM 11/16/00 -0500, Bruce Momjian wrote: > > > > >> I think the default should probably be no delay, and the documentation > > >> on enabling this needs to be clear and obvious (i.e. hard to miss). > > > > > >I just talked to T

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Larry Rosenman
* Bruce Momjian <[EMAIL PROTECTED]> [001116 14:02]: > > > This sounds like an interesting approach, yes. > > Question: Is sleep(0) guaranteed to at least give up control? > > > > The way I read my UnixWare 7's man page, it might not, since alarm(0) > > just cancels the alarm... > > Well, it cer

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Bruce Momjian
> At 02:13 PM 11/16/00 -0500, Bruce Momjian wrote: > > >> I think the default should probably be no delay, and the documentation > >> on enabling this needs to be clear and obvious (i.e. hard to miss). > > > >I just talked to Tom Lane about this. I think a sleep(0) just before > >the flush would

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Larry Rosenman
* Don Baccus <[EMAIL PROTECTED]> [001116 13:46]: > At 02:13 PM 11/16/00 -0500, Bruce Momjian wrote: > > >> I think the default should probably be no delay, and the documentation > >> on enabling this needs to be clear and obvious (i.e. hard to miss). > > > >I just talked to Tom Lane about this.

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Don Baccus
At 02:13 PM 11/16/00 -0500, Bruce Momjian wrote: >> I think the default should probably be no delay, and the documentation >> on enabling this needs to be clear and obvious (i.e. hard to miss). > >I just talked to Tom Lane about this. I think a sleep(0) just before >the flush would be the best.

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Bruce Momjian
> At 09:32 AM 11/16/00 -0800, Alfred Perlstein wrote: > >* Bruce Momjian <[EMAIL PROTECTED]> [001116 08:59] wrote: > > >> Ewe, so we have this 1/200 second delay for every transaction. Seems > >> bad to me. > > > >I think as long as it becomes a tunable this isn't a bad idea at > >all. Fixing i

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Don Baccus
At 09:32 AM 11/16/00 -0800, Alfred Perlstein wrote: >* Bruce Momjian <[EMAIL PROTECTED]> [001116 08:59] wrote: >> Ewe, so we have this 1/200 second delay for every transaction. Seems >> bad to me. > >I think as long as it becomes a tunable this isn't a bad idea at >all. Fixing it at 1/200 isn't

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-16 Thread Alfred Perlstein
* Bruce Momjian <[EMAIL PROTECTED]> [001116 08:59] wrote: > [ Charset ISO-8859-1 unsupported, converting... ] > > > > > Earlier, Vadim was talking about arranging to share fsyncs of the WAL > > > > > log file across transactions (after writing your commit record to the > > > > > log, sleep a few m

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-15 Thread Vadim Mikheev
> > > Earlier, Vadim was talking about arranging to share fsyncs of the WAL > > > log file across transactions (after writing your commit record to the > > > log, sleep a few milliseconds to see if anyone else fsyncs before you > > > do; if not, issue the fsync yourself). That would offer less-th

RE: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-15 Thread Mikheev, Vadim
> > I am just suggesting that instead of flushing the log on every > > transaction end, just do it every X seconds. > > Or maybe more practical is, when the log buffer fills. > And of course during checkpoints. Also before backend's going to write dirty buffer from pool to system cache - change

RE: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-15 Thread Mikheev, Vadim
> Earlier, Vadim was talking about arranging to share fsyncs of the WAL > log file across transactions (after writing your commit record to the > log, sleep a few milliseconds to see if anyone else fsyncs before you > do; if not, issue the fsync yourself). That would offer less-than- > one-fsync-

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-11 Thread Alfred Perlstein
* Tom Lane <[EMAIL PROTECTED]> [00 12:06] wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > >> I have to agree with Alfred here: this does not sound like a feature, > >> it sounds like a horrid hack. You're giving up *all* consistency > >> guarantees for a performance gain that is really g

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-11 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: >> I have to agree with Alfred here: this does not sound like a feature, >> it sounds like a horrid hack. You're giving up *all* consistency >> guarantees for a performance gain that is really going to be pretty >> minimal in the WAL context. > It does n

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-11 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: >> Not really, I thought an ack on a commit would mean that the data >> is actually in stable storage, breaking that would be pretty bad >> no? > The default is to sync on commit, but we need to give people options of > several seconds delay for performan

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-11 Thread Alfred Perlstein
* Bruce Momjian <[EMAIL PROTECTED]> [00 00:16] wrote: > > * Tatsuo Ishii <[EMAIL PROTECTED]> [001110 18:42] wrote: > > > > > > > > Yes, though we can change this. We also can implement now > > > > feature that Bruce wanted so long and so much -:) - > > > > fsync log not on each commit but eac

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-11 Thread Tatsuo Ishii
> * Tatsuo Ishii <[EMAIL PROTECTED]> [001110 18:42] wrote: > > > > > > Yes, though we can change this. We also can implement now > > > feature that Bruce wanted so long and so much -:) - > > > fsync log not on each commit but each ~ 5sec, if > > > losing some recent commits is acceptable. > > >

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)

2000-11-10 Thread Alfred Perlstein
* Tatsuo Ishii <[EMAIL PROTECTED]> [001110 18:42] wrote: > > > > Yes, though we can change this. We also can implement now > > feature that Bruce wanted so long and so much -:) - > > fsync log not on each commit but each ~ 5sec, if > > losing some recent commits is acceptable. > > Sounds great.

RE: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-10 Thread Tatsuo Ishii
> > Can you tell me how to use CHECKPOINT please? > > You shouldn't normally use it - postmaster will start backend > each 3-5 minutes to do this automatically. Oh, I see. > > > > Is this the same as a SAVEPOINT? > > > > > > No. Checkpoints are to speedup after crash recovery and > > > to remo

RE: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam (xact.c xlog.c)

2000-11-08 Thread Mikheev, Vadim
> > > > New CHECKPOINT command. > > > > Auto removing of offline log files and creating new file > > > > at checkpoint time. > > Can you tell me how to use CHECKPOINT please? You shouldn't normally use it - postmaster will start backend each 3-5 minutes to do this automatically. > > > Is this t

Re: [HACKERS] RE: [COMMITTERS] pgsql/src/backend/access/transam(xact.c xlog.c)

2000-11-06 Thread Tatsuo Ishii
> > > New CHECKPOINT command. > > > Auto removing of offline log files and creating new file > > > at checkpoint time. Can you tell me how to use CHECKPOINT please? > > Is this the same as a SAVEPOINT? > > No. Checkpoints are to speedup after crash recovery and > to remove/archive log files. Wi