From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: tomohiro hiramitsu <hiramit.tm@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Kasahara Tatsuhito <kasahara.tatsuhito@gmail.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Andres Freund <andres@anarazel.de>
Cc: skoposov@ed.ac.uk, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.
Date: Thu, 11 Mar 2021 17:25:38 +0900
Message-ID: <b1bf70bd-334c-afcf-8bca-db611e9e0ad9@oss.nttdata.com> (raw)
In-Reply-To: <CAOR2cEYyXx_oHiiAri7sHHqyEofWcfi9-fDoQMiNKYwvN_ZTmA@mail.gmail.com>
References: <CAP0=ZVLue4DBqV5cSD63JbXryV7+UKXdukfoLyEOpw+2EHRFCg@mail.gmail.com>
<CAP0=ZVKdHgLGvFJHE_6x2PTrw50_FLqPUSdRNzVTKSb_y8naCQ@mail.gmail.com>
<CAOR2cEb4Suwnk+rvC-Ea1BmOKXTg-nV--N9f+rRo4TEZztN7bg@mail.gmail.com>
<20210301.112452.1902584192027811521.horikyota.ntt@gmail.com>
<666801.1614567656@sss.pgh.pa.us>
<CAOR2cEYyXx_oHiiAri7sHHqyEofWcfi9-fDoQMiNKYwvN_ZTmA@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: masao.fujii@oss.nttdata.com, hiramit.tm@gmail.com, tgl@sss.pgh.pa.us, horikyota.ntt@gmail.com, kasahara.tatsuhito@gmail.com, magnus@hagander.net, andres@anarazel.de, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.
In-Reply-To: <b1bf70bd-334c-afcf-8bca-db611e9e0ad9@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox