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 1lKGdh-0002f4-Df for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Mar 2021 08:25:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKGdg-0005r4-2y for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Mar 2021 08:25:48 +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 1lKGdf-0005qx-T7 for pgsql-bugs@lists.postgresql.org; Thu, 11 Mar 2021 08:25:47 +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 1lKGdb-0003T2-DY for pgsql-bugs@lists.postgresql.org; Thu, 11 Mar 2021 08:25:46 +0000 Received: from hnk.local (p1439104-ipngn8101funabasi.chiba.ocn.ne.jp [180.0.143.104]) by oss.nttdata.com (Postfix) with ESMTPSA id 83EF2625DC; Thu, 11 Mar 2021 17:25:38 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table. To: tomohiro hiramitsu , Tom Lane Cc: Kyotaro Horiguchi , Kasahara Tatsuhito , Magnus Hagander , Andres Freund , skoposov@ed.ac.uk, PostgreSQL mailing lists References: <20210301.112452.1902584192027811521.horikyota.ntt@gmail.com> <666801.1614567656@sss.pgh.pa.us> From: Fujii Masao Message-ID: Date: Thu, 11 Mar 2021 17:25:38 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/03/11 14:10, tomohiro hiramitsu wrote: > > Perhaps we need a explanation about the logarithmic reduction of the > > frequency. It would be something like to avoid showing that message > > too often. (And I don't get what the "The query" points to..) > > I changed the patch comment. > > > Lately we've been using "%llu" or "%lld" for 64-bit values, and explicitly > > casting the argument to [unsigned] long long.  That seems to work > > everywhere now that we always use our own snprintf code, and it's less > > notationally painful than other ways. > > Thank you for your comment. > I modified the patch to use "% llu". > > > In addition, I thought the variable name was long, so I shortened it a little. > >  * v3-0001-GetNewOidWithIndex_log_output.patch + if (retry_count == next_notify && next_notify <= GETNEWOID_NOTIFY_LIMIT) + { + ereport(LOG, + (errmsg("failed to assign new OID in relation \"%s\" after \"%llu\" retries", + RelationGetRelationName(relation), (unsigned long long) retry_count))); + next_notify *= 2; /* double it for the next notification */ + } With the patch, if the number of retries exceeds GETNEWOID_NOTIFY_LIMIT, we stop logging notification messages. Why do we need to do that? This behavior may cause user to get confused? For example, they may think that OID has been successfully assigned because there are no notification messages in the log for a while. So isn't it better to log notification messages every GETNEWOID_NOTIFY_LIMIT after the number of retries exceeds that? Since users basically don't know the logic of GetNewOidWithIndex(), they cannot understand what "XXX retries" part in the message means? I have no good idea for the message. But what about something like the following? LOG: still finding an unused OID within relation \"%s\" DETAIL: \"%llu\" OID candidates were checked, but no unused OID is yet found. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION