pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove useless code from CreateReplicationSlot.
Date: Mon, 25 Oct 2021 15:03:37 +0000
Message-ID: <E1mf1Vh-0000Mb-Uj@gemulon.postgresql.org> (raw)

Remove useless code from CreateReplicationSlot.

According to the comments, we initialize sendTimeLineIsHistoric
and sendTimeLine here for the benefit of WalSndSegmentOpen.
However, the only way that can happen is if logical_read_xlog_page
calls WALRead. And since logical_read_xlog_page initializes the
same global variables internally, we don't need to also do it here.

These initializations have been here since replication slots were
introduced in commit 858ec11858a914d4c380971985709b6d6b7dd6fc. They
were certainly useless at that time, too, because logical decoding
didn't yet exist then, and physical replication doesn't examine any
WAL at the time of slot creation. I haven't checked all the
intermediate versions, but I suspect there's no point at which
this code ever did anything useful.

To reduce future confusion, remove the code. Since there's no
functional defect, no back-patch.

Discussion: http://postgr.es/m/CA+TgmobSWzacEs+r6C-7DrOPDHoDar4i9gzxB3SCBr5qjnLmVQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/902a2c280012557b85c7e0fce3f6f0e355cb2d69

Modified Files
--------------
src/backend/replication/walsender.c | 4 ----
1 file changed, 4 deletions(-)



Message-ID: <E1mf1Vh-0000Mb-Uj@gemulon.postgresql.org>
Permalink:  ../E1mf1Vh-0000Mb-Uj@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mf1Vh-0000Mb-Uj@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: Remove useless code from CreateReplicationSlot.
  In-Reply-To: <E1mf1Vh-0000Mb-Uj@gemulon.postgresql.org>
  References: <E1mf1Vh-0000Mb-Uj@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox