Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFUkD-0001lJ-0l for pgsql-docs@arkaria.postgresql.org; Thu, 03 Feb 2022 05:33:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFUkB-0005dN-MU for pgsql-docs@arkaria.postgresql.org; Thu, 03 Feb 2022 05:33:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFUkB-0005dB-FH for pgsql-docs@lists.postgresql.org; Thu, 03 Feb 2022 05:33:19 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFUk8-0001zY-Qu for pgsql-docs@lists.postgresql.org; Thu, 03 Feb 2022 05:33:18 +0000 Received: from [192.168.11.9] (p2019072-ipbf2307funabasi.chiba.ocn.ne.jp [122.30.130.72]) by oss.nttdata.com (Postfix) with ESMTPSA id 4FAA26094C; Thu, 3 Feb 2022 14:33:13 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.5 at oss.nttdata.com Message-ID: Date: Thu, 3 Feb 2022 14:33:12 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: maximum number of backtrace frames logged by backtrace_functions Content-Language: en-US To: Peter Eisentraut , pgsql-docs@lists.postgresql.org References: <0f0ed9f3-3892-e8a3-51c9-ed268dff6bdd@oss.nttdata.com> <4e16a3e9-e717-05e1-d905-6c21beba80f8@enterprisedb.com> From: Fujii Masao In-Reply-To: <4e16a3e9-e717-05e1-d905-6c21beba80f8@enterprisedb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022/02/02 16:20, Peter Eisentraut wrote: > On 01.02.22 18:04, Fujii Masao wrote: >> The maximum number of backtrace frames logged by backtrace_functions is 100. Isn't it better to document this information so that users can understand not all backtrace always can be logged? Patch attached. > > The 100 was chosen as more than you'll ever need.  If you are encountering cases with more than that, let's increase the limit. I encountered the "more than 100 backtrace frames" case when investigating the bug of pg_log_query_plan() patch [1]. Since the function that the patch added can be called repeatedly during call to that function, the backtrace became larger than 100. I think this is not general case, so basically 100 sounds enough limit size to me. OTOH I think it's helpful if the limit is documented when I occasionally encounter the case and want to understand why all backtrace frames are not logged. [1] https://commitfest.postgresql.org/37/3142/ Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION