Re: BUG #16722: PG hanging on COPY when table has close to 2^32 toasts in the table.
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: hiramit.tm@gmail.com
Cc: kasahara.tatsuhito@gmail.com, magnus@hagander.net, andres@anarazel.de,
masao.fujii@oss.nttdata.com, skoposov@ed.ac.uk,
pgsql-bugs@lists.postgresql.org
Date: 2021-03-01T02:24:52Z
Lists: pgsql-bugs
At Mon, 1 Mar 2021 10:56:50 +0900, tomohiro hiramitsu <hiramit.tm@gmail.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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Log when GetNewOidWithIndex() fails to find unused OID many times.
- 7fbcee1b2d5f 14.0 landed
-
Add tests for bytea LIKE operator
- eb42110d952f 14.0 cited