postgresql/src/backend
Robert Haas e997a0c642 Remove all use of ThisTimeLineID global variable outside of xlog.c
All such code deals with this global variable in one of three ways.
Sometimes the same functions use it in more than one of these ways
at the same time.

First, sometimes it's an implicit argument to one or more functions
being called in xlog.c or elsewhere, and must be set to the
appropriate value before calling those functions lest they
misbehave. In those cases, it is now passed as an explicit argument
instead.

Second, sometimes it's used to obtain the current timeline after
the end of recovery, i.e. the timeline to which WAL is being
written and flushed. Such code now calls GetWALInsertionTimeLine()
or relies on the new out parameter added to GetFlushRecPtr().

Third, sometimes it's used during recovery to store the current
replay timeline. That can change, so such code must generally
update the value before each use. It can still do that, but must
now use a local variable instead.

The net effect of these changes is to reduce by a fair amount the
amount of code that is directly accessing this global variable.
That's good, because history has shown that we don't always think
clearly about which timeline ID it's supposed to contain at any
given point in time, or indeed, whether it has been or needs to
be initialized at any given point in the code.

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:50:01 -04:00
..
access Remove all use of ThisTimeLineID global variable outside of xlog.c 2021-11-05 12:50:01 -04: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 Remove all use of ThisTimeLineID global variable outside of xlog.c 2021-11-05 12:50:01 -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
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