pgsql: Get rid of the need for manual maintenance of the initial

Lists: pgsql-committerspgsql-hackers
From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 01:06:57
Message-ID: 20100105010657.A9AC3753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Log Message:
-----------
Get rid of the need for manual maintenance of the initial contents of
pg_attribute, by having genbki.pl derive the information from the various
catalog header files. This greatly simplifies modification of the
"bootstrapped" catalogs.

This patch finally kills genbki.sh and Gen_fmgrtab.sh; we now rely entirely on
Perl scripts for those build steps. To avoid creating a Perl build dependency
where there was not one before, the output files generated by these scripts
are now treated as distprep targets, ie, they will be built and shipped in
tarballs. But you will need a reasonably modern Perl (probably at least
5.6) if you want to build from a CVS pull.

The changes to the MSVC build process are untested, and may well break ---
we'll soon find out from the buildfarm.

John Naylor, based on ideas from Robert Haas and others

Modified Files:
--------------
pgsql/doc/src/sgml:
bki.sgml (r1.22 -> r1.23)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/bki.sgml?r1=1.22&r2=1.23)
installation.sgml (r1.335 -> r1.336)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/installation.sgml?r1=1.335&r2=1.336)
pgsql/src/backend:
Makefile (r1.137 -> r1.138)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/Makefile?r1=1.137&r2=1.138)
pgsql/src/backend/catalog:
Makefile (r1.74 -> r1.75)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/Makefile?r1=1.74&r2=1.75)
README (r1.13 -> r1.14)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/README?r1=1.13&r2=1.14)
pgsql/src/backend/utils:
Gen_fmgrtab.pl (r1.3 -> r1.4)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/Gen_fmgrtab.pl?r1=1.3&r2=1.4)
Makefile (r1.28 -> r1.29)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/Makefile?r1=1.28&r2=1.29)
pgsql/src/backend/utils/cache:
relcache.c (r1.295 -> r1.296)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c?r1=1.295&r2=1.296)
pgsql/src/include:
Makefile (r1.29 -> r1.30)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/Makefile?r1=1.29&r2=1.30)
pgsql/src/include/catalog:
genbki.h (r1.5 -> r1.6)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/genbki.h?r1=1.5&r2=1.6)
indexing.h (r1.114 -> r1.115)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/indexing.h?r1=1.114&r2=1.115)
pg_aggregate.h (r1.69 -> r1.70)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_aggregate.h?r1=1.69&r2=1.70)
pg_am.h (r1.64 -> r1.65)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_am.h?r1=1.64&r2=1.65)
pg_amop.h (r1.91 -> r1.92)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_amop.h?r1=1.91&r2=1.92)
pg_amproc.h (r1.76 -> r1.77)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_amproc.h?r1=1.76&r2=1.77)
pg_attrdef.h (r1.25 -> r1.26)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_attrdef.h?r1=1.25&r2=1.26)
pg_attribute.h (r1.156 -> r1.157)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_attribute.h?r1=1.156&r2=1.157)
pg_auth_members.h (r1.7 -> r1.8)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_auth_members.h?r1=1.7&r2=1.8)
pg_authid.h (r1.11 -> r1.12)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_authid.h?r1=1.11&r2=1.12)
pg_cast.h (r1.43 -> r1.44)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_cast.h?r1=1.43&r2=1.44)
pg_class.h (r1.118 -> r1.119)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_class.h?r1=1.118&r2=1.119)
pg_constraint.h (r1.35 -> r1.36)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_constraint.h?r1=1.35&r2=1.36)
pg_conversion.h (r1.23 -> r1.24)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_conversion.h?r1=1.23&r2=1.24)
pg_database.h (r1.52 -> r1.53)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_database.h?r1=1.52&r2=1.53)
pg_db_role_setting.h (r1.2 -> r1.3)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_db_role_setting.h?r1=1.2&r2=1.3)
pg_default_acl.h (r1.2 -> r1.3)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_default_acl.h?r1=1.2&r2=1.3)
pg_depend.h (r1.12 -> r1.13)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_depend.h?r1=1.12&r2=1.13)
pg_description.h (r1.29 -> r1.30)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_description.h?r1=1.29&r2=1.30)
pg_enum.h (r1.7 -> r1.8)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_enum.h?r1=1.7&r2=1.8)
pg_foreign_data_wrapper.h (r1.4 -> r1.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_foreign_data_wrapper.h?r1=1.4&r2=1.5)
pg_foreign_server.h (r1.4 -> r1.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_foreign_server.h?r1=1.4&r2=1.5)
pg_index.h (r1.49 -> r1.50)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_index.h?r1=1.49&r2=1.50)
pg_inherits.h (r1.29 -> r1.30)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_inherits.h?r1=1.29&r2=1.30)
pg_language.h (r1.36 -> r1.37)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_language.h?r1=1.36&r2=1.37)
pg_largeobject.h (r1.26 -> r1.27)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_largeobject.h?r1=1.26&r2=1.27)
pg_largeobject_metadata.h (r1.2 -> r1.3)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_largeobject_metadata.h?r1=1.2&r2=1.3)
pg_listener.h (r1.27 -> r1.28)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_listener.h?r1=1.27&r2=1.28)
pg_namespace.h (r1.26 -> r1.27)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_namespace.h?r1=1.26&r2=1.27)
pg_opclass.h (r1.86 -> r1.87)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_opclass.h?r1=1.86&r2=1.87)
pg_operator.h (r1.168 -> r1.169)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_operator.h?r1=1.168&r2=1.169)
pg_opfamily.h (r1.12 -> r1.13)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_opfamily.h?r1=1.12&r2=1.13)
pg_pltemplate.h (r1.11 -> r1.12)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_pltemplate.h?r1=1.11&r2=1.12)
pg_proc.h (r1.558 -> r1.559)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h?r1=1.558&r2=1.559)
pg_rewrite.h (r1.34 -> r1.35)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_rewrite.h?r1=1.34&r2=1.35)
pg_shdepend.h (r1.11 -> r1.12)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_shdepend.h?r1=1.11&r2=1.12)
pg_shdescription.h (r1.8 -> r1.9)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_shdescription.h?r1=1.8&r2=1.9)
pg_statistic.h (r1.41 -> r1.42)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_statistic.h?r1=1.41&r2=1.42)
pg_tablespace.h (r1.13 -> r1.14)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_tablespace.h?r1=1.13&r2=1.14)
pg_trigger.h (r1.37 -> r1.38)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_trigger.h?r1=1.37&r2=1.38)
pg_ts_config.h (r1.6 -> r1.7)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_ts_config.h?r1=1.6&r2=1.7)
pg_ts_config_map.h (r1.6 -> r1.7)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_ts_config_map.h?r1=1.6&r2=1.7)
pg_ts_dict.h (r1.6 -> r1.7)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_ts_dict.h?r1=1.6&r2=1.7)
pg_ts_parser.h (r1.6 -> r1.7)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_ts_parser.h?r1=1.6&r2=1.7)
pg_ts_template.h (r1.7 -> r1.8)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_ts_template.h?r1=1.7&r2=1.8)
pg_type.h (r1.211 -> r1.212)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_type.h?r1=1.211&r2=1.212)
pg_user_mapping.h (r1.4 -> r1.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_user_mapping.h?r1=1.4&r2=1.5)
toasting.h (r1.11 -> r1.12)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/toasting.h?r1=1.11&r2=1.12)
pgsql/src/interfaces/ecpg/ecpglib:
pg_type.h (r1.10 -> r1.11)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/ecpglib/pg_type.h?r1=1.10&r2=1.11)
pgsql/src/tools/msvc:
Solution.pm (r1.51 -> r1.52)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/tools/msvc/Solution.pm?r1=1.51&r2=1.52)
clean.bat (r1.17 -> r1.18)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/tools/msvc/clean.bat?r1=1.17&r2=1.18)

Added Files:
-----------
pgsql/src/backend/catalog:
.cvsignore (r1.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/.cvsignore?rev=1.1&content-type=text/x-cvsweb-markup)
Catalog.pm (r1.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/Catalog.pm?rev=1.1&content-type=text/x-cvsweb-markup)
genbki.pl (r1.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/genbki.pl?rev=1.1&content-type=text/x-cvsweb-markup)

Removed Files:
-------------
pgsql/src/backend/catalog:
genbki.sh
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/genbki.sh)
pgsql/src/backend/utils:
Gen_fmgrtab.sh
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/Gen_fmgrtab.sh)
pgsql/src/tools/msvc:
Genbki.pm
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/tools/msvc/Genbki.pm)


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org, John Naylor <jcnaylor(at)gmail(dot)com>
Subject: Re: pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 01:28:55
Message-ID: 603c8f071001041728r69420f70sb04188705f884252@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Mon, Jan 4, 2010 at 8:06 PM, Tom Lane <tgl(at)postgresql(dot)org> wrote:
> Log Message:
> -----------
> Get rid of the need for manual maintenance of the initial contents of
> pg_attribute, by having genbki.pl derive the information from the various
> catalog header files.  This greatly simplifies modification of the
> "bootstrapped" catalogs.
>
> This patch finally kills genbki.sh and Gen_fmgrtab.sh; we now rely entirely on
> Perl scripts for those build steps.  To avoid creating a Perl build dependency
> where there was not one before, the output files generated by these scripts
> are now treated as distprep targets, ie, they will be built and shipped in
> tarballs.  But you will need a reasonably modern Perl (probably at least
> 5.6) if you want to build from a CVS pull.
>
> The changes to the MSVC build process are untested, and may well break ---
> we'll soon find out from the buildfarm.
>
> John Naylor, based on ideas from Robert Haas and others

Awesome.

...Robert


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org, John Naylor <jcnaylor(at)gmail(dot)com>
Subject: Re: pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 02:20:42
Message-ID: 24656.1262658042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Awesome.

It still needs some makefile work, but I wanted to push it in so we
could see if the MSVC stuff works.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-committers(at)postgresql(dot)org, John Naylor <jcnaylor(at)gmail(dot)com>
Subject: Re: pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 02:34:07
Message-ID: 4B42A51F.5020400@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>
>> Awesome.
>>
>
> It still needs some makefile work, but I wanted to push it in so we
> could see if the MSVC stuff works.
>
>
>

Looks like it does.

cheers

andrew


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 17:24:39
Message-ID: 4B4375D7.4070708@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Log Message:
> -----------
> Get rid of the need for manual maintenance of the initial contents of
> pg_attribute, by having genbki.pl derive the information from the various
> catalog header files. This greatly simplifies modification of the
> "bootstrapped" catalogs.
>
> This patch finally kills genbki.sh and Gen_fmgrtab.sh; we now rely entirely on
> Perl scripts for those build steps. To avoid creating a Perl build dependency
> where there was not one before, the output files generated by these scripts
> are now treated as distprep targets, ie, they will be built and shipped in
> tarballs. But you will need a reasonably modern Perl (probably at least
> 5.6) if you want to build from a CVS pull.

this broke the build on spoonbill:

http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=spoonbill&dt=2010-01-05%2015:05:08

manually executing the command shows that the perl process eats more
than 250MB of RAM at closely afterwards fails with an out of memory due
to hitting the process limit on that box.
I don't think that is in any way sane :)

# perl -v
This is perl, v5.8.8 built for sparc64-openbsd

Stefan


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 17:40:02
Message-ID: 11933.1262713202@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
> this broke the build on spoonbill:

> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=spoonbill&dt=2010-01-05%2015:05:08

> manually executing the command shows that the perl process eats more
> than 250MB of RAM at closely afterwards fails with an out of memory due
> to hitting the process limit on that box.
> I don't think that is in any way sane :)

Bizarre. Gen_fmgrtab.pl doesn't eat anywhere near that much RAM here.
Anybody else seeing the same?

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 17:40:04
Message-ID: 603c8f071001050940veb959b0j2fb76f3d76ec8657@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Tue, Jan 5, 2010 at 12:24 PM, Stefan Kaltenbrunner
<stefan(at)kaltenbrunner(dot)cc> wrote:
> Tom Lane wrote:
>>
>> Log Message:
>> -----------
>> Get rid of the need for manual maintenance of the initial contents of
>> pg_attribute, by having genbki.pl derive the information from the various
>> catalog header files.  This greatly simplifies modification of the
>> "bootstrapped" catalogs.
>>
>> This patch finally kills genbki.sh and Gen_fmgrtab.sh; we now rely
>> entirely on
>> Perl scripts for those build steps.  To avoid creating a Perl build
>> dependency
>> where there was not one before, the output files generated by these
>> scripts
>> are now treated as distprep targets, ie, they will be built and shipped in
>> tarballs.  But you will need a reasonably modern Perl (probably at least
>> 5.6) if you want to build from a CVS pull.
>
> this broke the build on spoonbill:
>
> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=spoonbill&dt=2010-01-05%2015:05:08
>
> manually executing the command shows that the perl process eats more than
> 250MB of RAM at closely afterwards fails with an out of memory due to
> hitting the process limit on that box.
> I don't think that is in any way sane :)
>
>
> # perl -v
> This is perl, v5.8.8 built for sparc64-openbsd

I just tried this with ulimit -v 131072 and it worked. At 65536 and
32768 it emited an error about being unable to set the locale but
still seemed to run. At 32768 it couldn't load all its shared
libraries any more so it croaked, but with a different error message.

Can we get the output of ulimit -a on that machine?

Is there by any chance some other, conflicting Catalog.pm on that machine?

...Robert


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 17:49:24
Message-ID: 4B437BA4.90009@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Robert Haas wrote:
> On Tue, Jan 5, 2010 at 12:24 PM, Stefan Kaltenbrunner
> <stefan(at)kaltenbrunner(dot)cc> wrote:
>> Tom Lane wrote:
>>> Log Message:
>>> -----------
>>> Get rid of the need for manual maintenance of the initial contents of
>>> pg_attribute, by having genbki.pl derive the information from the various
>>> catalog header files. This greatly simplifies modification of the
>>> "bootstrapped" catalogs.
>>>
>>> This patch finally kills genbki.sh and Gen_fmgrtab.sh; we now rely
>>> entirely on
>>> Perl scripts for those build steps. To avoid creating a Perl build
>>> dependency
>>> where there was not one before, the output files generated by these
>>> scripts
>>> are now treated as distprep targets, ie, they will be built and shipped in
>>> tarballs. But you will need a reasonably modern Perl (probably at least
>>> 5.6) if you want to build from a CVS pull.
>> this broke the build on spoonbill:
>>
>> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=spoonbill&dt=2010-01-05%2015:05:08
>>
>> manually executing the command shows that the perl process eats more than
>> 250MB of RAM at closely afterwards fails with an out of memory due to
>> hitting the process limit on that box.
>> I don't think that is in any way sane :)
>>
>>
>> # perl -v
>> This is perl, v5.8.8 built for sparc64-openbsd
>
> I just tried this with ulimit -v 131072 and it worked. At 65536 and
> 32768 it emited an error about being unable to set the locale but
> still seemed to run. At 32768 it couldn't load all its shared
> libraries any more so it croaked, but with a different error message.
>
> Can we get the output of ulimit -a on that machine?

$ ulimit -a
time(cpu-seconds) unlimited
file(blocks) unlimited
coredump(blocks) unlimited
data(kbytes) 524288
stack(kbytes) 4096
lockedmem(kbytes) 334589
memory(kbytes) 1000456
nofiles(descriptors) 128
processes 64

>
> Is there by any chance some other, conflicting Catalog.pm on that machine?

as I said I can reproduce it manually withe the Catalog.pm from the
failing build as well.
I can succeed building it using the root account but that runs the box
more or less out of memory as it eats up to ~550MB RSS and 990MB of SIZE...

Stefan


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 17:51:48
Message-ID: 12112.1262713908@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Is there by any chance some other, conflicting Catalog.pm on that machine?

Even if there is, shouldn't the use of "perl -I" ensure our version gets
loaded?

Also, Stefan's log shows that it got through genbki.pl, so whatever the
problem is, I don't think it's Catalog.pm's fault.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 18:11:05
Message-ID: 603c8f071001051011g21823744n905d016fead71291@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Tue, Jan 5, 2010 at 12:51 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Is there by any chance some other, conflicting Catalog.pm on that machine?
>
> Even if there is, shouldn't the use of "perl -I" ensure our version gets
> loaded?

I would certainly think so.

> Also, Stefan's log shows that it got through genbki.pl, so whatever the
> problem is, I don't think it's Catalog.pm's fault.

Beats me. I don't have any other ideas at the moment.

...Robert


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 18:18:28
Message-ID: 12575.1262715508@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Beats me. I don't have any other ideas at the moment.

Stefan, could you try adding some debugging printouts to the
Gen_fmgrtab.pl script to see how far it gets before blowing up?

regards, tom lane


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 18:44:07
Message-ID: 4B438877.3010903@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Beats me. I don't have any other ideas at the moment.
>
> Stefan, could you try adding some debugging printouts to the
> Gen_fmgrtab.pl script to see how far it gets before blowing up?

did that and it seems the problem is in the loop that does:

foreach my $row (@$data)
{

# To construct fmgroids.h and fmgrtab.c, we need to inspect some
# of the individual data fields. Just splitting on whitespace
# won't work, because some quoted fields might contain internal
# whitespace. We handle this by folding them all to a simple
# "xxx". Fortunately, this script doesn't need to look at any
# fields that might need quoting, so this simple hack is
# sufficient.

...
}

it does after around 1050 iterations of that loop at it seems to leak
exactly 240kbyte per iteration which sums up to around 250MB in total
for the process...

Stefan


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 19:02:51
Message-ID: 13321.1262718171@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
> did that and it seems the problem is in the loop that does:

> foreach my $row (@$data)
> {

> # To construct fmgroids.h and fmgrtab.c, we need to inspect some
> # of the individual data fields. Just splitting on whitespace

Huh. It's weird that I don't see a leak in either 5.8.7 or 5.10.1,
which are the two closest perl versions I have handy here. I think
this may be a platform-specific Perl bug. Still, it would be nice
to work around it if we can.

I'm not nearly good enough in Perl to be sure about the semantics
of this loop. Is it possible that it's changing the global contents
of the @$data structure, rather than just hacking a local copy of
each row before pushing some values into @fmgr?

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 19:04:05
Message-ID: 20100105190404.GH3660@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Stefan Kaltenbrunner escribió:

> foreach my $row (@$data)
> {
>
> # To construct fmgroids.h and fmgrtab.c, we need to inspect some
> # of the individual data fields. Just splitting on whitespace
> # won't work, because some quoted fields might contain internal
> # whitespace. We handle this by folding them all to a simple
> # "xxx". Fortunately, this script doesn't need to look at any
> # fields that might need quoting, so this simple hack is
> # sufficient.
>
> ...
> }
>
> it does after around 1050 iterations of that loop at it seems to
> leak exactly 240kbyte per iteration which sums up to around 250MB in
> total for the process...

Hmm, is this running some old Perl version? Perhaps it's not freeing
memory timely ... maybe unsetting/deleting $row after each iteration?

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 19:23:15
Message-ID: 4B4391A3.2090203@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
>> did that and it seems the problem is in the loop that does:
>
>> foreach my $row (@$data)
>> {
>
>> # To construct fmgroids.h and fmgrtab.c, we need to inspect some
>> # of the individual data fields. Just splitting on whitespace
>
> Huh. It's weird that I don't see a leak in either 5.8.7 or 5.10.1,
> which are the two closest perl versions I have handy here. I think
> this may be a platform-specific Perl bug. Still, it would be nice
> to work around it if we can.

yeah it is probably some strange platform specific issue - however with
some help from the IRC channel I came up with the following patch that
considerable reduces the memory bloat (but still needs ~55MB max) and
allows the build to succeed.

>
> I'm not nearly good enough in Perl to be sure about the semantics
> of this loop. Is it possible that it's changing the global contents
> of the @$data structure, rather than just hacking a local copy of
> each row before pushing some values into @fmgr?

hmm it is leaking a constant amount of 240kbyte per loop iteration with
the original code but yeah very weird issue...

Stefan

Attachment Content-Type Size
gen_fmgrtab_workaround.patch text/x-patch 559 bytes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 19:31:43
Message-ID: 13739.1262719903@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
> yeah it is probably some strange platform specific issue - however with
> some help from the IRC channel I came up with the following patch that
> considerable reduces the memory bloat (but still needs ~55MB max) and
> allows the build to succeed.

What about Alvaro's idea of adding

$row = undef;

at the bottom of the loop? That seems marginally less ugly...

regards, tom lane


From: Garick Hamlin <ghamlin(at)isc(dot)upenn(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 19:37:51
Message-ID: 20100105193751.GF88668@isc.upenn.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

On Tue, Jan 05, 2010 at 02:02:51PM -0500, Tom Lane wrote:
> Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
> > did that and it seems the problem is in the loop that does:
>
> > foreach my $row (@$data)
> > {
>
> > # To construct fmgroids.h and fmgrtab.c, we need to inspect some
> > # of the individual data fields. Just splitting on whitespace
>
> Huh. It's weird that I don't see a leak in either 5.8.7 or 5.10.1,
> which are the two closest perl versions I have handy here. I think
> this may be a platform-specific Perl bug. Still, it would be nice
> to work around it if we can.
>
> I'm not nearly good enough in Perl to be sure about the semantics
> of this loop. Is it possible that it's changing the global contents
> of the @$data structure, rather than just hacking a local copy of
> each row before pushing some values into @fmgr?
Yes, that is what would happen.
I have not read this script at all but that is how perl works...

$row is an aliased to each scalar in the list '(@$data)'

There is no copying. Copying happens on list assignment,
but not with for/foreach.

If you wanted a copy you need something like:
foreach my $row (@{[ @$data ]}) {

for a shallow copy.

Is that a problem? (I haven't read the script)

Garick

>
> regards, tom lane
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Garick Hamlin <ghamlin(at)isc(dot)upenn(dot)edu>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 19:42:03
Message-ID: 13902.1262720523@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Garick Hamlin <ghamlin(at)isc(dot)upenn(dot)edu> writes:
> On Tue, Jan 05, 2010 at 02:02:51PM -0500, Tom Lane wrote:
>> I'm not nearly good enough in Perl to be sure about the semantics
>> of this loop. Is it possible that it's changing the global contents
>> of the @$data structure, rather than just hacking a local copy of
>> each row before pushing some values into @fmgr?

> Yes, that is what would happen.
> Is that a problem? (I haven't read the script)

Well, it *shouldn't* be a problem, but what it looks like to me is
that Stefan's perl version is somehow leaking one copy of the whole
$data structure each time through the loop. If we were to copy and
then modify each row individually, maybe that'd dodge the bug.

regards, tom lane


From: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 19:43:56
Message-ID: 4B43967C.7000803@kaltenbrunner.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
>> yeah it is probably some strange platform specific issue - however with
>> some help from the IRC channel I came up with the following patch that
>> considerable reduces the memory bloat (but still needs ~55MB max) and
>> allows the build to succeed.
>
> What about Alvaro's idea of adding
>
> $row = undef;
>
> at the bottom of the loop? That seems marginally less ugly...

not sure I want to argue about the ugliness of perl but that has the
same effect as my patch so either way would do to get spoonbill green again.

Stefan


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 20:23:57
Message-ID: 14756.1262723037@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc> writes:
>> What about Alvaro's idea of adding
>> $row = undef;
>> at the bottom of the loop? That seems marginally less ugly...

> not sure I want to argue about the ugliness of perl but that has the
> same effect as my patch so either way would do to get spoonbill green again.

OK, done.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 20:36:30
Message-ID: 4B43A2CE.7010209@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> I'm not nearly good enough in Perl to be sure about the semantics
> of this loop. Is it possible that it's changing the global contents
> of the @$data structure, rather than just hacking a local copy of
> each row before pushing some values into @fmgr?
>

That's exactly what it does. The loop variable is an alias. See
perlsyn(1) for details.

These two lines appear to be suspicious:

$row->{bki_values} =~ s/"[^"]*"/"xxx"/g;
@{$row}{(at)attnames} = split /\s+/, $row->{bki_values};

Something like:

(my $bkival = $row->{bki_values}) =~ s/"[^"]*"/"xxx"/g;
my $atts = {};
@{$atts}{(at)attnames} = split /\s+/, $bkival;

might work better.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Date: 2010-01-05 20:48:23
Message-ID: 15018.1262724503@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Something like:
> (my $bkival = $row->{bki_values}) =~ s/"[^"]*"/"xxx"/g;
> my $atts = {};
> @{$atts}{(at)attnames} = split /\s+/, $bkival;
> might work better.

I committed Alvaro's suggestion (undef at the bottom), but feel
free to clean it up if you like this way better.

regards, tom lane