Skip to content

Commit 272b6ef

Browse files
committed
Prevent BLCKSZ < 1024, and have initdb test shared buffers based on the
BLCKSZ value.
1 parent 4816b0f commit 272b6ef

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/bin/initdb/initdb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.133 2007/02/16 02:10:07 alvherre Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.134 2007/02/20 23:49:38 momjian Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -1208,7 +1208,8 @@ test_config_settings(void)
12081208

12091209
for (i = 0; i < bufslen; i++)
12101210
{
1211-
test_buffs = trial_bufs[i];
1211+
/* Use same amount of memory, independent of BLCKSZ */
1212+
test_buffs = (trial_bufs[i] * 8192) / BLCKSZ;
12121213
if (test_buffs <= ok_buffers)
12131214
{
12141215
test_buffs = ok_buffers;

src/include/pg_config_manual.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* for developers. If you edit any of these, be sure to do a *full*
77
* rebuild (and an initdb if noted).
88
*
9-
* $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.24 2007/02/06 09:16:08 petere Exp $
9+
* $PostgreSQL: pgsql/src/include/pg_config_manual.h,v 1.25 2007/02/20 23:49:38 momjian Exp $
1010
*------------------------------------------------------------------------
1111
*/
1212

@@ -25,6 +25,10 @@
2525
*/
2626
#define BLCKSZ 8192
2727

28+
#if BLCKSZ < 1024
29+
#error BLCKSZ must be >= 1024
30+
#endif
31+
2832
/*
2933
* RELSEG_SIZE is the maximum number of blocks allowed in one disk
3034
* file. Thus, the maximum size of a single file is RELSEG_SIZE *

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