Commit Graph

4079 Commits (fc2272c6bd95d38d1b7724b4d119df9db2f212c8)

Author SHA1 Message Date
Onder Kalaci fc2272c6bd Adjust the tests to earlier versions
- Drop PRIMARY KEY for Citus 10 compatibility
- Drop columnar for PG 12
- Do not start/stop metadata sync as stop is not implemented in 10.1
- PG 11 parallel query changes explain outputs
2021-08-06 16:47:11 +02:00
Onder Kalaci aeca7b1868 Dropped columns do not diverge distribution column for partitioned tables
Before this commit, creating a partition after a DROP column
on the parent (position before dist. key) was leading to
partition to have the wrong distribution column.

(cherry picked from commit 32124efd83)
2021-08-06 16:46:52 +02:00
naisila 74a58270db Bump use of new sql function 2021-08-03 16:45:23 +03:00
naisila edfa976cc8 Fix master_update_table_statistics scripts for 9.5 2021-08-03 16:45:23 +03:00
naisila daf85c6923 Fix master_update_table_statistics scripts for 9.4 2021-08-03 16:45:23 +03:00
naisila 7f11a59863 Reimplement master_update_table_statistics to detect dist. deadlocks
(ALL CODE BORROWED from commit 2f30614fe3)
2021-08-03 16:45:23 +03:00
Onur Tirtir b9df44742f Remove fkey graph visited flags & rework GetConnectedListHelper (#4446)
With this commit, we remove visited flags from ForeignConstraintRelationshipNode
struct since keeping local state in global object is both dangerous and
meaningless.

Also to improve readability, this commit also converts needless recursion to
iterative DFS to avoid passing local hash-map as another parameter to
GetConnectedListHelper function.
(cherry picked from commit 0db21bbe14)
2021-08-03 16:45:23 +03:00
Onur Tirtir 928cee6af6 Refactor foreign_key_relationship.c (#4438)
(cherry picked from commit 3f60b08b11)
2021-08-03 16:45:23 +03:00
naisila 27d74f1540 Add OpenConnectionToNodes and functions that generate shard queries
(ALL CODE BORROWED from commit 724d56f949)
2021-08-03 16:45:23 +03:00
Hanefi Onaldi a529866f93
Bump Citus version to 9.5.6 2021-07-08 15:38:42 +03:00
Hanefi Onaldi 2efbd6e21a
Add changelog entry for 9.5.6
(cherry picked from commit a8a632269af6a276c92bc4852a0c87f0e6467fb3)
2021-07-08 15:38:42 +03:00
Nils Dijk 3e2257fe8f fix 9.5-2 upgrade script to adhere to idempotency 2021-07-08 12:25:18 +02:00
Nils Dijk 2e0f9cff59 Add test for idempotency of citus_prepare_pg_upgrade 2021-07-08 12:25:18 +02:00
Hanefi Onaldi 5ba6edaa48
Bump Citus version to 9.5.5 2021-07-08 09:47:22 +03:00
Hanefi Onaldi 39c4b1045c
Add changelog entry for 9.5.5
(cherry picked from commit d3b6651403)
2021-07-08 09:47:09 +03:00
Onur Tirtir 344ac23f69 Fix lower boundary calculation when pruning range dist table shards (#5082)
This happens only when we have a "<" or "<=" filter on distribution
column of a range distributed table and that filter falls in between
two shards.

When the filter falls in between two shards:

  If the filter is ">" or ">=", then UpperShardBoundary was
  returning "upperBoundIndex - 1", where upperBoundIndex is
  exclusive shard index used during binary seach.
  This is expected since upperBoundIndex is an exclusive
  index.

  If the filter is "<" or "<=", then LowerShardBoundary was
  returning "lowerBoundIndex + 1", where lowerBoundIndex is
  inclusive shard index used during binary seach.
  On the other hand, since lowerBoundIndex is an inclusive
  index, we should just return lowerBoundIndex instead of
  doing "+ 1". Before this commit, we were missing leftmost
  shard in such queries.

* Remove useless conditional branches

The branch that we delete from UpperShardBoundary was obviously useless.

The other one in LowerShardBoundary became useless after we remove "+ 1"
from there.

This indeed is another proof of what & how we are fixing with this pr.

* Improve comments and add more

* Add some tests for upper bound calculation too

(cherry picked from commit b118d4188e)

* Also fix a debug message diff for 9.5
2021-07-07 12:49:16 +03:00
Nils Dijk c11d804e56 Bump use of new sql function 2021-07-05 16:18:43 +02:00
Marco Slot 636bdda886 Fix PG upgrade scripts for 9.5 2021-07-05 16:18:43 +02:00
Marco Slot 7dbda5d607 Fix PG upgrade scripts for 9.4 2021-07-05 16:18:43 +02:00
Sait Talha Nisanci 3584fa11b0 Fix a flaky behaviour in shared_connection_stats
With the previous query, we were not pushing down the pg_sleep hence the
number of connections to a worker could be different from run to run.
2021-07-02 18:37:49 +03:00
Hanefi Onaldi 4aff833ca8 Do not use security flags by default (#4770)
(cherry picked from commit 697bbbd3c6)
2021-03-04 00:54:35 +03:00
Hanefi Onaldi bf345ac49b Add security flags in configure scripts (#4760)
(cherry picked from commit f87107eb6b)
2021-03-04 00:52:34 +03:00
Onur Tirtir cd1e706acb Bump version to 9.5.4 2021-02-19 15:08:31 +03:00
Onur Tirtir 3d4d76fdde Update CHANGELOG for 9.5.4
(cherry picked from commit bb14c5267f)

 Conflicts:
	CHANGELOG.md
2021-02-19 15:08:31 +03:00
SaitTalhaNisanci 45671a1caa 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)

 Conflicts:
	src/backend/distributed/commands/alter_table.c
	src/backend/distributed/commands/cascade_table_operation_for_connected_relations.c
	src/backend/distributed/executor/local_executor.c
	src/backend/distributed/utils/role.c
	src/backend/distributed/worker/worker_create_or_replace.c
	src/backend/distributed/worker/worker_data_fetch_protocol.c
2021-02-19 15:08:31 +03:00
Onur Tirtir 1eec630640 Bump version to 9.5.3 2021-02-16 15:19:53 +03:00
Onur Tirtir 5dc2fae9d6 Update CHANGELOG for 9.5.3
(cherry picked from commit a0de066996)

 Conflicts:
	CHANGELOG.md
2021-02-16 15:18:35 +03:00
Ahmet Gedemenli 0f498ac26d Fix dropping fkey when distributing table
(cherry picked from commit c8e83d1f26)
2021-02-12 18:33:05 +03:00
Onur Tirtir 44459be1ab Implement GetPgDependTuplesForDependingObjects
(cherry picked from commit 04a4167a8a)
2021-02-12 18:32:16 +03:00
Onur Tirtir 8401acb761 Implement ConstraintWithNameIsOfType (#4451)
(cherry picked from commit e91e745dbc)
2021-02-12 18:28:00 +03:00
Onur Tirtir 26556b2bba Refactor ColumnAppearsInForeignKeyToReferenceTable (#4441)
(cherry picked from commit d1b3eaf767)
2021-02-12 18:26:23 +03:00
Sait Talha Nisanci 7480160f4f Call 6 times not 7 in subquery_prepared_statements 2021-02-11 17:28:30 +01:00
Onder Kalaci 23951c562e Do not connection re-use for intermediate results
/*
 * Colocated intermediate results are just files and not required to use
 * the same connections with their co-located shards. So, we are free to
 * use any connection we can get.
 *
 * Also, the current connection re-use logic does not know how to handle
 * intermediate results as the intermediate results always truncates the
 * existing files. That's why, we use one connection per intermediate
 * result.
 */

(cherry picked from commit 5d5a357487)
2021-02-11 16:51:09 +01:00
Onder Kalaci 51560f9644 When reaches to shared pool size, COPY sets the placement access
It looks like we forgot to set the placement accesses, and
this could lead to self-deadlocks on complex transaction blocks.
2021-02-02 10:18:48 +01:00
Onder Kalaci 9f27e398a9 When reaches to executor pool size, COPY sets the placement access
It looks like we forgot to set the placement accesses, and
this could lead to self-deadlocks on complex transaction blocks.

(cherry picked from commit 36bdeef1bb)
2021-02-02 10:18:39 +01:00
Sait Talha Nisanci 5bb4bb4b5f Bump version to 9.5.2 2021-01-26 16:26:25 +03:00
SaitTalhaNisanci a7ff0c5800
Update CHANGELOG for 9.5.2 (#4578) 2021-01-26 12:27:01 +03:00
Nils Dijk 6703b173a0 rework ci
(cherry picked from commit a748729998)
2021-01-25 15:45:05 +03:00
Nils Dijk 2efeed412a Mitigate segfault in connection statemachine (#4551)
As described in the comment, we have observed crashes in production
due to a segfault caused by the dereference of a NULL pointer in our
connection statemachine.

As a mitigation, preventing system crashes, we provide an error with
a small explanation of the issue. Unfortunately the case is not
reliably reproduced yet, hence the inability to add tests.

DESCRIPTION: Prevent segfaults when SAVEPOINT handling cannot recover from connection failures
(cherry picked from commit d127516dc8)
2021-01-25 15:22:41 +03:00
Hadi Moshayedi 49ce36fe8b Reland #4419
(cherry picked from commit bc01c795a2)
2021-01-25 15:15:59 +03:00
Hadi Moshayedi 043c3356ae Faster logical replication tests.
Logical replication status can take wal_receiver_status_interval
seconds to get updated. Default is 10s, which means tests in
which logical replication is used can take a long time to finish.
We reduce it to 1 second to speed these tests up.

Logical replication apply launcher launches workers every
wal_retrieve_retry_interval, so if we have many shard moves with
logical replication consecutively, they will be throttled by this
parameter. Default is 5s, we reduce it to 1s so we finish tests
faster.

(cherry picked from commit 0e0fd6599a)
2021-01-25 15:13:16 +03:00
Onur Tirtir a603ad9cbf Not consider single shard hash dist. tables as replicated (#4413)
(cherry picked from commit 0eb5701658)
2020-12-17 19:02:58 +03:00
Onur Tirtir 4a1255fd10 Update CHANGELOG for 9.5.1
(cherry picked from commit dd3453ced5)

 Conflicts:
	CHANGELOG.md
2020-12-02 11:20:43 +03:00
Onur Tirtir 67004edf43 Bump version to 9.5.1 2020-12-02 11:20:43 +03:00
Onur Tirtir 789d441296 Handle invalid connection hash entries (#4362)
If MemoryContextAlloc errors out -e.g. during an OOM-, ConnectionHashEntry->connections
stays as NULL.

With this commit, we add isValid flag to ConnectionHashEntry that should be set to true
right after we allocate & initialize ConnectionHashEntry->connections list properly, and we
check it before accesing to ConnectionHashEntry->connections.
(cherry picked from commit 7f3d1182ed)
2020-12-01 11:07:12 +03:00
Önder Kalacı 6d06e9760a Enable parallel query on EXPLAIN ANALYZE (#4325)
It seems that we forgot to pass the revelant
flag to enable Postgres' parallel query
capabilities on the shards when user does
EXPLAIN ANALYZE on a distributed table.
(cherry picked from commit b0ddbbd33a)
2020-12-01 11:07:12 +03:00
Onder Kalaci 74f0dd0c25 Do not execute subplans multiple times with cursors
Before this commit, we let AdaptiveExecutorPreExecutorRun()
to be effective multiple times on every FETCH on cursors.
That does not affect the correctness of the query results,
but adds significant overhead.

(cherry picked from commit c433c66f2b)
2020-12-01 11:07:12 +03:00
Onder Kalaci e777daad22 Do not cache all the distributed table metadata during CitusTableTypeIdList()
CitusTableTypeIdList() function iterates on all the entries of pg_dist_partition
and loads all the metadata in to the cache. This can be quite memory intensive
especially when there are lots of distributed tables.

When partitioned tables are used, it is common to have many distributed tables
given that each partition also becomes a distributed table.

CitusTableTypeIdList() is used on every CREATE TABLE .. PARTITION OF.. command
as well. It means that, anytime a partition is created, Citus loads all the
metadata to the cache. Note that Citus typically only loads the accessed table's
metadata to the cache.

(cherry picked from commit 7accbff3f6)

 Conflicts:
	src/test/regress/bin/normalize.sed
2020-12-01 11:07:06 +03:00
Onur Tirtir 4e373fadd8 Update CHANGELOG for 9.5.0
(cherry picked from commit 52a5ab0751)
2020-11-11 16:02:17 +03:00
Hanefi Önaldı 35703d5e61
Bump Citus to 9.5.0 2020-11-09 13:16:05 +03:00