From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> |
Cc: | tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] TODO item |
Date: | 2000-02-09 16:17:09 |
Message-ID: | 200002091617.LAA22751@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> Thinking about a little bit more, I have come across yet another
> possible solution. It is actually *very* simple. Details as follows.
>
> In xact.c:RecordTransactionCommit() there are two FlushBufferPool
> calls. One is for relation files and the other is for pg_log. I add
> sync() right after these FlushBufferPool. It will force any pending
> kernel buffers physically be written onto disk, thus should guarantee
> the ACID of the transaction (see attached code fragment).
Interesting idea. I had proposed this solution long ago. My idea was
to buffer pg_log writes every 30 seconds. Every 30 seconds, do a sync,
then write/sync pg_log. Seemed like a good solution at the time, but
Vadim didn't like it. I think he prefered to do logging, but honestly,
it was over a year ago, and we could have been benefiting from it all
this time.
Second, I had another idea. What if we fsync()'ed a file descriptor
only when we were writing the _last_ dirty buffer for that file. Seems
in many cases this would be a win. I just don't know how hard that is
to figure out. Seems there is no need to fsync() if we still have dirty
buffers around.
--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2000-02-09 16:19:06 | Re: Small update for WinNT port |
Previous Message | Tom Lane | 2000-02-09 16:05:26 | Re: [HACKERS] minor bug... |