citus/src/backend/distributed/sql
Halil Ozan Akgül b877d606c7
Adds 2PC distributed commands from other databases (#7203)
DESCRIPTION: Adds support for 2PC from non-Citus main databases

This PR only adds support for `CREATE USER` queries, other queries need
to be added. But it should be simple because this PR creates the
underlying structure.

Citus main database is the database where the Citus extension is
created. A non-main database is all the other databases that are in the
same node with a Citus main database.

When a `CREATE USER` query is run on a non-main database we:

1. Run `start_management_transaction` on the main database. This
function saves the outer transaction's xid (the non-main database
query's transaction id) and marks the current query as main db command.
2. Run `execute_command_on_remote_nodes_as_user("CREATE USER
<username>", <username to run the command>)` on the main database. This
function creates the users in the rest of the cluster by running the
query on the other nodes. The user on the current node is created by the
query on the outer, non-main db, query to make sure consequent commands
in the same transaction can see this user.
3. Run `mark_object_distributed` on the main database. This function
adds the user to `pg_dist_object` in all of the nodes, including the
current one.

This PR also implements transaction recovery for the queries from
non-main databases.
2023-12-22 19:19:41 +03:00
..
datatypes/citus_cluster_clock This implements a new UDF citus_get_cluster_clock() that returns a monotonically 2022-10-28 10:15:08 -07:00
downgrades Adds 2PC distributed commands from other databases (#7203) 2023-12-22 19:19:41 +03:00
udfs Adds 2PC distributed commands from other databases (#7203) 2023-12-22 19:19:41 +03:00
citus--8.0-1--8.0-2.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-1.sql Introduce a citus_finish_citus_upgrade() function 2022-06-13 13:15:15 +02:00
citus--8.0-2--8.0-3.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-3--8.0-4.sql Switch to using LOCK instead of lock_relation_if_exists in TRUNCATE (#5930) 2022-05-11 18:38:48 +03:00
citus--8.0-4--8.0-5.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-5--8.0-6.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-6--8.0-7.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-7--8.0-8.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-8--8.0-9.sql Remove citus.worker_list_file & master_initialize_node_metadata 2019-11-13 00:49:58 +00:00
citus--8.0-9--8.0-10.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-10--8.0-11.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-11--8.0-12.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-12--8.0-13.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.0-13--8.1-1.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.1-1--8.2-1.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.2-1--8.2-2.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.2-2--8.2-3.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.2-3--8.2-4.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.2-4--8.3-1.sql Strip trailing whitespace and add final newline (#3186) 2019-11-21 14:25:37 +01:00
citus--8.3-1--9.0-1.sql Add support for TEXT SEARCH CONFIGURATION objects (#5685) 2022-02-17 13:12:46 +01:00
citus--9.0-1--9.0-2.sql Revoke usage from the citus schema 2019-10-23 00:08:17 +02:00
citus--9.0-2--9.1-1.sql Add adaptive executor support for repartition joins (#3169) 2019-12-17 19:09:45 +03:00
citus--9.1-1--9.2-1.sql Implement partitioned intermediate results. 2019-12-24 03:53:39 -08:00
citus--9.2-1--9.2-2.sql Use current user for repartition join temp schemas. 2020-02-04 09:48:20 -08:00
citus--9.2-2--9.2-4.sql Disallow C-style comments in migration files 2020-06-22 12:51:16 +03:00
citus--9.2-4--9.3-2.sql Disallow C-style comments in migration files 2020-06-22 12:51:16 +03:00
citus--9.3-1--9.2-4.sql Disallow C-style comments in migration files 2020-06-22 12:51:16 +03:00
citus--9.3-2--9.4-1.sql Implement EXPLAIN ANALYZE udfs. 2020-06-09 10:02:05 -07:00
citus--9.4-1--9.4-2.sql Fix PG upgrade scripts for 9.4 2021-07-05 13:39:28 +02:00
citus--9.4-1--9.5-1.sql create 9.5-1 udfs and update citus--9.4-1--9.5-1.sql 2020-10-15 13:50:36 +02:00
citus--9.4-2--9.4-1.sql Fix PG upgrade scripts for 9.4 2021-07-05 13:39:28 +02:00
citus--9.4-2--9.4-3.sql Fix master_update_table_statistics scripts for 9.4 2021-08-03 18:15:56 +03:00
citus--9.4-3--9.4-2.sql Fix master_update_table_statistics scripts for 9.4 2021-08-03 18:15:56 +03:00
citus--9.5-1--9.5-2.sql Fix PG upgrade scripts for 9.5 2021-07-05 13:39:35 +02:00
citus--9.5-1--10.0-4.sql Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus--9.5-2--9.5-1.sql Fix PG upgrade scripts for 9.5 2021-07-05 13:39:35 +02:00
citus--9.5-2--9.5-3.sql Fix master_update_table_statistics scripts for 9.5 2021-08-03 18:15:56 +03:00
citus--9.5-3--9.5-2.sql Fix master_update_table_statistics scripts for 9.5 2021-08-03 18:15:56 +03:00
citus--10.0-1--10.0-2.sql Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus--10.0-2--10.0-3.sql Add udf citus_get_active_worker_nodes 2021-03-17 13:15:59 +03:00
citus--10.0-3--10.0-4.sql Remove public schema dependency for 10.0 upgrades 2021-07-09 02:08:22 +03:00
citus--10.0-4--10.1-1.sql Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus--10.1-1--10.2-1.sql Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus--10.2-1--10.2-2.sql Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus--10.2-2--10.2-3.sql Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus--10.2-3--10.2-4.sql Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus--10.2-4--10.2-5.sql Fix upgrade paths for #6100 (#6176) 2022-08-17 18:56:53 +03:00
citus--10.2-5--10.2-4.sql Fix upgrade paths for #6100 (#6176) 2022-08-17 18:56:53 +03:00
citus--10.2-5--11.0-1.sql Fix upgrade paths for #6100 (#6176) 2022-08-17 18:56:53 +03:00
citus--11.0-1--11.0-2.sql Introduce a citus_finish_citus_upgrade() function 2022-06-13 13:15:15 +02:00
citus--11.0-2--11.0-3.sql Fixes a bug that prevents upgrades when there are no worker nodes 2022-06-28 15:54:49 +02:00
citus--11.0-3--11.0-4.sql Fix pg upgrade script for foreign tables (#6100) 2022-08-05 13:35:17 +03:00
citus--11.0-4--11.0-3.sql Fix upgrade paths for #6100 (#6176) 2022-08-17 18:56:53 +03:00
citus--11.0-4--11.1-1.sql Drop worker_fetch_foreign_file/worker_repartition_cleanup only if they exist when upgrading Citus (#6441) 2022-10-21 14:32:42 +03:00
citus--11.1-1--11.2-1.sql Remove shardstate from placement insert functions (#6615) 2023-01-18 09:52:38 +01:00
citus--11.2-1--11.2-2.sql Add upgrade/downgrade paths between v11.2.2 and v11.3.1 (#6820) 2023-04-06 12:46:09 +03:00
citus--11.2-2--11.3-1.sql Adds control for background task executors involving a node (#6771) 2023-04-06 14:12:39 +03:00
citus--11.3-1--11.3-2.sql Move SQL file changes for citus_shard_sizes fixes into the new 11.3-2 version (#7050) 2023-07-14 17:19:54 +03:00
citus--11.3-2--12.0-1.sql Move SQL file changes for citus_shard_sizes fixes into the new 11.3-2 version (#7050) 2023-07-14 17:19:54 +03:00
citus--12.0-1--12.1-1.sql Add citus_schema_move() function (#7180) 2023-09-08 12:03:53 +03:00
citus--12.1-1--12.2-1.sql Adds 2PC distributed commands from other databases (#7203) 2023-12-22 19:19:41 +03:00