Default of max_stack_depth and getrlimit

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Default of max_stack_depth and getrlimit
Date: 2008-07-21 08:53:08
Message-ID: 48844E74.1060704@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In 8.2, we started to use getrlimit(RLIMIT_STACK, ...) to set
max_stack_depth automatically, to a max of 2MB:

http://archives.postgresql.org/pgsql-hackers/2006-10/msg00389.php

However, it's not behaving as I expected when the stack limit is set to
"unlimited". I would expect max_stack_depth to be set to the max of 2MB,
but instead it gets set to 100kB.

I don't normally run without a limit, but it looks like the regression
tests run like that with "make check", at least on my platform. I bumped
into this while running a custom regression test with very deep nesting.

I think we should differentiate between "infinite" and "unknown" in the
return value of get_stack_depth_limit(), and use max_stack_depth of 2MB
in case of infinite, and fall back to the 100kB only in the unknown case.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2008-07-21 11:08:50 overlaps performance
Previous Message Markus Wanner 2008-07-21 08:40:02 Re: Postgres-R: primary key patches