Commit Graph

4660 Commits (2ea3618f2252fb97f70e1163b28dbbd73047dda5)

Author SHA1 Message Date
Ahmet Gedemenli 2ea3618f22 Add test for public shard not found issue
(cherry picked from commit 48a6a5b128)
2021-06-01 10:50:26 +03:00
Ahmet Gedemenli 88825b89a1 Fix tests for public schema
(cherry picked from commit d530d79d73)
2021-06-01 10:50:26 +03:00
Ahmet Gedemenli a216c6b62c Remove redundant if statement for schema name
(cherry picked from commit 840c879572)
2021-06-01 10:50:26 +03:00
Sait Talha Nisanci fcb932268a Bump version to 10.0.3 2021-03-17 18:02:01 +03:00
Sait Talha Nisanci 1200c8fd1c Update CHANGELOG for 10.0.3
(cherry picked from commit 92130ae2a2)
2021-03-17 18:01:57 +03:00
Önder Kalacı 0237d826d5 Make sure that single task local executions start coordinated transaction (#4831)
With https://github.com/citusdata/citus/pull/4806 we enabled
2PC for any non-read-only local task. However, if the execution
is a single task, enabling 2PC (CoordinatedTransactionShouldUse2PC)
hits an assertion as we are not in a coordinated transaction.

There is no downside of using a coordinated transaction for single
task local queries.
2021-03-17 14:56:28 +03:00
Ahmet Gedemenli e54b253713 Add udf citus_get_active_worker_nodes
(cherry picked from commit 5e5db9eefa)
2021-03-17 14:56:28 +03:00
Marco Slot 61efc87c53 Replace MAX_PUT_COPY_DATA_BUFFER_SIZE by citus.remote_copy_flush_threshold GUC
(cherry picked from commit fbc2147e11)
2021-03-17 07:35:46 +03:00
Marco Slot f5608c2769 Add GUC to set maximum connection lifetime
(cherry picked from commit 1646fca445)
2021-03-17 07:35:46 +03:00
Marco Slot ecf0f2fdbf Remove unnecessary AtEOXact_Files call
(cherry picked from commit 6c5d263b7a)
2021-03-16 10:01:14 +03:00
Onder Kalaci 0a09551dab Rename use -> shouldUse
Because setting the flag doesn't necessarily mean that we'll
use 2PC. If connections are read-only, we will not use 2PC.
In other words, we'll use 2PC only for connections that modified
any placements.

(cherry picked from commit e65e72130d)
2021-03-16 10:01:14 +03:00
Onder Kalaci 0805ef9c79 Do not trigger 2PC for reads on local execution
Before this commit, Citus used 2PC no matter what kind of
local query execution happens.

For example, if the coordinator has shards (and the workers as well),
even a simple SELECT query could start 2PC:
```SQL

WITH cte_1 AS (SELECT * FROM test LIMIT 10) SELECT count(*) FROM cte_1;
```

In this query, the local execution of the shards (and also intermediate
result reads) triggers the 2PC.

To prevent that, Citus now distinguishes local reads and local writes.
And, Citus switches to 2PC only if a modification happens. This may
still lead to unnecessary 2PCs when there is a local modification
and remote SELECTs only. Though, we handle that separately
via #4587.

(cherry picked from commit 6a7ed7b309)
2021-03-16 10:01:14 +03:00
Naisila Puka a6435b7f6b Fix upgrade and downgrade paths for master/citus_update_table_statistics (#4805)
(cherry picked from commit 71a9f45513)
2021-03-16 10:01:09 +03:00
Marco Slot f13cf336f2 Add tests for modifying CTE and SELECT without FROM
(cherry picked from commit 9c0d7f5c26)
2021-03-16 09:44:00 +03:00
Marco Slot 46e316881b Fixes a crash in queries with a modifying CTE and a SELECT without FROM
(cherry picked from commit 58f85f55c0)
2021-03-16 09:43:24 +03:00
Onur Tirtir 18ab327c6c Add tests for concurrent index deadlock issue (#4775)
(cherry picked from commit 9728ce1167)
2021-03-16 09:42:21 +03:00
Hadi Moshayedi 61a89c69cd Populate DATABASEOID cache before CREATE INDEX CONCURRENTLY
(cherry picked from commit affe38eac6)
2021-03-16 09:41:19 +03:00
Marco Slot ad9469b351 Try to return earlier in idempotent master_add_node
(cherry picked from commit f25de6a0e3)
2021-03-16 09:40:43 +03:00
Onder Kalaci 4121788848 Pass pointer of AttributeEquivalenceClass instead of pointer of pointer
AttributeEquivalenceClass seems to be unnecessarily used with multiple
pointers. Just use a single pointer for ease of read.

(cherry picked from commit 54ee96470e)
2021-03-16 09:40:07 +03:00
Onder Kalaci e9bf5fa235 Prevent infinite recursion for queries that involve UNION ALL and JOIN
With this commit, we make sure to prevent infinite recursion for queries
in the format: [subquery with a UNION ALL] JOIN [table or subquery]

Also, fixes a bug where we pushdown UNION ALL below a JOIN even if the
UNION ALL is not safe to pushdown.

(cherry picked from commit d1cd198655)
2021-03-16 09:39:59 +03:00
Naisila Puka 18c7a3c188 Skip 2PC for readonly connections in a transaction (#4587)
* Skip 2PC for readonly connections in a transaction

* Use ConnectionModifiedPlacement() function

* Remove the second check of ConnectionModifiedPlacement()

* Add order by to prevent flaky output

* Test using pg_dist_transaction

(cherry picked from commit 196064836c)
2021-03-16 09:31:18 +03:00
Halil Ozan Akgül 85a87af11c Update CHANGELOG for 10.0.2
(cherry picked from commit c2a9706203)

 Conflicts:
	CHANGELOG.md
2021-03-03 17:26:26 +03:00
Hanefi Onaldi 115fa950d3 Do not use security flags by default (#4770)
(cherry picked from commit 697bbbd3c6)
2021-03-03 13:20:05 +03:00
Naisila Puka 445291d94b Reimplement citus_update_table_statistics to detect dist. deadlocks (#4752)
* Reimplement citus_update_table_statistics

* Update stats for the given table not colocation group

* Add tests for reimplemented citus_update_table_statistics

* Use coordinated transaction, merge with citus_shard_sizes functions

* Update the old master_update_table_statistics as well

(cherry picked from commit 2f30614fe3)
2021-03-03 11:41:31 +03:00
Hanefi Onaldi 28f1c2129d Add security flags in configure scripts (#4760)
(cherry picked from commit f87107eb6b)
2021-03-03 11:41:00 +03:00
Marco Slot 205b8ec70a Normalize the ConvertTable notices
(cherry picked from commit dca615c5aa)
2021-03-03 11:40:38 +03:00
Halil Ozan Akgul 6fa25d73be Bump version to 10.0.2 2021-03-01 17:04:24 +03:00
SaitTalhaNisanci bfb1ca6d0d Use translated vars in postgres 13 as well (#4746)
* Use translated vars in postgres 13 as well

Postgres 13 removed translated vars with pg 13 so we had a special logic
for pg 13. However it had some bug, so now we copy the translated vars
before postgres deletes it. This also simplifies the logic.

* fix rtoffset with pg >= 13

(cherry picked from commit feee25dfbd)
2021-03-01 15:18:32 +03:00
Halil Ozan Akgul b355f0d9a2 Adds GRANT for public to citus_tables
(cherry picked from commit 5c5cb200f7)
2021-03-01 15:15:34 +03:00
Önder Kalacı fdcb6ead43 Prevent cross join without any target list entries (#4750)
/*
 * The physical planner assumes that all worker queries would have
 * target list entries based on the fact that at least the column
 * on the JOINs have to be on the target list. However, there is
 * an exception to that if there is a cartesian product join and
 * there is no additional target list entries belong to one side
 * of the JOIN. Once we support cartesian product join, we should
 * remove this error.
 */

(cherry picked from commit 0fe26a216c)
2021-03-01 15:13:26 +03:00
Onur Tirtir 3fcb011b67 Grant read access for columnar metadata tables to unprivileged user
(cherry picked from commit 54ac924bef)
2021-03-01 15:02:57 +03:00
Halil Ozan Akgul 8228815b38 Add 10.0-2 schema version
(cherry-picked from dcc0207605)
2021-03-01 14:58:41 +03:00
Onur Tirtir 270234c7ff Ensure table owner when using alter_columnar_table_set/alter_columnar_table_reset (#4748)
(cherry picked from commit 5ed954844c)
2021-03-01 14:38:19 +03:00
Naisila Puka 3131d3e3c5 Preserve colocation with procedures in alter_distributed_table (#4743)
(cherry picked from commit 5ebd4eac7f)
2021-03-01 14:36:52 +03:00
Hanefi Onaldi a7f9dfc3f0 Fix flaky test
(cherry picked from commit 5aff18b573)
2021-03-01 13:18:22 +03:00
Hanefi Onaldi 049cd55346 Remove length limitations for table renames
(cherry picked from commit 9a792ef841)
2021-03-01 13:18:05 +03:00
Hanefi Onaldi 27ecb5cde2 Failing long table name tests
(cherry picked from commit 7bebeb872d)
2021-03-01 13:17:48 +03:00
Naisila Puka fc08ec203f Fix insert query with CTEs/sublinks/subqueries etc (#4700)
* Fix insert query with CTE

* Add more cases with deferred pruning but false fast path

* Add more tests

* Better readability with if statements

(cherry picked from commit dbb88f6f8b)
2021-03-01 12:16:40 +03:00
Hadi Moshayedi 495470d291 Fix alignment issue in DatumToBytea
(cherry picked from commit 2fca5ff3b5)
2021-03-01 12:07:46 +03:00
SaitTalhaNisanci 39a142b4d9 Use PROCESS_UTILITY_QUERY in utility calls
When we use PROCESS_UTILITY_TOPLEVEL it causes some problems when
combined with other extensions such as pg_audit. With this commit we use
PROCESS_UTILITY_QUERY in the codebase to fix those problems.

(cherry picked from commit dcf54eaf2a)
2021-03-01 11:49:44 +03:00
Onur Tirtir ca4b529751 Bump version to 10.0.1 2021-02-19 12:05:56 +03:00
Onur Tirtir e48f5d804d Update CHANGELOG for 10.0.1
(cherry picked from commit 9031a22e20)

 Conflicts:
	CHANGELOG.md
2021-02-19 12:05:49 +03:00
Marco Slot 85e2c6b523 Rewrite time_partitions join clause to avoid smallint[] operator
(cherry picked from commit 972a8bc0b7)
2021-02-19 11:25:00 +03:00
Onur Tirtir 2a390b4c1d Bump Citus to 10.0.0 2021-02-16 14:39:24 +03:00
Onur Tirtir 41da3a3205
Merge pull request #4716 from citusdata/citus-10.0-changelog-1613462741
Update CHANGELOG for 10.0.0
2021-02-16 13:52:00 +03:00
Onur Tirtir 2d36707a82 Update CHANGELOG for 10.0.0 2021-02-16 13:36:01 +03:00
Onur Tirtir d61fd6e478
Decide changing sequence dependencies on MX nodes according to resulting relation (#4713)
When executing alter_table / undistribute_table udf's, we should not try
to change sequence dependencies on MX workers if new table wouldn't
require syncing metadata.

Previously, we were checking that for input table. But in some cases, the
fact that input table requires syncing metadata doesn't imply the same
for resulting table (e.g when undistributing a Citus table).

Even more, doing that was giving an unexpected error when undistributing
a Citus table so this commit actually fixes that.
2021-02-15 19:20:26 +03:00
SaitTalhaNisanci bcbd24f8de
Only consider pseudo constants for shortcuts (#4712)
It seems that we need to consider only pseudo constants while doing some
shortcuts in planning. For example there could be a false clause but it
can contribute to the result in which case it will not be a pseudo
constant.
2021-02-15 18:39:37 +03:00
SaitTalhaNisanci 0f1ce7a913
Not skip relation in conversion if it doesn't have RelationRestriction (#4685)
We would exclude tables without relationRestriction from conversion
candidates in local-distributed table joins. This could leave a leftover
local table which should have been converted to a subquery.

Ideally I would expect that in each call to CreateDistributedPlan we
would pass a new plan id, but that seems like a bigger change.
2021-02-12 12:33:55 +03:00
Hadi Moshayedi 0f613ac31c
Merge pull request #4702 from citusdata/metadata_changes
Move stripe.chunk_count to last position
2021-02-11 21:06:57 -08:00