pg_basebackup against older server versions

Started by Devrim GÜNDÜZabout 7 years ago7 messageshackers
Jump to latest
#1Devrim GÜNDÜZ
devrim@gunduz.org

Hi,

Apologies if this has been discussed before: When I run pg_basebackup in git
head against v11 server, it treats v11 as v12: Does not create recovery.conf,
adds recovery parameters to postgresql.auto.conf, and also creates
standby.signal file. Is this expected, or a bug?

Regards,
--
Devrim Gündüz
Open Source Solution Architect, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

#2Michael Paquier
michael@paquier.xyz
In reply to: Devrim GÜNDÜZ (#1)
Re: pg_basebackup against older server versions

On Wed, Mar 06, 2019 at 11:55:12AM +0300, Devrim Gündüz wrote:

Apologies if this has been discussed before: When I run pg_basebackup in git
head against v11 server, it treats v11 as v12: Does not create recovery.conf,
adds recovery parameters to postgresql.auto.conf, and also creates
standby.signal file. Is this expected, or a bug?

You are right, this is a bug. Compatibility with past server versions
should be preserved, and we made an effort to do so in the past (see
the switch to pg_wal/ for example). Fortunately, maintaining the
compatibility is simple enough as the connection information is close
by so that we just need to change postgresql.auto.conf to
recovery.conf, and avoid the creation of standby.signal.
--
Michael

In reply to: Michael Paquier (#2)
Re: pg_basebackup against older server versions

Hello

My fault. I thought pg_basebackup works only with same major version, sorry.
How about attached patch?

regards, Sergei

Attachments:

fix_pg_basebackup_against_older_server_versions.patchtext/x-diff; name=fix_pg_basebackup_against_older_server_versions.patchDownload+58-22
#4Michael Paquier
michael@paquier.xyz
In reply to: Sergei Kornilov (#3)
Re: pg_basebackup against older server versions

On Wed, Mar 06, 2019 at 01:42:16PM +0300, Sergei Kornilov wrote:

My fault. I thought pg_basebackup works only with same major version, sorry.
How about attached patch?

No problem. Thanks for the patch, the logic looks good and I made
some adjustments as attached. Does that look fine to you?
--
Michael

Attachments:

fix_pg_basebackup_against_older_server_versions_2.patchtext/x-diff; charset=us-asciiDownload+85-27
In reply to: Michael Paquier (#4)
Re: pg_basebackup against older server versions

Hi

No problem. Thanks for the patch, the logic looks good and I made
some adjustments as attached. Does that look fine to you?

Looks fine, thanks. I tested against HEAD and v11.2 with and without -R in both plain and tar formats.

regards, Sergei

#6Michael Paquier
michael@paquier.xyz
In reply to: Sergei Kornilov (#5)
Re: pg_basebackup against older server versions

On Thu, Mar 07, 2019 at 10:57:46AM +0300, Sergei Kornilov wrote:

Looks fine, thanks. I tested against HEAD and v11.2 with and without
-R in both plain and tar formats.

Same here, so I have committed the patch.
--
Michael

In reply to: Michael Paquier (#6)
Re: pg_basebackup against older server versions

<br />Hi<div>Great, thank you! </div><div><br /></div><div>regards, Sergei</div>