Re: BUG #10013: PostgreSQL 9.4 initdb FATAL: could not write to file "pg_xlog/xlogtemp.3590": No space left on devi

From: 德哥 <digoal(at)126(dot)com>
To: "Heikki Linnakangas" <hlinnakangas(at)vmware(dot)com>
Cc: "Andres Freund" <andres(at)2ndquadrant(dot)com>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #10013: PostgreSQL 9.4 initdb FATAL: could not write to file "pg_xlog/xlogtemp.3590": No space left on devi
Date: 2014-04-16 11:17:34
Message-ID: 692e040.298db.1456a4197c1.Coremail.digoal@126.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

HI,

[root(at)db-172-16-3-150 postgresql-46a60ab]# patch -p1 < ./morelogging-in-xlogfileinit.patch
(Stripping trailing CRs from patch.)
patching file src/backend/access/transam/xlog.c
Hunk #1 succeeded at 3142 with fuzz 1.
[root(at)db-172-16-3-150 postgresql-46a60ab]# gmake
[root(at)db-172-16-3-150 postgresql-46a60ab]# gmake install
[root(at)db-172-16-3-150 postgresql-46a60ab]# ll /home/pg94/pgsql9.4devel/bin/initdb
-rwxr-xr-x 1 root root 266843 Apr 16 19:12 /home/pg94/pgsql9.4devel/bin/initdb
su - pg94
pg94(at)db-172-16-3-150-> initdb --debug
Running in debug mode.
The files belonging to this database system will be owned by user "pg94".
This user must also own the server process.

VERSION=9.4devel
PGDATA=/home/pg94/pg_root
share_path=/home/pg94/pgsql9.4devel/share
PGPATH=/home/pg94/pgsql9.4devel/bin
POSTGRES_SUPERUSERNAME=pg94
POSTGRES_BKI=/home/pg94/pgsql9.4devel/share/postgres.bki
POSTGRES_DESCR=/home/pg94/pgsql9.4devel/share/postgres.description
POSTGRES_SHDESCR=/home/pg94/pgsql9.4devel/share/postgres.shdescription
POSTGRESQL_CONF_SAMPLE=/home/pg94/pgsql9.4devel/share/postgresql.conf.sample
PG_HBA_SAMPLE=/home/pg94/pgsql9.4devel/share/pg_hba.conf.sample
PG_IDENT_SAMPLE=/home/pg94/pgsql9.4devel/share/pg_ident.conf.sample
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /home/pg94/pg_root ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
creating template1 database in /home/pg94/pg_root/base/1 ... DEBUG: invoking IpcMemoryCreate(size=152027136)
DEBUG: SlruScanDirectory invoking callback on pg_notify/0000
DEBUG: removing file "pg_notify/0000"
DEBUG: dynamic shared memory system will support 288 segments
DEBUG: created dynamic shared memory control segment 1804289383 (2316 bytes)
DEBUG: transaction ID wrap limit is 2147483650, limited by database with OID 1
DEBUG: MultiXactId wrap limit is 2147483648, limited by database with OID 1
DEBUG: creating and filling new WAL file
LOG: write() in XLogFileInit returned 40960: Success
FATAL: could not write to file "pg_xlog/xlogtemp.685": No space left on device
DEBUG: shmem_exit(1): 0 before_shmem_exit callbacks to make
DEBUG: shmem_exit(1): 4 on_shmem_exit callbacks to make
DEBUG: cleaning up dynamic shared memory control segment with ID 1804289383
DEBUG: proc_exit(1): 3 callbacks to make
DEBUG: exit(1)
DEBUG: shmem_exit(-1): 0 before_shmem_exit callbacks to make
DEBUG: shmem_exit(-1): 0 on_shmem_exit callbacks to make
DEBUG: proc_exit(-1): 0 callbacks to make
child process exited with exit code 1
initdb: removing data directory "/home/pg94/pg_root"

--
公益是一辈子的事,I'm Digoal,Just Do It.

At 2014-04-16 19:11:22,"Heikki Linnakangas" <hlinnakangas(at)vmware(dot)com> wrote:
>On 04/16/2014 01:59 PM, Andres Freund wrote:
>> On 2014-04-16 13:50:35 +0300, Heikki Linnakangas wrote:
>>> On 04/16/2014 11:20 AM, digoal(at)126(dot)com wrote:
>>>> HI,
>>>> I can reproduce this.
>>>
>>> Ok. Can you try with the attached patch applied, please?
>>
>> Perhaps this should also support partial writes, akin to
>> 79ce29c734c6a652b2f7193bda537cff0c8eb8c1? I don't find it all that
>> unreasonble for the OS to refuse 16MB - or even bigger - writes in some
>> scenarios.
>
>The write in XLogFileInit is always 8kB (XLOG_BLCKSZ). But yeah, it
>might make sense to retry. Although I wonder why XLogFileInit would be
>particularly vulnerable to short writes. I'm afraid if we fix that, next
>we'll start seeing failures from other writes, to data files.
>
>But wait for Digoal to run with the extra let's see if this was in fact
>a short write. Could also be a quota or similar.
>
>- Heikki

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 德哥 2014-04-16 11:19:18 Re: BUG #10013: PostgreSQL 9.4 initdb FATAL: could not write to file "pg_xlog/xlogtemp.3590": No space left on devi
Previous Message Andres Freund 2014-04-16 11:16:45 Re: BUG #10013: PostgreSQL 9.4 initdb FATAL: could not write to file "pg_xlog/xlogtemp.3590": No space left on devi