From: Tom Lane Date: Sat, 17 May 2008 17:24:57 +0000 (+0000) Subject: Fix a subtle bug exposed by recent wal_sync_method rearrangements. X-Git-Tag: recoveryinfrav9~1018 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=fa8692fc1b0bd41c32c38e936cb0cf7a48c8be0f;p=users%2Fsimon%2Fpostgres.git Fix a subtle bug exposed by recent wal_sync_method rearrangements. Formerly, the default value of wal_sync_method was determined inside xlog.c, but now it is determined inside guc.c. guc.c was reading xlogdefs.h without having read , leading to wrong determination of DEFAULT_SYNC_METHOD. Obviously xlogdefs.h needs to include for itself to ensure stable results. --- diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 910e0d4ab0..c25cdc90a9 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -15,7 +15,6 @@ #include "postgres.h" #include -#include #include #include #include @@ -31,7 +30,6 @@ #include "access/twophase.h" #include "access/xact.h" #include "access/xlog_internal.h" -#include "access/xlogdefs.h" #include "access/xlogutils.h" #include "catalog/catversion.h" #include "catalog/pg_control.h" diff --git a/src/include/access/xlogdefs.h b/src/include/access/xlogdefs.h index 5e03eb5e88..57b215801a 100644 --- a/src/include/access/xlogdefs.h +++ b/src/include/access/xlogdefs.h @@ -12,6 +12,8 @@ #ifndef XLOG_DEFS_H #define XLOG_DEFS_H +#include /* need open() flags */ + /* * Pointer to a location in the XLOG. These pointers are 64 bits wide, * because we don't want them ever to overflow.