Commit Graph

3577 Commits (b8267b1fad6aaf3fc2b2616756699af0bf04f43c)

Author SHA1 Message Date
Burak Velioglu b8267b1fad
Merge branch 'master' into velioglu/function_propagation 2022-02-18 01:57:48 +03:00
Burak Velioglu b8e530862e
Add unsupported objects check 2022-02-18 01:44:40 +03:00
Teja Mupparti 46fa47beea Force-delegated functions' distribution argument must be reset as soon as the routine completes execution,
and not wait until the top level Executor ends. This fixes issue #5687
2022-02-17 10:48:30 -08:00
Burak Velioglu 236d1cd1ef
Merge branch 'master' into velioglu/function_propagation 2022-02-17 16:30:51 +03:00
Burak Velioglu 0bdb5d5ace
Address reviews 2022-02-17 16:16:20 +03:00
Nils Dijk 768b320470
reuse GetRoleSpecObjectForUser 2022-02-17 13:16:10 +01:00
Nils Dijk ea86f9f94e
Add support for TEXT SEARCH CONFIGURATION objects (#5685)
DESCRIPTION: Implement TEXT SEARCH CONFIGURATION propagation

The change adds support to Citus for propagating TEXT SEARCH CONFIGURATION objects. TSConfig objects cannot always be created in one create statement, and instead require a create statement followed by many alter statements to get turned into the object they should represent.

To support this we add functionality to the worker to create or replace objects based on a list of statements. When the lists of the local object and the remote object correspond 1:1 we skip the creation of the object and simply mark it distributed. This is especially important for TSConfig objects as initdb pre-populates databases with a dozen configurations (for many different languages).

When the user creates a new TSConfig based on the copy of an existing configuration there is no direct link to the object copied from. Since there is no link we can't simply rely on propagating the dependencies to the worker and send a qualified
2022-02-17 13:12:46 +01:00
Hanefi Onaldi ccc4cc6bf0
Move test in isolation schedule to prevent failure
We check for metadata consistency across the cluster in the test
isolation_metadata_sync_vs_all. However, some earlier tests in
enterprise repo leave invalid pg_dist_node entries in the worker nodes
that have Oid values for already dropped role objects.

To remedy that, I suggest that we move the test to earlier in the
schedule, thereby making the tests pass for the time being. We should
later introduce metadata checking either in a new isolation test or by
moving this test later in the schedule. However, we should do that after
we fix the underlying issue.
2022-02-17 13:15:21 +03:00
Ahmet Gedemenli a1c3580c64 Support TRUNCATE for foreign tables 2022-02-17 09:59:53 +03:00
Burak Velioglu 9275131730
Work on tests 2022-02-17 01:38:30 +03:00
Burak Velioglu 4ef18e8737
Address reviews 2022-02-16 15:32:59 +03:00
Burak Velioglu cfac2d7714
Fixing tests 2022-02-16 11:12:13 +03:00
Burak Velioglu 77afa90abd
Fixing tests 2022-02-16 02:02:55 +03:00
Burak Velioglu ac09198429
Address reviews 2022-02-16 01:53:16 +03:00
Burak Velioglu 25d4e9ad51
Readd debug messages 2022-02-16 01:34:36 +03:00
Burak Velioglu bd2072397a
Merge branch 'master' into velioglu/function_propagation 2022-02-16 00:09:06 +03:00
Burak Velioglu 24fe414eaa
Continue addressing reviews 2022-02-15 23:56:14 +03:00
Burak Velioglu c7b8c4db34
Add all object dependency check 2022-02-15 17:37:48 +03:00
Burak Velioglu 110aff95c8
Address reviews 2022-02-15 00:59:19 +03:00
Onder Kalaci abd5b1c506 Prevent any monitoring view/udf to show already exited backends
The low-level StoreAllActiveTransactions() function filters out
backends that exited.

Before this commit, if you run a pgbench, after that you'd still
see the backends show up:
```SQL
 select count(*) from get_global_active_transactions();
┌───────┐
│ count │
├───────┤
│   538 │
└───────┘
```

After this patch, only active backends show-up:

```SQL
 select count(*) from get_global_active_transactions();
┌───────┐
│ count │
├───────┤
│    72 │
└───────┘
```
2022-02-14 17:34:32 +01:00
Ahmet Gedemenli 0411a98c99
Refactor EnsureSequentialMode functions (#5704) 2022-02-14 18:38:21 +03:00
Gledis Zeneli badfd561b2
Prevent Citus table functions from being called on shards (Fix #5610) (#5694)
DESCRIPTION: Prevent Citus table functions from being called on shards

The operations that guard against using shards are:
* Create Local Table
* Create distributed table (which affects reference table creation as well).

* I used a `ErrorIfRaltionIsKnownShard` instead of `ErrorIfIllegallyChangingKnownShard`.
`ErrorIfIllegallyChangingKnownShard` allows the operation if `citus.enable_manual_changes_to_shards`,
but I am not sure if it ever makes sense to create a distributed, reference, or citus local table out of a shard.

I tried to go over the code to identify other UDF-s where shards could be illegaly changed, but I could not find any other.
My knowledge of the codebase is not solid enough for me to say for sure.

Fixes #5610
2022-02-14 16:06:48 +03:00
Burak Velioglu afe8ce50c3
Test disabling for upgrade 2022-02-14 15:13:36 +03:00
Burak Velioglu ca12d09b8c
Citus indent 2022-02-14 14:32:23 +03:00
Burak Velioglu c24a23b2f7
Fix citus owned test function 2022-02-14 14:28:47 +03:00
Burak Velioglu 38213e09ad
Add extension ownership check 2022-02-14 13:11:52 +03:00
Burak Velioglu b25a1c48e6
Revert it 2022-02-14 12:55:14 +03:00
Burak Velioglu 0557d67d78
Disable metadata sync for helper functions 2022-02-14 12:50:30 +03:00
Burak Velioglu 9574ebc988
Refactor 2022-02-14 12:18:24 +03:00
Burak Velioglu ad089f3dbb
Continue fixing tests 2022-02-14 11:32:29 +03:00
Burak Velioglu d7beb5a707
Add more tests 2022-02-14 00:57:20 +03:00
Burak Velioglu 9adef99248
Fix multi test 2022-02-14 00:32:37 +03:00
Burak Velioglu a829b7555b
Add function propagation tests 2022-02-14 00:18:42 +03:00
Burak Velioglu a58c15268b
Update function dep check 2022-02-13 17:17:46 +03:00
Burak Velioglu e249aa2d62
Merge branch 'master' into velioglu/function_propagation 2022-02-13 00:12:34 +03:00
Burak Velioglu 23aa73c988
Fix multi-1 tests 2022-02-12 23:40:20 +03:00
Hanefi Onaldi 2e5ca8ba2b
Add isolation tests for metadata sync vs all
This commit introduces several test cases for concurrent operations that
change metadata, and a concurrent metadata sync operation.

The overall structure is as follows:
- Session#1 starts metadata syncing in a transaction block
- Session#2 does an operation that change metadata
- Both sessions are committed
- Another session checks whether the metadata are the same accross all
  nodes in the cluster.
2022-02-11 01:55:04 +03:00
Önder Kalacı dc6c194916
Show IDLE backends in citus_dist_stat_activity (#5700)
* Break the dependency to CitusInitiatedBackend infrastructure

With this change, we start to show non-distributed backends as well
in citus_dist_stat_activity. I think that
  (a) it is essential for making citus_lock_waits to work for blocked
      on DDL commands.
  (b) it is more expected from the user's perspective. The name of
      the view is a little inconsistent now (e.g., citus_dist_stat_activity)
      but we are already planning to improve the names with followup
      PRs.

Also, we have global pids assigned, the CitusInitiatedBackend
becomes obsolete.
2022-02-10 08:59:28 -08:00
Burak Velioglu c78ca8cbad
Continue fixing multi tests 2022-02-10 16:59:08 +03:00
Ahmet Gedemenli 76b63a307b Propagate create/drop schema commands 2022-02-10 14:58:09 +03:00
Burak Velioglu cb4e53ad6e
Fix mx tests 2022-02-10 13:09:30 +03:00
Burak Velioglu 814e1a95de
Fix mx tests 2022-02-10 01:54:35 +03:00
Burak Velioglu 0cfe2375b6
Fix operation tests 2022-02-10 01:38:44 +03:00
Burak Velioglu 6de2d7f050
Fix check_multi tests 2022-02-10 01:20:42 +03:00
Burak Velioglu 8901936e9a
Check whether the function call is in transaction block 2022-02-10 00:04:51 +03:00
Marco Slot d0711ea9b4 Delegate function calls in FROM outside of transaction block 2022-02-09 20:56:25 +01:00
Burak Velioglu 5c74514600
Update tables type check 2022-02-09 18:10:47 +03:00
Burak Velioglu 9e938ba1a3
Style 2022-02-09 16:46:52 +03:00
Burak Velioglu 6770b222d5
Mark functions distributed if propagated to workers 2022-02-09 16:40:52 +03:00
Onder Kalaci 1c30f61a70 Prevent citus.node_conninfo to use "application_name"
With https://github.com/citusdata/citus/pull/5657, Citus uses
a fixed application_name while connecting to remote nodes
for internal purposes.

It means that we cannot allow users to override it via
citus.node_conninfo.
2022-02-09 13:22:04 +01:00