Commit Graph

5565 Commits (78795251e14928d9498fe76d03a54ebea5119f1f)

Author SHA1 Message Date
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
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
Teja Mupparti 1e3c8e34c0 Allow create_distributed_function() on a function owned by an extension
Implement #5649
Allow create_distributed_function() on functions owned by extensions

1) Only update pg_dist_object, and do not propagate CREATE FUNCTION.
2) Ensure corresponding extension is in pg_dist_object.
3) Verify if dependencies exist on the function they should resolve to the extension.
4) Impact on node-scaling: We build a list of ddl commands based on all objects in
   pg_dist_object. We need to omit the ddl's for the extension-function, as it
   will get propagated by the virtue of the extension creation.
5) Extra checks for functions coming from extensions, to not propagate changes
   via ddl commands, even though the function is marked as distributed in pg_dist_object
2022-02-08 11:52:56 -08:00
Halil Ozan Akgül 474e36a405
Merge pull request #5601 from citusdata/global_pid
Introduce global PID
2022-02-08 18:43:38 +03:00
Halil Ozan Akgul 8ee02b29d0 Introduce global PID 2022-02-08 16:49:38 +03:00
Burak Velioglu 6376eaf0e0
Merge pull request #5684 from citusdata/velioglu/superuser_connection_for_dep
Use super user connection while propagating dependent objects' pg_dist_object entries
2022-02-07 18:38:29 +03:00
gledis69 ed107835cb Updates a few details in 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.
```
* Calls `install-all` in the setup. Without `install-all` the `mutli-extension` regression test failed.
2022-02-07 18:34:39 +03:00
Burak Velioglu 0a70b78bf5
Add test for dist type 2022-02-07 17:50:49 +03:00
Burak Velioglu c0aece64d0
Add test for checking distributed extension function 2022-02-07 17:50:48 +03:00
Burak Velioglu ab248c1785
Check object ownership while creating pg_dist_object entries on remote 2022-02-07 17:50:48 +03:00
Burak Velioglu 8ae7577581
Use superuser connection while syncing dependent objects' pg_dist_object tuples 2022-02-07 17:50:45 +03:00
Marco Slot d7858709b4
Merge pull request #5690 from citusdata/marcocitus/placement-policy-cleanup 2022-02-07 10:28:02 +01:00
Marco Slot 872f0a79db Remove random shard placement policy 2022-02-06 21:55:58 +01:00
Marco Slot 0cae8e7d6b Remove local-node-first shard placement 2022-02-06 21:36:34 +01:00
Teja Mupparti c8e504dd69 Fix the issue #5673
If the expression is simple, such as, SELECT function() or PEFORM function()
in PL/PgSQL code, PL engine does a simple expression evaluation which can't
interpret the Citus CustomScan Node. Code checks for simple expressions when
executing an UDF but missed the DO-Block scenario, this commit fixes it.
2022-02-04 15:44:53 -08:00
Ying Xu b5c116449b
Removed dependency from EnsureTableOwner (#5676)
Removed dependency for EnsureTableOwner. Also removed pg_fini() and columnar_tableam_finish() Still need to remove CheckCitusVersion dependency to make Columnar_tableam.h dependency free from Citus.
2022-02-04 12:45:07 -08:00
Onur Tirtir 79442df1b7
Fix coordinator/worker query targetlists for agg. that we cannot push-down (#5679)
Previously, we were wrapping targetlist nodes with Vars that reference
to the result of the worker query, if the node itself is not `Const` or
not a `Param`. Indeed, we should not do that unless the node itself is
a `Var` node or contains a `Var` within it (e.g.: `OpExpr(Var(column_a) > 2)`).
Otherwise, when worker query returns empty result set, then combine
query exec would crash since the `Var` would be pointing to an empty
tuple slot, which is not desirable for the node-executor methods.
2022-02-04 05:37:25 -08:00
Önder Kalacı b9b4833710
Merge pull request #5678 from citusdata/unify_gucs
Unify old GUCs into a single one
2022-02-04 14:18:10 +01:00
Onder Kalaci 72d7d92611 Apply code review feedback 2022-02-04 10:52:57 +01:00
Onder Kalaci 923bb194a4 Move isolation_multiuser_locking to MX tests 2022-02-04 10:52:57 +01:00
Onder Kalaci bcb00e3318 remove not used files 2022-02-04 10:52:57 +01:00
Onder Kalaci ff234fbfd2 Unify old GUCs into a single one
Replaces citus.enable_object_propagation with citus.enable_metadata_sync

Also, within Citus 11 release cycle, we added citus.enable_metadata_sync_by_default,
that is also replaced with citus.enable_metadata_sync.

In essence, when citus.enable_metadata_sync is set to true, all the objects
and the metadata is send to the remote node.

We strongly advice that the users never changes the value of
this GUC.
2022-02-04 10:52:56 +01:00
Teja Mupparti f31bce5b48 Fixes the issue seen in https://github.com/citusdata/citus-enterprise/issues/745
With this commit, rebalancer backends are identified by application_name = citus_rebalancer
and the regular internal backends are identified by application_name = citus_internal
2022-02-03 09:40:46 -08:00
jeff-davis b072b9235e
Columnar: fix checksums, broken in a4067913. (#5669)
Checksums must be set directly before writing the page. log_newpage()
sets the page LSN, and therefore invalidates the checksum.
2022-02-02 13:22:11 -08:00
Önder Kalacı 4bb7283af1
Merge pull request #5674 from citusdata/minor_fixes_metadata_sync
Minor fixes for metadata syncing
2022-02-02 11:40:51 +01:00
Onder Kalaci 650243927c Relax some transactional limications on activate node
We already enforce EnsureSequentialModeMetadataOperations(), and given that all activate node is transaction, we should be fine
2022-02-01 15:56:55 +01:00
Onder Kalaci 34d91009ed Update outdated comment
As of the current HEAD, we support sequences as first class objects
2022-02-01 15:37:10 +01:00