summaryrefslogtreecommitdiff
path: root/src/backend/storage
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-06-26 06:40:58 -0400
committerRobert Haas <rhaas@postgresql.org>2012-06-26 06:40:58 -0400
commit73a3b1d4589eaf3dc7f0a573727a2a6ac5279e6a (patch)
tree03f273694c48aa73844ae5f7c573c1527ef10546 /src/backend/storage
parentd8bd584bf4cc6c74178a73ae8924b86ab2bebb44 (diff)
Backport fsync queue compaction logic to all supported branches.
This backports commit 7f242d880b5b5d9642675517466d31373961cf98, except for the counter in pg_stat_bgwriter. The underlying problem (namely, that a full fsync request queue causes terrible checkpoint behavior) continues to be reported in the wild, and this code seems to be safe and robust enough to risk back-porting the fix.
Diffstat (limited to 'src/backend/storage')
-rw-r--r--src/backend/storage/smgr/md.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index 5458cbdda42..c0e41c7053b 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -33,7 +33,13 @@
/* interval for calling AbsorbFsyncRequests in mdsync */
#define FSYNCS_PER_ABSORB 10
-/* special values for the segno arg to RememberFsyncRequest */
+/*
+ * Special values for the segno arg to RememberFsyncRequest.
+ *
+ * Note that CompactBgwriterRequestQueue assumes that it's OK to remove an
+ * fsync request from the queue if an identical, subsequent request is found.
+ * See comments there before making changes here.
+ */
#define FORGET_RELATION_FSYNC (InvalidBlockNumber)
#define FORGET_DATABASE_FSYNC (InvalidBlockNumber-1)
#define UNLINK_RELATION_REQUEST (InvalidBlockNumber-2)