citus/src/backend/distributed/utils
SaitTalhaNisanci e7cd1ed0ee
Not take ShareUpdateExlusiveLock on pg_dist_transaction (#4184)
* Not take ShareUpdateExlusiveLock on pg_dist_transaction

We were taking ShareUpdateExlusiveLock on pg_dist_transaction during
recovery to prevent multiple recoveries happening concurrenly. VACUUM(
not FULL) also takes ShareUpdateExclusiveLock, and they can conflict. It
seems that VACUUM will skip the table if there is a conflicting lock
already taken unless it is doing the vacuum to prevent id wraparound, in
which case there can be a deadlock. I guess the deadlock happens if:

- VACUUM takes a lock on pg_dist_transaction and is done for id
wraparound problem
- The transaction in the maintenance tries to take a lock but
cannot as that conflicts with the lock acquired by VACUUM
- The transaction in the maintenance daemon has a very old xid hence
VACUUM cannot proceed.

If we take a row exclusive lock in transaction recovery then it wouldn't
conflict with VACUUM hence it could proceed so the deadlock would be
resolved. To prevent concurrent transaction recoveries happening, an
advisory lock is taken with ShareUpdateExlusiveLock as before.

* Use CITUS_OPERATIONS tag
2020-09-21 15:20:38 +03:00
..
acquire_lock.c Convert unsafe APIs to safe ones 2020-02-25 15:39:27 +01:00
aggregate_utils.c Distribute custom aggregates with multiple arguments (#4047) 2020-07-24 15:16:00 -07:00
cancel_utils.c add IsHoldOffCancellationReceived utility function (#3290) 2019-12-12 17:32:59 +03:00
citus_clauses.c Rename FindNodeCheckXXX functions (#4106) 2020-08-11 15:01:23 +03:00
citus_copyfuncs.c Remove flag from 2020-07-20 12:45:05 +02:00
citus_nodefuncs.c Remove task tracker executor (#3850) 2020-07-18 13:11:36 +03:00
citus_outfuncs.c Remove flag from 2020-07-20 12:45:05 +02:00
citus_readfuncs.c Remove READFUNCs (#3536) 2020-02-24 12:43:28 +01:00
citus_safe_lib.c use macros for pg versions instead of hardcoded values (#3694) 2020-04-01 17:01:52 +03:00
citus_version.c add gitref to the output of citus_version (#3246) 2019-11-29 15:54:09 +01:00
colocation_utils.c Extend citus local table utility command support 2020-09-09 11:50:55 +03:00
distribution_column.c Semmle: Check for NULL in some places where it might occur (#3509) 2020-02-27 10:45:29 +01:00
enable_ssl.c Remove unused variable (#4172) 2020-09-18 11:25:07 +03:00
errormessage.c add IsLoggableLevel utility function (#3149) 2019-11-15 14:59:13 +03:00
foreign_key_relationship.c adapt recently added code for pg13 2020-08-04 15:18:27 +03:00
function_utils.c Automatically convert useless declarations using regex replace (#3181) 2019-11-21 13:47:29 +01:00
hash_helpers.c Add shouldhaveshards to pg_dist_node (#2960) 2019-10-22 16:47:16 +02:00
listutils.c Extend citus local table utility command support 2020-09-09 11:50:55 +03:00
log_utils.c Make ApplyLogRedaction a macro and redefine ereport 2020-01-13 18:24:36 +01:00
maintenanced.c adapt recently added code for pg13 2020-08-04 15:18:27 +03:00
multi_partitioning_utils.c Use table_openXXX methods in the codebase 2020-08-04 15:10:22 +03:00
namespace_utils.c Extend citus local table utility command support 2020-09-09 11:50:55 +03:00
pg11_snprintf.c use macros for pg versions instead of hardcoded values (#3694) 2020-04-01 17:01:52 +03:00
query_utils.c Include all relevant relations in the ExtractRangeTableRelationWalker (#3135) 2019-11-01 16:06:58 +01:00
reference_table_utils.c Refactor the functions that return OID lists for citus tables 2020-09-18 16:42:46 +03:00
resource_lock.c Not take ShareUpdateExlusiveLock on pg_dist_transaction (#4184) 2020-09-21 15:20:38 +03:00
role.c Refactor alter role to work on distributed roles (#3739) 2020-04-16 12:23:27 +02:00
shard_utils.c Extend citus local table utility command support 2020-09-09 11:50:55 +03:00
shardinterval_utils.c Adapt other cache entry changes for citus local tables 2020-09-09 11:50:55 +03:00
statistics_collection.c Refactor the functions that return OID lists for citus tables 2020-09-18 16:42:46 +03:00
task_execution_utils.c Change utils/hashutils.h to common/hashfn.h for PG >= 13 2020-08-04 15:10:22 +03:00
tuplestore.c Remove copyright years (#2918) 2019-10-15 17:44:30 +03:00