RE: [PoC] pg_upgrade: allow to upgrade publisher node

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Amit Kapila' <amit(dot)kapila16(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: RE: [PoC] pg_upgrade: allow to upgrade publisher node
Date: 2023-09-20 05:30:11
Message-ID: TYAPR01MB5866333DC24EA26957CC6C18F5F9A@TYAPR01MB5866.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear Amit,

Thank you for reviewing! PSA new version. In this version I ran pgindent again.

> +#include "access/xlogdefs.h"
> #include "common/relpath.h"
> #include "libpq-fe.h"
>
> The above include is not required. I have removed that and made a few
> cosmetic changes in the attached.

Yes, it is not needed anymore. Firstly it was introduced to use the datatype
XLogRecPtr, but removed in recent version.

Moreover, I my colleague Hou found several problems for v40. Here is a fixed
version. Below bullets are the found issues.

* Fixed to allow XLOG_SWICH when reading the record, including the initial one.
The XLOG_SWICH may inserted after walsender exits. This is occurred when
archive_mode is set to on (or always).
* Fixed to set max_slot_wal_keep_size -1 only when the cluster is PG17+.
max_slot_wal_keep_size was introduced in PG13, so previous patch could not
upgrade from PG12 and prior.
The setting is only needed to upgrade logical slots, so it should be set only
when in PG17 and later.
* Avoid to call binary_upgrade_validate_wal_records() when the slot is invalidated.
The function raises an ERROR if the record corresponds to the given LSN.
The output is like:

```
ERROR: requested WAL segment pg_wal/000000010000000000000001 has already been removed
```

It is usual behavior but we do not want to error out here, so it was avoided.
The upgrading would fail correctly if there are invalid slots.

Best Regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
v41-0001-pg_upgrade-Allow-to-replicate-logical-replicatio.patch application/octet-stream 51.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lepikhov Andrei 2023-09-20 05:39:13 Re: RFC: Logging plan of the running query
Previous Message Kyotaro Horiguchi 2023-09-20 05:18:41 Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows