Hi, intentionally breaking the thread here, I want this one point to get a bit wider audience.
The excerpt of the relevant discussion is: On 2017-08-23 12:13:15 +0530, Beena Emerson wrote: > >> + /* set default max_wal_size and min_wal_size */ > >> + snprintf(repltok, sizeof(repltok), "min_wal_size = %s", > >> + pretty_wal_size(DEFAULT_MIN_WAL_SEGS)); > >> + conflines = replace_token(conflines, "#min_wal_size = 80MB", > >> repltok); > >> + > >> + snprintf(repltok, sizeof(repltok), "max_wal_size = %s", > >> + pretty_wal_size(DEFAULT_MAX_WAL_SEGS)); > >> + conflines = replace_token(conflines, "#max_wal_size = 1GB", repltok); > >> + > > > > Hm. So postgresql.conf.sample values are now going to contain misleading > > information for clusters with non-default segment sizes. > > > > Have we discussed instead defaulting min_wal_size/max_wal_size to a > > constant amount of megabytes and rounding up when it doesn't work for > > a particular segment size? > > This was not discussed. > > In the original code, the min_wal_size and max_wal_size are computed > in the guc.c for any wal_segment_size set at configure. > > { > {"min_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS, > gettext_noop("Sets the minimum size to shrink the WAL to."), > NULL, > GUC_UNIT_MB > }, > &min_wal_size_mb, > 5 * (XLOG_SEG_SIZE / (1024 * 1024)), 2, MAX_KILOBYTES, > NULL, NULL, NULL > }, > > { > {"max_wal_size", PGC_SIGHUP, WAL_CHECKPOINTS, > gettext_noop("Sets the WAL size that triggers a checkpoint."), > NULL, > GUC_UNIT_MB > }, > &max_wal_size_mb, > 64 * (XLOG_SEG_SIZE / (1024 * 1024)), 2, MAX_KILOBYTES, > NULL, assign_max_wal_size, NULL > }, > > Hence I have retained the same calculation for min_wal_size and > max_wal_size. If we get consensus for fixing a default and updating > when required, then I will change the code accordingly. So the question is whether we want {max,min}_wal_size be sized in multiples of segment sizes or as a proper byte size. I'm leaning towards the latter. - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers