Commit Graph

5741 Commits (86df61cae8b7887685dc9cd2cbc5e946acf78f47)

Author SHA1 Message Date
Onder Kalaci 95d5918967 Properly set worker_query and use 2022-02-21 18:22:33 +01:00
Önder Kalacı 0dd2ddaa70
Merge pull request #5702 from citusdata/improve_citus_lock_waits
Improve citus lock waits to show non-tx blocked distributed processes as well
2022-02-21 18:00:51 +01:00
Onder Kalaci dffcafc096 Use global pids in citus_lock_waits 2022-02-21 17:46:34 +01:00
Onder Kalaci 331af3dce8 Dumping wait edges becomes optionally scan all backends
Before this commit, dumping wait edges can only be used for
distributed deadlock detection purposes. With this commit,
we open the possibility that we can use it for any backend.
2022-02-21 17:37:07 +01:00
Halil Ozan Akgül c866f4b2d6
Merge pull request #5699 from citusdata/global_cancellation
Overrides pg_cancel/terminate_backend functions to use gpid
2022-02-21 16:51:08 +03:00
Halil Ozan Akgul f6cd4d0f07 Overrides pg_cancel_backend and pg_terminate_backend to accept global pid 2022-02-21 16:41:35 +03:00
Ahmet Gedemenli 70dc85239f
Merge pull request #5727 from citusdata/check-distributed-first-for-DropSchemaStmts
Do distributed check first, for DropSchema stmts
2022-02-21 15:26:16 +03:00
Ahmet Gedemenli c1d5ca9896 Do distributed check first, for DropSchema stmts 2022-02-21 14:43:04 +03:00
Ahmet Gedemenli 24bdb287ed
Merge pull request #5723 from citusdata/refactor-distcol-for-createdistributedtable
Refactor CreateDistributedTable to take column name
2022-02-21 12:29:13 +03:00
Ahmet Gedemenli 28aa715ce2 Add test for citus local tables with dropped columns 2022-02-21 12:07:17 +03:00
Ahmet Gedemenli 2bc6a00408 Refactor CreateDistributedTable to take column name 2022-02-21 12:07:17 +03:00
Ying Xu 6d16e9ba56
Merge pull request #5688 from citusdata/maryxu/checkcitusversion_columnar
Copied CheckCitusVersion into Columnar and added new call site in beginscan_extended
2022-02-18 10:01:13 -08:00
yxu2162 8974b2de66 Copied CheckCitusVersion over to Columnar to handle dependency issue. If we split columnar into two extensions, this will later be changed tl CheckColumnarVersion. 2022-02-18 09:47:39 -08:00
Philip Dubé 854f6036a9
Merge pull request #5722 from citusdata/avoid-exceptional-control-flow-in-fluent-py
fluent.py: prefer simpler return based control flow in _accept rather than relying on raising an exception
2022-02-18 16:27:08 +00:00
Philip Dubé 3d044dc543
Merge branch 'master' into avoid-exceptional-control-flow-in-fluent-py 2022-02-18 16:10:45 +00:00
Burak Velioglu 259707b630
Merge pull request #5701 from citusdata/velioglu/function_propagation
Distribute functions with CREATE FUNCTION command
2022-02-18 17:57:53 +03:00
Burak Velioglu fa6866ed36
Start to propagate functions to worker nodes with
CREATE FUNCTION command together with it's dependencies.

If the function depends on any nondistributable object,
function will be created only locally. Parameterless
version of create_distributed_function becomes obsolete
with this change, it will deprecated from the code with a subsequent PR.
2022-02-18 13:56:51 +03:00
Gledis Zeneli 0ca060a820
Merge pull request #5713 from citusdata/prevent-deadlock-on-collation-create
* When a worker tried to create a collation which had a dependency in the same worker node,
it would cause a deadlock, now it throws the correct "not a coordinator" error.
2022-02-18 13:29:46 +03:00
gledis69 a14fada153 Prevent Deadlocks When a Worker Tries to Create Collation (Fix #5583)
* When a worker tried to create a collation which had a dependency in the same worker node,
it would cause a deadlock, now it throws the correct "not a coordinator" error.
2022-02-18 12:28:02 +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
Philip Dubé e4420a6252 fluent.py: prefer simpler return based control flow in _accept rather than relying on raising an exception 2022-02-17 13:30:17 +00:00
Nils Dijk 754d894375
Merge pull request #5721 from citusdata/fix/reuse-get-rolespec
reuse GetRoleSpecObjectForUser
2022-02-17 13:59:04 +01: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 886db667ee
Merge pull request #5717 from citusdata/fix-enterprise-merge-docs 2022-02-17 13:56:44 +03:00
Hanefi Onaldi 3ca2be85a7
Introduce new error message on enterprise merge checks 2022-02-17 13:48:36 +03:00
Hanefi Onaldi 78795251e1
Revert "Improve CI checks for enterprise merges on master (#4981)"
This reverts commit b649dffabd.
2022-02-17 13:48:36 +03:00
Hanefi Onaldi 8cfb93a662
Merge pull request #5718 from citusdata/fix-enterprise-merges 2022-02-17 13:44:46 +03: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
Gledis Zeneli 57319b23d0
Update CONTRIBUTING.md (#5714)
Removed extra comment added in #5695
2022-02-17 11:19:59 +03:00
Ahmet Gedemenli f2f7497ab8
Merge pull request #5710 from citusdata/support-truncate-foreign-tables
Support TRUNCATE for foreign tables
2022-02-17 10:07:09 +03:00
Ahmet Gedemenli a1c3580c64 Support TRUNCATE for foreign tables 2022-02-17 09:59:53 +03:00
Önder Kalacı bf5aa1e223
Merge pull request #5711 from citusdata/clean_up_gpid
Prevent any monitoring view/udf to show already exited backends
2022-02-15 15:40:05 +01: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
Gledis Zeneli 8a3544b4d9
Merge pull request #5695 from citusdata/update-contributing-md
* Adds installation of `mitmproxy`. I was getting this error from running regression tests:
	```
	Can't exec "mitmdump": No such file or directory at /home/glediszeneli/citus/src/test/regress/pg_regress_multi.pl line 215.
	```
* Add a comment to alternatively use `install-all` in the setup. Without `install-all` the `mutli-extension` regression test fails.
2022-02-14 15:17:41 +03:00
Gledis Zeneli b9dfeba050
Merge branch 'master' into update-contributing-md 2022-02-14 14:30:35 +03:00
Hanefi Onaldi 986d8cff49
Merge pull request #5682 from citusdata/metadata-iso-tests 2022-02-11 16:05:57 +03:00
gledis69 98f7c6bc49 Merge branch 'master' into update-contributing-md 2022-02-11 14:55:11 +03:00
gledis69 5478bd0105 Remove extra sudo in comment for Mac 2022-02-11 14:23:43 +03:00
gledis69 49c594a550 Adding install-all comment to all OS-es 2022-02-11 14:17:22 +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
Ahmet Gedemenli defc2d991f
Merge pull request #5663 from citusdata/schema-propagation
Propagate schema operations
2022-02-10 17:30:35 +03:00
Ahmet Gedemenli 76b63a307b Propagate create/drop schema commands 2022-02-10 14:58:09 +03:00
Marco Slot 04408cfded
Merge pull request #5693 from citusdata/marcocitus/from-pushdown 2022-02-09 21:14:45 +01:00
Marco Slot d0711ea9b4 Delegate function calls in FROM outside of transaction block 2022-02-09 20:56:25 +01:00
gledis69 4c2a0f0aa0 Removing install-all, but adding a comment about it 2022-02-09 22:00:39 +03:00
Önder Kalacı 60ce24578f
Merge pull request #5697 from citusdata/improve_nodecon_info
Prevent citus.node_conninfo to use "application_name"
2022-02-09 13:38:36 +01:00