citus/src/test/regress/citus_tests
aykut-bozkurt d14c4671b3 Fixes visibility problems with dependency propagation (#7028)
**Problem:**
Previously we always used an outside superuser connection to overcome
permission issues for the current user while propagating dependencies.
That has mainly 2 problems:
1. Visibility issues during dependency propagation, (metadata connection
propagates some objects like a schema, and outside transaction does not
see it and tries to create it again)
2. Security issues (it is preferrable to use current user's connection
instead of extension superuser)

**Solution (high level):**
Now, we try to make a smarter decision on whether should we use an
outside superuser connection or current user's metadata connection. We
prefer using current user's connection if any of the objects, which is
already propagated in the current transaction, is a dependency for a
target object. We do that since we assume if current user has
permissions to create the dependency, then it can most probably
propagate the target as well.

Our assumption is expected to hold most of the times but it can still be
wrong. In those cases, transaction would fail and user should set the
GUC `citus.create_object_propagation` to `deferred` to work around it.

**Solution:**
1. We track all objects propagated in the current transaction (we can
handle subtransactions),
2. We propagate dependencies via the current user's metadata connection
if any dependency is created in the current transaction to address
issues listed above. Otherwise, we still use an outside superuser
connection.


DESCRIPTION: Fixes some object propagation errors seen with transaction
blocks.

Fixes https://github.com/citusdata/citus/issues/6614

---------

Co-authored-by: Nils Dijk <nils@citusdata.com>
2023-11-13 13:28:54 -05:00
..
arbitrary_configs Call null-shard-key tables as single-shard distributed tables in code 2023-05-03 17:02:43 +03:00
query_generator Query Generator Seed (#6883) 2023-05-03 15:54:11 +03:00
test Improve the performance of CitusHasBeenLoaded function for a database that does not do CREATE EXTENSION citus but load citus.so. (#7123) 2023-11-13 13:28:54 -05:00
upgrade Support running Citus upgrade tests with run_test.py (#6832) 2023-05-23 14:38:54 +02:00
__init__.py Add an infrastructure to run same tests with arbitrary configs (#5316) 2021-10-12 14:24:19 +03:00
common.py Add some small improvements to python testing framework (#7159) 2023-11-13 13:28:54 -05:00
config.py Bump Citus version into 12.1devel (#7061) 2023-07-14 13:12:30 +03:00
print_test_names.py Increase parallelism 2021-10-19 15:38:58 +03:00
run_test.py Fixes visibility problems with dependency propagation (#7028) 2023-11-13 13:28:54 -05:00
utils.py Run python files through isort 2023-02-10 13:05:37 +01:00