Re: BUG #7883: "PANIC: WAL contains references to invalid pages" on replica recovery

From: Daniel Farina <daniel(at)heroku(dot)com>
To: Maciek Sakrejda <maciek(at)heroku(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7883: "PANIC: WAL contains references to invalid pages" on replica recovery
Date: 2013-02-15 23:49:10
Message-ID: CAAZKuFa+Aj1TOviYrzcoA+f_060Rv=JXVSsAErk7=ViWjzTWbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Feb 15, 2013 at 3:18 PM, Maciek Sakrejda <maciek(at)heroku(dot)com> wrote:

> On Fri, Feb 15, 2013 at 3:15 PM, Daniel Farina <daniel(at)heroku(dot)com> wrote:
>
>> Can you try master on xlogdump instead of the release? I have fixed a few
>> bugs there a year ago that don't seem to be in the release, and will fix
>> more if necessary.
>>
>
> Had tried that, too--complained about a missing pg_crc_tables.h
>

I'm poking at this and somehow it seems like the wrong PG_VERSION_NUM is
being slurped in -- even though the gcc invocation would suggest it is
properly targeting 9.1 -- which is causing xlogdump to have a cow with
versions < 9.2.

I think the problem is related to this:

/usr/include/postgresql/9.1/server/fmgr.h: PG_VERSION_NUM / 100, \
/usr/include/postgresql/9.1/server/pg_config.h:#define PG_VERSION_NUM 90108
/usr/include/postgresql/pg_config.h:#define PG_VERSION_NUM 90203 <-- this
one
/usr/include/postgresql/9.2/server/fmgr.h: PG_VERSION_NUM / 100, \
/usr/include/postgresql/9.2/server/pg_config.h:#define PG_VERSION_NUM 90203

And USE_PGXS=1 make yields something like....
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security -fPIC -pie -Wall -Wmissing-prototypes
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
-g -DVERSION_STR=\""0.6devel"\" -I. -I/usr/include/postgresql
-DDATADIR=\"/usr/share/postgresql/9.1\" -I. -I.
-I/usr/include/postgresql/9.1/server -I/usr/include/postgresql/internal
-D_FORTIFY_SOURCE=2 -DLINUX_OOM_ADJ=0 -D_GNU_SOURCE -I/usr/include/libxml2
-I/usr/include/tcl8.5 -c -o strlcpy.o strlcpy.c

Where, notably, both the 9.1 and /usr/include/postgresql directories are in
place. Hence, which ever pg_config gets loaded in first decides what
PG_VERSION_NUM is compiling against...that's no good...

Why is it there...because:

dpkg -S /usr/include/postgresql/pg_config.h
libpq-dev: /usr/include/postgresql/pg_config.h

I guess that means Ubuntu (and probably Debian?) libpq-dev breaks
PG_VERSION_NUM for PGXS=1.

--
fdr

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2013-02-15 23:55:02 Re: BUG #7884: pg_upgradecluster is terribly slow
Previous Message Bruce Momjian 2013-02-15 23:46:37 Re: BUG #7873: pg_restore --clean tries to drop tables that don't exist