Magnus Hagander wrote:
> Seems it's dead on the buildfarm box as well:
> http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=snake&dt=2005-07-30%20
> 01:00:01
>
> >From what I can tell, the recent patch for O_DIRECT broke it.
OK, fix attached, and some macro cleanup too.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.213
diff -c -c -r1.213 xlog.c
*** src/backend/access/transam/xlog.c 29 Jul 2005 19:29:59 -0000 1.213
--- src/backend/access/transam/xlog.c 30 Jul 2005 14:14:43 -0000
***************
*** 69,85 ****
* default method. We assume that fsync() is always available, and that
* configure determined whether fdatasync() is.
*/
! #if defined(O_SYNC)
#define CMP_OPEN_SYNC_FLAG O_SYNC
! #else
! #if defined(O_FSYNC)
#define CMP_OPEN_SYNC_FLAG O_FSYNC
#endif
! #endif
#define OPEN_SYNC_FLAG (CMP_OPEN_SYNC_FLAG | PG_O_DIRECT)
! #if defined(O_DSYNC)
! #if defined(OPEN_SYNC_FLAG)
#if O_DSYNC != CMP_OPEN_SYNC_FLAG
#define OPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
#endif
--- 69,86 ----
* default method. We assume that fsync() is always available, and that
* configure determined whether fdatasync() is.
*/
! #ifdef O_SYNC
#define CMP_OPEN_SYNC_FLAG O_SYNC
! #elif defined(O_FSYNC)
#define CMP_OPEN_SYNC_FLAG O_FSYNC
#endif
! #ifdef CMP_OPEN_SYNC_FLAG
#define OPEN_SYNC_FLAG (CMP_OPEN_SYNC_FLAG | PG_O_DIRECT)
+ #endif
! #ifdef O_DSYNC
! #ifdef OPEN_SYNC_FLAG
! /* O_DSYNC is distinct? */
#if O_DSYNC != CMP_OPEN_SYNC_FLAG
#define OPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
#endif
***************
*** 114,120 ****
#define XLOG_BUFFER_POINTERALIGN(PTR) \
POINTERALIGN((ALIGNOF_XLOG_BUFFER), (PTR))
! #if defined(OPEN_DATASYNC_FLAG)
#define DEFAULT_SYNC_METHOD_STR "open_datasync"
#define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN
#define DEFAULT_SYNC_FLAGBIT OPEN_DATASYNC_FLAG
--- 115,121 ----
#define XLOG_BUFFER_POINTERALIGN(PTR) \
POINTERALIGN((ALIGNOF_XLOG_BUFFER), (PTR))
! #ifdef OPEN_DATASYNC_FLAG
#define DEFAULT_SYNC_METHOD_STR "open_datasync"
#define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN
#define DEFAULT_SYNC_FLAGBIT OPEN_DATASYNC_FLAG