Re: increasing the default WAL segment size

Prabhat Sahu <prabhat.sahu@enterprisedb.com>

From: Prabhat Sahu <prabhat.sahu@enterprisedb.com>
To: Beena Emerson <memissemerson@gmail.com>
Cc: tushar <tushar.ahuja@enterprisedb.com>, Ashutosh Sharma <ashu.coek88@gmail.com>, Jim Nasby <Jim.Nasby@bluetreble.com>, Kuntal Ghosh <kuntalghosh.2007@gmail.com>, Andres Freund <andres@anarazel.de>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-03-13T08:19:18Z
Lists: pgsql-hackers
Hi,

2)Getting "Aborted (core dumped)"  error at the time of running
pg_basebackup  , *(this issue is only coming on Linux32 ,not on Linux64)*
 we have  double check to confirm it .

Steps to reproduce on Linux32

> ===================
>> fetch the sources
>> apply both the patches
>>  ./configure --with-zlib   --enable-debug  --enable-cassert
>> --enable-depend --prefix=$PWD/edbpsql --with-openssl CFLAGS="-g -O0"; make
>> all install
>> Performed initdb with switch "--wal-segsize 4"
>>
>
> Does the crash occur with only size 4?
>


Crash occurs for the value of *"--wal-segsize " 1, 2, 4, 8*  with stack
details as below :

[bin]$ ./pg_basebackup -v -D /tmp/slave8
*** glibc detected *** ./pg_basebackup: free(): invalid pointer: 0x09fe9f00
***
======= Backtrace: =========
/lib/libc.so.6[0xbafb81]
/home/edb/PGsrc13march/postgresql/edbpsql/lib/libpq.so.5(PQclear+0x16d)[0x5696f5]
./pg_basebackup[0x8051441]
./pg_basebackup[0x804e7b5]
/lib/libc.so.6(__libc_start_main+0xe6)[0xb55d36]
./pg_basebackup[0x804a231]
======= Memory map: ========
00165000-001c7000 r-xp 00000000 08:03 1333807    /usr/lib/libssl.so.1.0.1e
001c7000-001ca000 r--p 00061000 08:03 1333807    /usr/lib/libssl.so.1.0.1e
001ca000-001ce000 rw-p 00064000 08:03 1333807    /usr/lib/libssl.so.1.0.1e
001ce000-0020c000 r-xp 00000000 08:03 1717206    /lib/libgssapi_krb5.so.2.2
0020c000-0020d000 r--p 0003e000 08:03 1717206    /lib/libgssapi_krb5.so.2.2
0020d000-0020e000 rw-p 0003f000 08:03 1717206    /lib/libgssapi_krb5.so.2.2
0020e000-002e5000 r-xp 00000000 08:03 1717208    /lib/libkrb5.so.3.3
002e5000-002eb000 r--p 000d6000 08:03 1717208    /lib/libkrb5.so.3.3
002eb000-002ec000 rw-p 000dc000 08:03 1717208    /lib/libkrb5.so.3.3
002ec000-00309000 r-xp 00000000 08:03 1706348
/lib/libgcc_s-4.4.7-20120601.so.1
00309000-0030a000 rw-p 0001d000 08:03 1706348
/lib/libgcc_s-4.4.7-20120601.so.1
00362000-00510000 r-xp 00000000 08:03 1333806
/usr/lib/libcrypto.so.1.0.1e
00510000-00520000 r--p 001ae000 08:03 1333806
/usr/lib/libcrypto.so.1.0.1e
00520000-00527000 rw-p 001be000 08:03 1333806
/usr/lib/libcrypto.so.1.0.1e
00527000-0052a000 rw-p 00000000 00:00 0
0055a000-00585000 r-xp 00000000 08:03 419296
/home/edb/PGsrc13march/postgresql/edbpsql/lib/libpq.so.5.10
00585000-00587000 rw-p 0002a000 08:03 419296
/home/edb/PGsrc13march/postgresql/edbpsql/lib/libpq.so.5.10
0086b000-0086e000 r-xp 00000000 08:03 1717205    /lib/libcom_err.so.2.1
0086e000-0086f000 r--p 00002000 08:03 1717205    /lib/libcom_err.so.2.1
0086f000-00870000 rw-p 00003000 08:03 1717205    /lib/libcom_err.so.2.1
008e3000-00900000 r-xp 00000000 08:03 1725674    /lib/libselinux.so.1
00900000-00901000 r--p 0001d000 08:03 1725674    /lib/libselinux.so.1
00901000-00902000 rw-p 0001e000 08:03 1725674    /lib/libselinux.so.1
00a10000-00a11000 r-xp 00000000 00:00 0          [vdso]
00af9000-00b03000 r-xp 00000000 08:03 1717209    /lib/libkrb5support.so.0.1
00b03000-00b04000 r--p 00009000 08:03 1717209    /lib/libkrb5support.so.0.1
00b04000-00b05000 rw-p 0000a000 08:03 1717209    /lib/libkrb5support.so.0.1
00b19000-00b37000 r-xp 00000000 08:03 1704925    /lib/ld-2.12.so
00b37000-00b38000 r--p 0001d000 08:03 1704925    /lib/ld-2.12.so
00b38000-00b39000 rw-p 0001e000 08:03 1704925    /lib/ld-2.12.so
00b3f000-00ccf000 r-xp 00000000 08:03 1704931    /lib/libc-2.12.so
00ccf000-00cd0000 ---p 00190000 08:03 1704931    /lib/libc-2.12.so
00cd0000-00cd2000 r--p 00190000 08:03 1704931    /lib/libc-2.12.so
00cd2000-00cd3000 rw-p 00192000 08:03 1704931    /lib/libc-2.12.so
00cd3000-00cd6000 rw-p 00000000 00:00 0
00cd8000-00cef000 r-xp 00000000 08:03 1704933    /lib/libpthread-2.12.so
00cef000-00cf0000 r--p 00016000 08:03 1704933    /lib/libpthread-2.12.so
00cf0000-00cf1000 rw-p 00017000 08:03 1704933    /lib/libpthread-2.12.so
00cf1000-00cf3000 rw-p 00000000 00:00 0
00cf5000-00cf8000 r-xp 00000000 08:03 1704977    /lib/libdl-2.12.so
00cf8000-00cf9000 r--p 00002000 08:03 1704977    /lib/libdl-2.12.so
00cf9000-00cfa000 rw-p 00003000 08:03 1704977    /lib/libdl-2.12.so
00d33000-00d45000 r-xp 00000000 08:03 1704980    /lib/libz.so.1.2.3
00d45000-00d46000 r--p 00011000 08:03 1704980    /lib/libz.so.1.2.3
00d46000-00d47000 rw-p 00012000 08:03 1704980    /lib/libz.so.1.2.3
00de4000-00e0c000 r-xp 00000000 08:03 1710117    /lib/libk5crypto.so.3.1
00e0c000-00e0d000 r--p 00028000 08:03 1710117    /lib/libk5crypto.so.3.1
00e0d000-00e0e000 rw-p 00029000 08:03 1710117    /lib/libk5crypto.so.3.1
00e0e000-00e0f000 rw-p 00000000 00:00 0
00e18000-00e1a000 r-xp 00000000 08:03 1710112    /lib/libkeyutils.so.1.3
00e1a000-00e1b000 r--p 00001000 08:03 1710112    /lib/libkeyutils.so.1.3
00e1b000-00e1c000 rw-p 00002000 08:03 1710112    /lib/libkeyutils.so.1.3
00f04000-00f10000 r-xp 00000000 08:03 1704932    /lib/libnss_files-2.12.so
00f10000-00f11000 r--p 0000b000 08:03 1704932    /lib/libnss_files-2.12.so
00f11000-00f12000 rw-p 0000c000 08:03 1704932    /lib/libnss_files-2.12.so
07be1000-07bf6000 r-xp 00000000 08:03 1704916    /lib/libresolv-2.12.so
07bf6000-07bf7000 ---p 00015000 08:03 1704916    /lib/libresolv-2.12.so
07bf7000-07bf8000 r--p 00015000 08:03 1704916    /lib/libresolv-2.12.so
07bf8000-07bf9000 rw-p 00016000 08:03 1704916    /lib/libresolv-2.12.so
07bf9000-07bfb000 rw-p 00000000 00:00 0
08048000-0805f000 r-xp 00000000 08:03 539967
/home/edb/PGsrc13march/postgresql/edbpsql/bin/pg_basebackup
0805f000-08060000 rw-p 00016000 08:03 539967
/home/edb/PGsrc13march/postgresql/edbpsql/bin/pg_basebackup
08060000-08062000 rw-p 00000000 00:00 0
09fe1000-0a002000 rw-p 00000000 00:00 0          [heap]
b74ec000-b76ec000 r--p 00000000 08:03 1333666
/usr/lib/locale/locale-archive
b76ec000-b76f1000 rw-p 00000000 00:00 0
b7700000-b7702000 rw-p 00000000 00:00 0
bfcf0000-bfd05000 rw-p 00000000 00:00 0          [stack]
Aborted (core dumped)

For value the value of *"--wal-segsize " 16, 32, 64*... (all multiple of
16)  we are getting "Segmentation fault" message as below:
[bin]$ ./pg_basebackup -v -D /tmp/slave16
Segmentation fault (core dumped)

and for all other values of* "--wal-segsize " 3, 5, 7, 9, 10, 11, ... 15,
17, 18,* ...  we are getting invalid message during "initdb":
[bin]$ ./initdb -D data1 --wal-segsize=17
initdb: Invalid WAL segment size 17



>
>
>> start the server
>> run pg_basebackup
>>
>> [centos@tushar-centos bin]$ ./pg_basebackup -v -D /tmp/myslave
>> *** glibc detected *** ./pg_basebackup: free(): invalid pointer:
>> 0x08da7f00 ***
>>
>> [centos@tushar-centos bin]$
>>
>> same scenario is working fine against HEAD (v10 ) on Linux32 [i.e no
>> patch applied]
>>
>> [centos@tushar-centos bin]$ ./pg_basebackup --verbose -D /tmp/slave11
>> pg_basebackup: initiating base backup, waiting for checkpoint to complete
>> pg_basebackup: checkpoint completed
>> pg_basebackup: transaction log start point: 0/2800024 on timeline 1
>> pg_basebackup: starting background WAL receiver
>> pg_basebackup: transaction log end point: 0/28000E4
>> pg_basebackup: waiting for background process to finish streaming ...
>> pg_basebackup: base backup completed
>> [centos@tushar-centos bin]$
>>
>
> Just to confirm, was this done with configure flag --with-wal-segsize=4 ?
>

we also have configure with the option "*--with-wal-segsize=4*" and getting
warning.
./configure --with-zlib   --enable-debug  --enable-cassert  --enable-depend
--prefix=$PWD/inst --with-openssl CFLAGS="-g -O0" *--with-wal-segsize=4*

configure: WARNING: unrecognized options: --with-wal-segsize


Thanks & Regards,

Prabhat Kumar Sahu
EnterpriseDB: http://www.enterprisedb.com

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Make WAL segment size configurable at initdb time.

  2. Perform only one ReadControlFile() during startup.

  3. Introduce BYTES unit for GUCs.

  4. Remove useless duplicate inclusions of system header files.

  5. Refactor other replication commands to use DestRemoteSimple.

  6. Add a SHOW command to the replication command language.

  7. Add a new DestReceiver for printing tuples without catalog access.

  8. Support fls().

  9. Extend yesterday's patch making BLCKSZ and RELSEG_SIZE configurable to also

  10. Commit the reasonably uncontroversial parts of J.R. Nield's PITR patch, to

  11. XLOG (also known as WAL -:)) Bootstrap/Startup/Shutdown.

  12. Transaction log manager core code.