pgsql: Remove useless code from CreateReplicationSlot.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: Remove useless code from CreateReplicationSlot.
Дата
Msg-id E1mf1Vh-0000Mb-Uj@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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(-)


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: StartupXLOG: Don't repeatedly disable/enable local xlog insertio
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Add enable_timeout_every() to fire the same timeout repeatedly.