Tatsuo Ishii wrote: > I noticed sync() is used in PostgreSQL. > > CHECKPOINT -> FlushBufferPool() -> smgrsync() -> mdsync() -> sync() > > Can someone tell me why we need sync() here?
As part of checkpoint, we discard some WAL files. To do that, we must first be sure that all the dirty buffers we have written to the kernel are actually on the disk. That is why the sync() is required. -- Bruce Momjian | http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html