Commit Graph

5643 Commits (b8eedcd261fd62a07b9ee36fb0f742c1f0f7d13e)

Author SHA1 Message Date
Ahmet Gedemenli b8eedcd261
Notice when create_distributed_function called without params (#5752)
* Notice when create_distributed_function called without params

* Move variable comments to top

* Add valid check for cache entry

* add objtype to notice msg

* update test outputs

* Add more tests

* Address feedback
2022-03-04 17:26:39 +03:00
Önder Kalacı 28443aee0c
Merge pull request #5755 from citusdata/calculate_gpid
Introduce citus_calculate_gpid and citus_backend_gpid
2022-03-04 11:46:36 +01:00
Önder Kalacı bd6a6563ff
Merge branch 'master' into calculate_gpid 2022-03-04 11:34:12 +01:00
Burak Velioglu 341c3ee90a
Merge pull request #5728 from citusdata/velioglu/citus_table_check_relation
Prevent creation of Citus tables if any of the dependencies cannot be distributed
2022-03-03 20:37:26 +03:00
Burak Velioglu cb6d67a9a9
Make sure that all dependencies of citus tables can be distributed 2022-03-03 20:08:09 +03:00
Onder Kalaci c7b67ba0ea Add citus_backend_gpid()
And also citus_calculate_gpid(nodeId,pid). These UDFs are just
wrappers for the existing functions. Useful for testing and simple
manipulation of citus_stat_activity.
2022-03-03 15:29:40 +01:00
Halil Ozan Akgül 90974fdc8f
Merge pull request #5731 from citusdata/citus_stat_activity
Introduces citus_stat_activity view
2022-03-03 17:05:35 +03:00
Halil Ozan Akgul 06a0509b1a Introduces citus_stat_activity view 2022-03-03 16:19:20 +03:00
Marco Slot ab614194fd
Merge pull request #5742 from citusdata/marcocitus/colocation 2022-03-03 13:11:16 +01:00
Marco Slot ddf7cf29f3 Sync pg_dist_colocation as a batch 2022-03-03 12:48:48 +01:00
Marco Slot 3ba61244b8 Synchronize pg_dist_colocation metadata 2022-03-03 11:01:59 +01:00
Marco Slot f7d3405148
Merge pull request #5698 from citusdata/marcocitus/internal-reserved-connections 2022-03-03 10:33:06 +01:00
Marco Slot 43e4dd3808 Add a citus.internal_reserved_connections setting 2022-03-02 19:13:53 +01:00
Önder Kalacı 2f0c346c8a
Merge pull request #5748 from citusdata/improve_visibility_of_citus_stats
Improve visibility rules for non-priviledge roles on citus_stat_activity
2022-03-02 18:11:35 +01:00
Onder Kalaci e80a36c4b6 Improve visibility rules for non-priviledge roles
It seems like our approach is way too restrictive and some places
are wrong. Now, we follow very similar approach to pg_stat_activity.

Some of the changes are pre-requsite for implementing citus_dist_stat_activity
via citus_stat_activity.
2022-03-02 18:04:01 +01:00
Önder Kalacı b36c58f231
Merge pull request #5556 from citusdata/add_udf_for_upgrades
Add a new API for enabling Citus MX for clusters upgrading from earli…
2022-03-02 17:16:21 +01:00
Onder Kalaci 35ec9721b4 Add a new API for enabling Citus MX for clusters upgrading from earlier versions
Clusters created pre-Citus 11 mostly didn't have metadata sync enabled.
For those clusters, we add a utility UDF which fixes some minor issues
and sync the necessary objects to the workers.
2022-03-02 17:02:55 +01:00
Burak Velioglu 95fdbe1370
Merge pull request #5750 from citusdata/fix_test_ent
Unblock enterprise regression test failures
2022-03-02 14:45:37 +03:00
Onder Kalaci 98751058a9 Add Primary key to the table
Otherwise enterprise tests fail
2022-03-02 12:03:59 +01:00
Marco Slot 43f798c476
Merge pull request #5751 from citusdata/marcocitus/revert-columnar-build 2022-03-02 11:50:27 +01:00
Marco Slot dcfbb51b6b Revert "Build Columnar.so and make Citus depends on it (#5661)"
This reverts commit a4133c69e8.
2022-03-02 11:33:15 +01:00
Ahmet Gedemenli 7ad0415fa3
Merge pull request #5735 from citusdata/aggregate-propagate
Propagate CREATE AGGREGATE commands
2022-03-02 11:31:21 +03:00
Ahmet Gedemenli e1809af376 Propagate CREATE AGGREGATE commands 2022-03-02 10:52:43 +03:00
Önder Kalacı 1e876abc56
Merge pull request #5749 from citusdata/improve_check_multi
Drop function in the tests on a never version
2022-03-02 08:51:26 +01:00
Onder Kalaci b79a0052a4 Drop function in the tests on a never version
As dropping the function now relies on pg_dist_object, which exists with 9.0+
2022-03-02 08:45:35 +01:00
ywj a4133c69e8
Build Columnar.so and make Citus depends on it (#5661)
* [Columnar] Build columnar.so and let citus depends on it


Co-authored-by: Yanwen Jin <yanwjin@microsoft.com>
Co-authored-by: Ying Xu <32597660+yxu2162@users.noreply.github.com>
Co-authored-by: jeff-davis <Jeffrey.Davis@microsoft.com>
2022-03-01 23:31:14 +03:00
Nils Dijk 65bd540943
Feature: configure object propagation behaviour in transactions (#5724)
DESCRIPTION: Add GUC to control ddl creation behaviour in transactions

Historically we would _not_ propagate objects when we are in a transaction block. Creation of distributed tables would not always work in sequential mode, hence objects created in the same transaction as distributing a table that would use the just created object wouldn't work. The benefit was that the user could still benefit from parallelism.

Now that the creation of distributed tables is supported in sequential mode it would make sense for users to force transactional consistency of ddl commands for distributed tables. A transaction could switch more aggressively to sequential mode when creating new objects in a transaction.

We don't change the default behaviour just yet.

Also, many objects would not even propagate their creation when the transaction was already set to sequential, leaving the probability of a self deadlock. The new policy checks solve this discrepancy between objects as well.
2022-03-01 17:29:31 +03:00
Burak Velioglu 8a56e4cf8f
Merge pull request #5744 from citusdata/velioglu/function_expand
Expand functions while resolving dependencies
2022-03-01 17:19:23 +03:00
Burak Velioglu f17872aed4
Expand functions while resolving dependencies 2022-03-01 17:08:46 +03:00
Gledis Zeneli b825232ecb
Handle rebalance / replication when a node is disabled (Fix #5664) (#5729)
The issue in question is caused when rebalance / replication call `FullShardPlacementList` which returns all shard placements (including those in disabled nodes with `citus_disable_node`).  Eventually, `FindFillStateForPlacement` looks for the state across active workers and fails to find a state for the placements which are in the disabled workers causing a seg fault shortly after.

Approach:
* `ActivePlacementHash` was not using the status of the shard placement's node to determine if the node it is active. Initially, I just fixed that.
* Additionally, I refactored the code which handles active shards in replication / rebalance to:
	* use a single function to determine if a shard placement is active. 
	* do the shard active shard filtering before calling `RebalancePlacementUpdates` and `ReplicationPlacementUpdates`, so test methods like `shard_placement_rebalance_array` and `shard_placement_replication_array` which have different shard placement active requirements can do their own filtering while using the same rebalance / replicate logic that `rebalance_table_shards` and `replicate_table_shards` use. 

Fix #5664
2022-02-25 19:54:30 +03:00
Hanefi Onaldi 6c25eea62f Fix some typos in comments 2022-02-24 19:48:52 +03:00
Önder Kalacı dda47dae7d
Merge pull request #5734 from citusdata/remove_citus_backend
Drop support for CitusInitiatedBackend
2022-02-24 15:29:19 +01:00
Onder Kalaci df95d59e33 Drop support for CitusInitiatedBackend
CitusInitiatedBackend was a pre-mature implemenation of the whole
GlobalPID infrastructure. We used it to track whether any individual
query is triggered by Citus or not.

As of now, after GlobalPID is already in place, we don't need
CitusInitiatedBackend, in fact it could even be wrong.
2022-02-24 12:12:43 +01:00
Marco Slot 9b4db12651
Merge pull request #5743 from citusdata/marcocitus/drop-wpqr 2022-02-24 10:55:37 +01:00
Marco Slot 0c4e3cb69c Drop worker_partition_query_result on downgrade 2022-02-24 10:18:56 +01:00
Hanefi Onaldi 1399853608
Merge pull request #5730 from citusdata/locks-on-ddltasklist 2022-02-24 03:47:30 +03:00
Hanefi Onaldi 7bd6c2c9ac
Isolation tests for various ddl operations and metadata sync 2022-02-24 03:19:56 +03:00
Hanefi Onaldi f4e8af2c22
Do not acquire locks on node metadata explicitly 2022-02-24 03:19:56 +03:00
Hanefi Onaldi b70949ae8c
Lock nodes when building ddl task lists 2022-02-24 03:19:56 +03:00
Marco Slot 955eabfcd6
Merge pull request #5400 from citusdata/marcocitus/repartition-using-intermediate-results 2022-02-23 20:03:42 +01:00
Marco Slot ef1ceb3953 Only use a single placement for map tasks 2022-02-23 19:40:21 +01:00
Marco Slot 8de802eec5 Enable local_shared_pool_size 5 in arbitrary configs test 2022-02-23 19:40:21 +01:00
Marco Slot 490765a754 Enable re-partition joins after local execution 2022-02-23 19:40:21 +01:00
Marco Slot 3cd9aa655a Stop using citus.binary_worker_copy_format 2022-02-23 19:40:21 +01:00
Marco Slot 5ac0d31e8b Fix re-partition hash range generation 2022-02-23 19:40:21 +01:00
Marco Slot 72d8fde28b Use intermediate results for re-partition joins 2022-02-23 19:40:21 +01:00
Nils Dijk 1fb970224e
Fix: partitioned index dependencies (#5741)
#5685 introduced the resolution of dependencies for indices. This missed support for indices on partitioned tables. This change adds support for partitioned indices to the dependency resolution code.
2022-02-23 17:53:26 +03:00
Jelte Fennema e1afd30263
Speed up test runs on WSL2 a lot (#5736)
It turns out `whereis` is incredibly slow on WSL2 (at least on my
machine):

```
$ time whereis diff
diff: /usr/bin/diff /usr/share/man/man1/diff.1.gz

real    0m0.408s
user    0m0.010s
sys 0m0.101s
```

This command is run by our custom `diff` script, which is run for every
test file that is run. So this adds lots of unnecessary runtime time to
tests.

This changes our custom `diff` script to only call `whereis` in the
strange case that `/usr/bin/diff` does not exist.

The impact of this small change on the total runtime of the tests on WSL
is huge. As an example the following command takes 18 seconds without
this change and 7 seconds with it:
```
make -C src/test/regress/ check-arbitrary-configs CONFIGS=PostgresConfig
```
2022-02-23 13:03:29 +01:00
Ahmet Gedemenli 9a8f11a086
Merge pull request #5572 from citusdata/add-citus-managed-tables-to-arbitrary-configs
Add use_citus_managed_tables to arbitrary configs
2022-02-22 11:54:45 +03:00
Ahmet Gedemenli 8b9402540f Add use_citus_managed_tables to arbitrary configs
(cherry picked from commit 4e93afd1f78854e1aaab63690c441b0b0598a82c)
(cherry picked from commit 0295fe2f5b)
(cherry picked from commit 878510725fab9cb6870b4504e0b1f055d7bbc68d)
2022-02-22 11:39:30 +03:00