postgresql/src/backend
Robert Haas caf1f675b8 Don't set ThisTimeLineID when there's no reason to do so.
In slotfuncs.c, pg_replication_slot_advance() needs to determine
the LSN up to which the slot should be advanced, but that doesn't
require us to update ThisTimeLineID, because none of the code called
from here depends on it. If the replication slot is logical,
pg_logical_replication_slot_advance will call read_local_xlog_page,
which does use ThisTimeLineID, but also takes care of making sure
it's up to date. If the replication slot is physical, the timeline
isn't used for anything at all.

In logicalfuncs.c, pg_logical_slot_get_changes_guts() has the same
issue: the only code we're going to run that cares about timelines
is in or downstream of read_local_xlog_page, which already makes
sure that the correct value gets set. Hence, don't do it here.

Patch by me, reviewed and tested by Michael Paquier, Amul Sul, and
Álvaro Herrera.

Discussion: https://postgr.es/m/CA+TgmobfAAqhfWa1kaFBBFvX+5CjM=7TE=n4r4Q1o2bjbGYBpA@mail.gmail.com
2021-11-05 12:43:04 -04:00
..
access Add hardening to catch invalid TIDs in indexes. 2021-11-04 19:54:05 -07:00
bootstrap Fix bogus assertion in BootstrapModeMain(). 2021-08-09 08:28:53 -07:00
catalog Avoid crash in rare case of concurrent DROP 2021-11-05 12:29:35 -03:00
commands Fix typos in comments 2021-10-27 22:38:38 +02:00
executor Fix variable lifespan in ExecInitCoerceToDomain(). 2021-11-02 13:36:47 -04:00
foreign Improve HINT message that FDW reports when there are no valid options. 2021-10-27 00:46:52 +09:00
jit Avoid some other O(N^2) hazards in list manipulation. 2021-11-01 16:24:39 -04:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Fix snapshot reference leak if lo_export fails. 2021-11-03 10:52:38 +02:00
main process startup: Split single user code out of PostgresMain(). 2021-09-17 19:56:47 -07:00
nodes Avoid O(N^2) behavior in SyncPostCheckpoint(). 2021-11-02 11:31:54 -04:00
optimizer Avoid O(N^2) behavior in SyncPostCheckpoint(). 2021-11-02 11:31:54 -04:00
parser Avoid O(N^2) behavior in SyncPostCheckpoint(). 2021-11-02 11:31:54 -04:00
partitioning Fix duplicate words in comments 2021-10-04 15:12:57 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Reject huge_pages=on if shared_memory_type=sysv. 2021-10-26 12:54:55 +13:00
postmaster Fix race condition in startup progress reporting. 2021-10-29 14:40:15 -04:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:31 -04:00
replication Don't set ThisTimeLineID when there's no reason to do so. 2021-11-05 12:43:04 -04:00
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:47 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
storage Fix snapshot reference leak if lo_export fails. 2021-11-03 10:52:38 +02:00
tcop Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
tsearch Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
utils Allow publishing the tables of schema. 2021-10-27 07:44:52 +05:30
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00