Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: hiramit(dot)tm(at)gmail(dot)com
Cc: kasahara(dot)tatsuhito(at)gmail(dot)com, magnus(at)hagander(dot)net, andres(at)anarazel(dot)de, masao(dot)fujii(at)oss(dot)nttdata(dot)com, skoposov(at)ed(dot)ac(dot)uk, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.
Date: 2021-03-01 02:24:52
Message-ID: 20210301.112452.1902584192027811521.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

At Mon, 1 Mar 2021 10:56:50 +0900, tomohiro hiramitsu <hiramit(dot)tm(at)gmail(dot)com> wrote in
> Hi,
>
> On Wed, Jan 6, 2021 at 11:13 AM Kasahara Tatsuhito
> <kasahara(dot)tatsuhito(at)gmail(dot)com> wrote:
>
> > Here are some comments about the code.
> >
> > +#define GETNEWOID_NOTIFICATION_INTERVAL_FACTOR 1000000
> >
> > It seems to be more of a minimum value for conflict detection rather
> > than an interval factor.
> > So, it would be better to use another name, such as
> > GETNEWOID_NOTIFICATION_MINVAL or others.
> >
> > + /* retry count and notification limit check */
> > + if (retry_count == next_notify && next_notify <=
> > GETNEWOID_NOTIFICATION_LIMIT)
> > + {
> > + ereport(LOG,
> > + (errmsg("failed to assign new OID in relation \"%s\"
> > after "UINT64_FORMAT" retries",
> > + RelationGetRelationName(relation), retry_count)));
> > + next_notify *= 2; /* double it for the next notification */
> > + }
> > + retry_count++;
> >
> > I think that we should add more comments about why output this LOG
> message.
>
> Thank you for your comment.
> I reflected your comment in the patch.
>
> * v2-0001-GetNewOidWithIndex_log_output.patch

+ * The query waits until the OID generation is successful.
+ * If the number of retries for OID generation is large,
+ * the number of retries will be notified.
+ */

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..)

+ ereport(LOG,
+ (errmsg("failed to assign new OID in relation \"%s\" after "UINT64_FORMAT" retries",

The embedded UINT64_FORMAT makes the message untranslatable on some
platforms. (Note that errmsg() is used for user-facing messages and
the message format string has translations.) The format string should
be handled separately from the message body. You will find an example
in WalReceiverMain().

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-03-01 03:00:56 Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.
Previous Message tomohiro hiramitsu 2021-03-01 01:56:50 Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.