postgresql/src/include
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 process startup: Remove bootstrap / checker modes from AuxProcType. 2021-08-05 12:18:15 -07:00
catalog Grant memory views to pg_read_all_stats. 2021-10-27 14:06:30 -07:00
commands Don't overlook indexes during parallel VACUUM. 2021-11-02 12:06:17 -07:00
common Update Unicode data to Unicode 14.0.0 2021-09-15 08:16:44 +02:00
datatype Update copyright for 2021 2021-01-02 13:06:25 -05:00
executor Fix checking of query type in plpgsql's RETURN QUERY command. 2021-10-03 13:21:20 -04:00
fe_utils Unify parsing logic for command-line integer options 2021-07-24 18:35:03 +09:00
foreign Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
jit jit: Do not try to shut down LLVM state in case of LLVM triggered errors. 2021-09-13 18:26:15 -07:00
lib Fix frontend version of sh_error() in simplehash.h. 2021-10-22 16:43:38 -04:00
libpq Refactor SASL code with a generic interface for its mechanisms 2021-07-07 10:55:15 +09:00
mb Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
nodes Avoid O(N^2) behavior in SyncPostCheckpoint(). 2021-11-02 11:31:54 -04:00
optimizer Change the name of the Result Cache node to Memoize 2021-07-14 12:43:58 +12:00
parser Remove Value node struct 2021-09-09 08:36:53 +02:00
partitioning Ensure interleaved_parts field is always initialized 2021-10-01 15:09:49 +13:00
port windows: Define WIN32_LEAN_AND_MEAN to make compilation faster. 2021-10-04 13:16:12 -07:00
portability Fix another portability bug in recent pgbench commit. 2021-03-10 23:20:41 +13:00
postmaster Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00
regex Avoid determining regexp subexpression matches, when possible. 2021-08-09 11:26:34 -04:00
replication Introduce 'bbsink' abstraction to modularize base backup code. 2021-11-05 10:08:30 -04:00
rewrite Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Extended statistics on expressions 2021-03-27 00:01:11 +01:00
storage Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. 2021-10-23 18:36:38 -07:00
tcop process startup: Split single user code out of PostgresMain(). 2021-09-17 19:56:47 -07:00
tsearch Don't leak compiled regex(es) when an ispell cache entry is dropped. 2021-03-18 22:22:47 -04:00
utils Allow publishing the tables of schema. 2021-10-27 07:44:52 +05:30
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
Makefile Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
c.h Work around issues in MinGW-64's setjmp/longjmp support. 2021-03-15 12:34:17 -04:00
fmgr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
funcapi.h Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
getaddrinfo.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
getopt_long.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
miscadmin.h Doc: add glossary term for "auxiliary process" 2021-09-20 12:22:02 -03:00
pg_config.h.in Portability fixes for sigwait. 2021-07-15 12:34:31 +12:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Rename debug_invalidate_system_caches_always to debug_discard_caches. 2021-07-13 15:01:01 -04:00
pg_getopt.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_trace.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pgstat.h pgstat: Prepare to use mechanism for truncated rels also for droppped rels. 2021-09-20 14:02:48 -07:00
pgtar.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pgtime.h Fix actively-misleading comments about the contents of struct pg_tm. 2021-09-06 11:43:44 -04:00
port.h Treat ETIMEDOUT as indicating a non-recoverable connection failure. 2021-09-30 14:16:08 -04:00
postgres.h Fix misleading comments about TOAST access macros. 2021-09-08 14:11:35 -04:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
rusagestub.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
windowapi.h Update copyright for 2021 2021-01-02 13:06:25 -05:00