postgresql/src/include/utils
Amit Kapila e7eea52b2d Fix Logical Replication of Truncate in synchronous commit mode.
The Truncate operation acquires an exclusive lock on the target relation
and indexes. It then waits for logical replication of the operation to
finish at commit. Now because we are acquiring the shared lock on the
target index to get index attributes in pgoutput while sending the
changes for the Truncate operation, it leads to a deadlock.

Actually, we don't need to acquire a lock on the target index as we build
the cache entry using a historic snapshot and all the later changes are
absorbed while decoding WAL. So, we wrote a special purpose function for
logical replication to get a bitmap of replica identity attribute numbers
where we get that information without locking the target index.

We decided not to backpatch this as there doesn't seem to be any field
complaint about this issue since it was introduced in commit 5dfd1e5a in
v11.

Reported-by: Haiying Tang
Author: Takamichi Osumi, test case by Li Japin
Reviewed-by: Amit Kapila, Ajin Cherian
Discussion: https://postgr.es/m/OS0PR01MB6113C2499C7DC70EE55ADB82FB759@OS0PR01MB6113.jpnprd01.prod.outlook.com
2021-04-27 08:28:26 +05:30
..
.gitignore Revert "Add gitignore entries for jsonpath_gram.h" 2019-03-23 00:19:34 +01:00
acl.h Fix has_column_privilege function corner case 2021-03-31 13:55:25 -04:00
aclchk_internal.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
array.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
arrayaccess.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
ascii.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
attoptcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
backend_progress.h Split backend status and progress related functionality out of pgstat.c. 2021-04-03 11:42:52 -07:00
backend_status.h adjust query id feature to use pg_stat_activity.query_id 2021-04-20 12:22:26 -04:00
builtins.h Rework refactoring of hex and encoding routines 2021-01-14 11:13:24 +09:00
bytea.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
cash.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
catcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
combocid.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
date.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
datetime.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
datum.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
dsa.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
dynahash.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
elog.h Add macro PGWARNING, and make PGERROR available on all platforms. 2021-04-11 13:22:56 -04:00
evtcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
expandeddatum.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
expandedrecord.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
float.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
fmgrtab.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
formatting.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
freepage.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geo_decls.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
guc.h Fix typos and grammar in documentation and code comments 2021-04-09 13:53:07 +09:00
guc_tables.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
help_config.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
hsearch.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
index_selfuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
inet.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
int8.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
inval.h Replace CLOBBER_CACHE_ALWAYS with run-time GUC 2021-01-06 10:46:44 +01:00
json.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonb.h Implementation of subscripting for jsonb 2021-01-31 23:50:40 +03:00
jsonfuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
jsonpath.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
logtape.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
lsyscache.h Preserve pg_attribute.attstattarget across REINDEX CONCURRENTLY 2021-02-10 13:06:48 +09:00
memdebug.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
memutils.h Add function to log the memory contexts of specified backend process. 2021-04-06 13:44:15 +09:00
multirangetypes.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
numeric.h Change return type of EXTRACT to numeric 2021-04-06 07:20:42 +02:00
old_snapshot.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
palloc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
partcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_crc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_locale.h Hide internal error for pg_collation_actual_version(<bad OID>). 2021-02-22 23:01:20 +13:00
pg_lsn.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_rusage.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pidfile.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
plancache.h Improve performance of repeated CALLs within plpgsql procedures. 2021-01-25 22:28:29 -05:00
portal.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
ps_status.h Refactor ps_status.c API 2020-03-11 16:38:31 +01:00
queryenvironment.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
queryjumble.h Move pg_stat_statements query jumbling to core. 2021-04-07 13:06:56 -04:00
rangetypes.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
regproc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
rel.h Allow TRUNCATE command to truncate foreign tables. 2021-04-08 20:56:08 +09:00
relcache.h Fix Logical Replication of Truncate in synchronous commit mode. 2021-04-27 08:28:26 +05:30
relfilenodemap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
relmapper.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
relptr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
reltrigger.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
resowner.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
resowner_private.h Refactor HMAC implementations 2021-04-03 17:30:49 +09:00
rls.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
ruleutils.h Extended statistics on expressions 2021-03-27 00:01:11 +01:00
sampling.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
selfuncs.h Allow estimate_num_groups() to pass back further details about the estimation 2021-03-30 20:52:46 +13:00
sharedtuplestore.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
snapmgr.h ALTER TABLE ... DETACH PARTITION ... CONCURRENTLY 2021-03-25 18:00:28 -03:00
snapshot.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
sortsupport.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
spccache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
syscache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
timeout.h Detect POLLHUP/POLLRDHUP while running queries. 2021-04-03 09:02:41 +13:00
timestamp.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tuplesort.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tuplestore.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
typcache.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tzparser.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
uuid.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
varbit.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
varlena.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
wait_event.h Add functions to wait for backend termination 2021-04-08 11:40:54 +02:00
xid8.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
xml.h Update copyright for 2021 2021-01-02 13:06:25 -05:00