Re: Remove a redundant condition check

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Remove a redundant condition check
Дата
Msg-id CAA4eK1K3SFVroDr-vsy60coQ9v0+34MA0rxsn6G2j_EJvpf30A@mail.gmail.com
обсуждение исходный текст
Ответ на Remove a redundant condition check  (Ádám Balogh <adam.balogh@ericsson.com>)
Ответы Re: Remove a redundant condition check  (Michael Paquier <michael@paquier.xyz>)
Re: Remove a redundant condition check  (Ranier Vilela <ranier.vf@gmail.com>)
RE: Remove a redundant condition check  (Ádám Balogh <adam.balogh@ericsson.com>)
Список pgsql-hackers
On Thu, Jun 25, 2020 at 11:23 PM Ádám Balogh <adam.balogh@ericsson.com> wrote:
>
>
> A one line change to remove a duplicate check. This duplicate check was detected during testing my contribution to a
staticcode analysis tool. There is no functional change, no new tests needed. 
>
>

Yeah, this duplicate check is added as part of commit b2a5545bd6.  See
below part of change.

- /*
- * If this record was a timeline switch, wake up any
- * walsenders to notice that we are on a new timeline.
- */
- if (switchedTLI && AllowCascadeReplication())
- WalSndWakeup();
+ /* Is this a timeline switch? */
+ if (switchedTLI)
+ {
+ /*
+ * Before we continue on the new timeline, clean up any
+ * (possibly bogus) future WAL segments on the old timeline.
+ */
+ RemoveNonParentXlogFiles(EndRecPtr, ThisTimeLineID);
+
+ /*
+ * Wake up any walsenders to notice that we are on a new
+ * timeline.
+ */
+ if (switchedTLI && AllowCascadeReplication())
+ WalSndWakeup();
+ }

It seems we forgot to remove the additional check for switchedTLI
while adding a new check.  I think we can remove this duplicate check
in the HEAD code.  I am not sure if it is worth to backpatch such a
change.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Resetting spilled txn statistics in pg_stat_replication
Следующее
От: Sébastien Lardière
Дата:
Сообщение: Re: PostgreSQL 13 Beta 1 Release Announcement Draft