Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 51EF637EB72 for ; Sun, 15 Jul 2012 18:15:56 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SqWAU-0002II-Ma for pgsql-bugs@postgresql.org; Sun, 15 Jul 2012 21:15:55 +0000 Received: by pbbrp8 with SMTP id rp8so8920729pbb.19 for ; Sun, 15 Jul 2012 14:15:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; bh=CIsm+gty5d7bsT4Nd3GQ59HmbbrYjWU2IbEddtFvRWY=; b=ViDh9cPwmC0vy1MzL7ZmFdYKWRZI87lmpUI0MD2OpVyUBrxLVbnvtCfqZX2RQd5A1d z+0fE6/an4TbUvXcDvb/JQv7BO84lJuBpz2B4B2bBKBNvfkiL+c1rrxI5UKPt5L81Um/ ClzrWseMDv1f51uyQfACaf8PUUyx1gbFGTyY/Yz1q6XmlhAeJABtncVY9WGqThzBo2u3 hH+KqJSJm/E8zPt2iP+vMEqFWGiitdEh7mzAYc4LA/1uf/GFb75UCCy6yHSsrXamQLZb skwmcCa+CeUamq1b2jTnPny5MaPAXPaCc9gJRrmDmpMH3uNhfwv78lldkB9sTeJ81UrU 85Og== Received: by 10.68.232.197 with SMTP id tq5mr21593822pbc.53.1342386940895; Sun, 15 Jul 2012 14:15:40 -0700 (PDT) Received: from [192.168.2.4] (cpe-76-94-193-229.socal.res.rr.com. [76.94.193.229]) by mx.google.com with ESMTPS id pg3sm10477018pbc.2.2012.07.15.14.15.38 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 15 Jul 2012 14:15:40 -0700 (PDT) Subject: Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: multipart/alternative; boundary="Apple-Mail=_DF6B2B82-B082-41F3-8C74-02696F73FD9D" From: Mike Wilson In-Reply-To: <20120713015241.GA15443@momjian.us> Date: Sun, 15 Jul 2012 14:15:35 -0700 Cc: Tom Lane , pgsql-bugs@postgresql.org Message-Id: <8D0918C1-39A0-429A-96DB-997BE362141A@gmail.com> References: <13290.1342133046@sss.pgh.pa.us> <20120712224929.GB25074@momjian.us> <517A874F-B310-4340-803D-EC8625C8B497@gmail.com> <20120713015241.GA15443@momjian.us> To: Bruce Momjian X-Mailer: Apple Mail (2.1278) X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201207/113 X-Sequence-Number: 33589 --Apple-Mail=_DF6B2B82-B082-41F3-8C74-02696F73FD9D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 I've had some time to examine this closer over the weekend. It appears = that pg_upgrade for 9.2b2 segfaults which more than likely has something = to do with the resulting converted database appearing to have no rows. = Earlier in this thread I reported that I was able to get the upgrade to = work and this thread to be closed but I was in error. At the time I was = also testing with the 9.1.4 pg_upgrade which does work and I thought = that I had a successful 9.2b2 pg_upgrade run. Apologies for the = confusion and let me know if you would like me to start a new thread. ... pg_toast.pg_toast_948075_index: 948081 to 948081 c0.page_metadata_values_pkey: 948082 to 948082 c0.i_page_metadata_values_short_name: 948084 to 948084 Segmentation Fault (core dumped) root@db4 / My upgrade procedure is scripted and I hadn't noticed the core dump when = I first reported the bug. Here are the parameters of the run: su - postgres -c "pg_upgrade --verbose --link \ --old-datadir=3D/opt/postgres/db/root/old = --new-datadir=3D/opt/postgres/db/root/new --old-bindir=3D${OLDPG}/bin/64/ = \ --new-bindir=3D${NEWPG}/bin/ --old-port=3D5432 --new-port=3D5920 = --user=3Dpostgres" As a test I have also been using the pg_upgrade from 9.1.4 which does = work: =85 relname: pg_toast.pg_toast_948075: reloid: 948079 reltblspace:=20 relname: pg_toast.pg_toast_948075_index: reloid: 948081 reltblspace:=20 relname: c0.page_metadata_values_pkey: reloid: 948082 reltblspace:=20 relname: c0.i_page_metadata_values_short_name: reloid: 948084 = reltblspace:=20 Database: postgres relname: pg_catalog.pg_largeobject: reloid: 2613 reltblspace:=20 relname: pg_catalog.pg_largeobject_loid_pn_index: reloid: 2683 = reltblspace:=20 Database: template1 relname: pg_catalog.pg_largeobject: reloid: 2613 reltblspace:=20 relname: pg_catalog.pg_largeobject_loid_pn_index: reloid: 2683 = reltblspace:=20 executing: SELECT spclocation FROM pg_catalog.pg_tablespace = WHERE spcname !=3D 'pg_default' AND spcname !=3D = 'pg_global' =85 I've also tried a step-wise migration by first converting to PG914 and = then to PG92b2. This also fails with a similar segfault after the = c0.i_page_metadata_values_short_name index. =20 Of possible note in this DB is that the previous DBA renamed the = "postgres" user. As part of this conversion process I am renaming it = back to it's default. I'm doing this before running pg_upgrade: # shift jibjab su (postgres) account back to postgres rolname su - postgres -c "psql -U jibjab c0 -c \"update pg_authid set = rolname=3D'postgres' where oid=3D10;\"" This probably isn't an issue as the 9.1.4 conversion works but I thought = I should at least mention it. Actually I don't think pg_upgrade will = run correctly if there isn't a postgres user so I imagine I need to = correct this issue before running the upgrade procedure anyway. For now I am stymied in my attempt to upgrade and may have to look at = trying to get the non-link version of the upgrade working. That would = be relatively painful though as this upgrade will be for a commercial = internet site that can't easily tolerate a long down and the production = DB is over a TB in size. I am really looking forward to 9.2's index = only scans due to the size of the DB! =20 Cheers and thanks for any information you have on the issue. Mike Wilson mfwilson@gmail.com On Jul 12, 2012, at 6:52 PM, Bruce Momjian wrote: > On Thu, Jul 12, 2012 at 05:21:31PM -0700, Mike Wilson wrote: >> This can be closed. I figured out what I was doing wrong, which was >> after the conversion I was cleaning up the old datadir by deleting = it, >> which destroyed the hard links to the data since I am using = pg_upgrade >> --link >=20 > Uh, actually, a hard link has two directory entries pointing to the = same > file, so you can delete the old datadir and the new datadir should not > be affected. >=20 > --=20 > Bruce Momjian http://momjian.us > EnterpriseDB http://enterprisedb.com >=20 > + It's impossible for everything to be true. + --Apple-Mail=_DF6B2B82-B082-41F3-8C74-02696F73FD9D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 I've = had some time to examine this closer over the weekend.  It appears = that pg_upgrade for 9.2b2 segfaults which more than likely has something = to do with the resulting converted database appearing to have no rows. =  Earlier in this thread I reported that I was able to get the = upgrade to work and this thread to be closed but I was in error. =  At the time I was also testing with the 9.1.4 pg_upgrade which = does work and I thought that I had a successful 9.2b2 pg_upgrade run. =  Apologies for the confusion and let me know if you would like me = to start a new thread.

<pg_upgrade = 9.2b2>
...
pg_toast.pg_toast_948075_index: = 948081 to 948081
c0.page_metadata_values_pkey: 948082 to = 948082
c0.i_page_metadata_values_short_name: 948084 to = 948084


Segmentation Fault (core = dumped)
root@db4 /
</>
My = upgrade procedure is scripted and I hadn't noticed the core dump when I = first reported the bug.  Here are the parameters of the = run:
su - postgres -c "pg_upgrade =
--verbose --link \
--old-datadir=3D/opt/postgres/db/root/old =
--new-datadir=3D/opt/postgres/db/root/new --old-bindir=3D${OLDPG}/bin/64/ =
\
--new-bindir=3D${NEWPG}/bin/ --old-port=3D5432 --new-port=3D5920 =
--user=3Dpostgres"

As a test I have also = been using the pg_upgrade from 9.1.4 which does = work:
<pg_upgrade 9.1.4>
=85
relname: = pg_toast.pg_toast_948075: reloid: 948079 reltblspace: 
relname: = pg_toast.pg_toast_948075_index: reloid: 948081 = reltblspace: 
relname: c0.page_metadata_values_pkey: = reloid: 948082 reltblspace: 
relname: = c0.i_page_metadata_values_short_name: reloid: 948084 = reltblspace: 


Database: = postgres
relname: pg_catalog.pg_largeobject: reloid: 2613 = reltblspace: 
relname: = pg_catalog.pg_largeobject_loid_pn_index: reloid: 2683 = reltblspace: 


Database: = template1
relname: pg_catalog.pg_largeobject: reloid: 2613 = reltblspace: 
relname: = pg_catalog.pg_largeobject_loid_pn_index: reloid: 2683 = reltblspace: 


executing: = SELECT       spclocation FROM       =  pg_catalog.pg_tablespace WHERE  spcname !=3D 'pg_default' AND =             spcname !=3D = 'pg_global'
=85
</>

I've = also tried a step-wise migration by first converting to PG914 and then = to PG92b2.  This also fails with a similar segfault after = the c0.i_page_metadata_values_short_name index. =  

Of possible note in this DB is that the = previous DBA renamed the "postgres" user.  As part of this = conversion process I am renaming it back to it's default.  I'm = doing this before running pg_upgrade:
# shift jibjab su (postgres) account back to postgres rolname
su - postgres -c "psql -U jibjab c0 -c \"update pg_authid set =
rolname=3D'postgres' where oid=3D10;\""

This probably isn't an issue as the 9.1.4 = conversion works but I thought I should at least mention it. =  Actually I don't think pg_upgrade will run correctly if there = isn't a postgres user so I imagine I need to correct this issue before = running the upgrade procedure anyway.

For now I = am stymied in my attempt to upgrade and may have to look at trying to = get the non-link version of the upgrade working.  That would be = relatively painful though as this upgrade will be for a commercial = internet site that can't easily tolerate a long down and the production = DB is over a TB in size.  I am really looking forward to 9.2's = index only scans due to the size of the DB! =  

Cheers and thanks for any information = you have on the issue.

Mike Wilson



On Jul 12, 2012, at 6:52 PM, Bruce Momjian wrote:

On = Thu, Jul 12, 2012 at 05:21:31PM -0700, Mike Wilson wrote:
This can be closed.  I figured out what I was doing = wrong, which was
after the = conversion I was cleaning up the old datadir by deleting = it,
which destroyed the hard = links to the data since I am using = pg_upgrade
--link

Uh, actually, a hard link has = two directory entries pointing to the same
file, so you can delete = the old datadir and the new datadir should not
be affected.

-- =
 Bruce Momjian  <bruce@momjian.us> =        http://momjian.us
 EnterpriseDB =             &n= bsp;           &nbs= p;   http://enterprisedb.com

=  + It's impossible for everything to be true. = +

= --Apple-Mail=_DF6B2B82-B082-41F3-8C74-02696F73FD9D--