Skip to content

Commit 63932a6

Browse files
committed
Fix wal_writer_flush_after initializer value.
Commit a73952b (new in 16) required default values in guc_table.c and C variable initializers to match. This one only matched when XLOG_BLCKSZ == 8kB. Fix by using the same expression in both places with a new DEFAULT_XXX macro, as done for other GUCs. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGLNmLV=VrT==5MqnbARgx2ifRSFtdd8ofdfrdSLL3yv5A@mail.gmail.com
1 parent 319bae9 commit 63932a6

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/backend/postmaster/walwriter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
* GUC parameters
6969
*/
7070
int WalWriterDelay = 200;
71-
int WalWriterFlushAfter = 128;
71+
int WalWriterFlushAfter = DEFAULT_WAL_WRITER_FLUSH_AFTER;
7272

7373
/*
7474
* Number of do-nothing loops before lengthening the delay time, and the

src/backend/utils/misc/guc_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ struct config_int ConfigureNamesInt[] =
27802780
GUC_UNIT_XBLOCKS
27812781
},
27822782
&WalWriterFlushAfter,
2783-
(1024 * 1024) / XLOG_BLCKSZ, 0, INT_MAX,
2783+
DEFAULT_WAL_WRITER_FLUSH_AFTER, 0, INT_MAX,
27842784
NULL, NULL, NULL
27852785
},
27862786

src/include/postmaster/walwriter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef _WALWRITER_H
1313
#define _WALWRITER_H
1414

15+
#define DEFAULT_WAL_WRITER_FLUSH_AFTER ((1024 * 1024) / XLOG_BLCKSZ)
16+
1517
/* GUC options */
1618
extern PGDLLIMPORT int WalWriterDelay;
1719
extern PGDLLIMPORT int WalWriterFlushAfter;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy