Re: XLogInsert scaling, revisited - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: XLogInsert scaling, revisited
Date
Msg-id 5064779A.3050407@vmware.com
Whole thread Raw
In response to Re: XLogInsert scaling, revisited  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: XLogInsert scaling, revisited  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On 24.09.2012 21:06, Fujii Masao wrote:
> The patch could be applied cleanly and the compile could be successfully done.

Thanks for the testing!

> But when I ran initdb, I got the following assertion error:
>
> ------------------------------------------
> $ initdb -D data --locale=C --encoding=UTF-8
> The files belonging to this database system will be owned by user "postgres".
> This user must also own the server process.
>
> The database cluster will be initialized with locale "C".
> The default text search configuration will be set to "english".
>
> creating directory data ... ok
> creating subdirectories ... ok
> selecting default max_connections ... 100
> selecting default shared_buffers ... 128MB
> creating configuration files ... ok
> creating template1 database in data/base/1 ... ok
> initializing pg_authid ... ok
> initializing dependencies ... TRAP: FailedAssertion("!(((uint64)
> currpos) % 8192>= (((intptr_t) ((sizeof(XLogPageHeaderData))) + ((8)
> - 1))&  ~((intptr_t) ((8) - 1))) || rdata_len == 0)", File: "xlog.c",
> Line: 1363)
> sh: line 1: 29537 Abort trap: 6           "/dav/hoge/bin/postgres"
> --single -F -O -c search_path=pg_catalog -c exit_on_error=true
> template1>  /dev/null
> child process exited with exit code 134
> initdb: removing data directory "data"
> ------------------------------------------
>
> I got the above problem on MacOS:

Hmm, I cannot reproduce this on my Linux laptop. However, I think I see
what the problem is: the assertion should assert that (*CurrPos* %
XLOG_BLCKZ >= SizeOfXLogShortPHD), not currpos. The former is an
XLogRecPtr, the latter is a pointer. If the WAL buffers are aligned at
8k boundaries, the effect is the same, but otherwise the assertion is
just wrong. And as it happens, if O_DIRECT is defined, we align WAL
buffers at XLOG_BLCKSZ. I think that's why I don't see this on my
laptop. Does Mac OS X not define O_DIRECT?

Anyway, attached is a patch with that fixed.

- Heikki

Attachment

pgsql-hackers by date:

Previous
From: John R Pierce
Date:
Subject: Re: psql, remove include of psqlscan.c
Next
From: Tom Lane
Date:
Subject: Re: psql, remove include of psqlscan.c