Re: prevent immature WAL streaming

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, masao(dot)fujii(at)oss(dot)nttdata(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, bossartn(at)amazon(dot)com, mengjuan(dot)cmj(at)alibaba-inc(dot)com, Jakub(dot)Wartak(at)tomtom(dot)com
Subject: Re: prevent immature WAL streaming
Date: 2021-09-04 17:26:24
Message-ID: 202109041726.dbkb6dmr526e@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-Sep-03, Andres Freund wrote:

> > +#ifdef WAL_DEBUG
> > + ereport(LOG,
> > + (errmsg_internal("recovery overwriting broken contrecord at %X/%X (EndRecPtr: %X/%X)",
> > + LSN_FORMAT_ARGS(abortedContrecordPtr),
> > + LSN_FORMAT_ARGS(EndRecPtr))));
> > +#endif
>
> "broken" sounds a bit off. But then, it's just WAL_DEBUG. Which made me
> realize, isn't this missing a
> if (XLOG_DEBUG)?

Attached are the same patches as last night, except I added a test for
XLOG_DEBUG where pertinent. (The elog(PANIC) is not made conditional on
that, since it's a cross-check rather than informative.) Also fixed the
silly pg_rewind mistake I made.

I'll work on the new xlog record early next week.

--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/
"I can see support will not be a problem. 10 out of 10." (Simon Wittber)
(http://archives.postgresql.org/pgsql-general/2004-12/msg00159.php)

Attachment Content-Type Size
v4-0001-Implement-FIRST_IS_ABORTED_CONTRECORD.patch text/x-diff 8.8 KB
v4-0002-crosscheck-that-FIRST_IS_CONTRECORD-is-not-togeth.patch text/x-diff 1.5 KB
v4-0003-debugging-changes.patch text/x-diff 1.7 KB
v4-0004-upgrade-assert-to-if-in-pg_rewind.patch text/x-diff 981 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-09-04 17:29:18 Re: [PATCH] Add tab-complete for backslash commands
Previous Message Tom Lane 2021-09-04 16:42:08 Re: [PATCH] Add tab-complete for backslash commands