Commit Graph

3611 Commits (69d0c42b1e49a687932fd60d71a58a4f3e89cb33)

Author SHA1 Message Date
Onur Tirtir 69d0c42b1e Update CHANGELOG for 9.3.5
(cherry picked from commit c2ba9a4844)
2020-07-24 18:00:22 +03:00
Onur Tirtir 623287c1d0 Bump version to 9.3.5 2020-07-24 17:28:23 +03:00
Halil Ozan Akgul c4e1cf6162 Fixes create index concurrently bug
(cherry picked from commit 38b72ddd66)
2020-07-24 17:18:55 +03:00
SaitTalhaNisanci b4d62c0613 Fix int32 overflow and use PG macros for INT32_XX (#4061)
* Use CalculateUniformHashRangeIndex in HashPartitionId

INT32_MIN definition can change among different platforms hence it is
possible to get overflow, we would see crashes because of this in debian
distros. We have already solved a similar problem with introducing
CalculateUniformHashRangeIndex method, hence to solve it we can use the
same method, this also removes some duplication and has a single place
to decide that.

* Use PG_INT32_XX instead of INT32_XX to be safer
(cherry picked from commit ef841115de)

 Conflicts:
	src/backend/distributed/commands/multi_copy.c
2020-07-24 17:18:28 +03:00
Halil Ozan Akgül ad3a454e54 Fixes the non existing table bug (#4058)
(cherry picked from commit e9f89ed651)
2020-07-24 17:17:15 +03:00
Hanefi Onaldi 5bf2074dce
Introduce downgrade scripts for 9.3 versions (#4051)
Here are the updated make targets:
- install: install everything except downgrade scripts.
- install-downgrades: build and install only the downgrade migration scripts.
- install-all: install everything along with the downgrade migration scripts.

(cherry picked from commit 315b323d47)

This commit is heavily modified to support an earlier release version.
- Downgrade scripts that are relevant for versions 9.4+ are stripped
- multi_extension tests are copied from master and then stripped
2020-07-21 17:38:07 +03:00
Onur Tirtir e221e4bbef Update CHANGELOG for 9.3.4
(cherry picked from commit 9e12a39cb7)
2020-07-21 14:06:03 +03:00
Onur Tirtir 2f4f2a2551
Bump version to 9.3.4 (#4050) 2020-07-21 13:06:50 +03:00
Hanefi Önaldı a2ba76db96
Accept list of values in a supported ALTER ROLE .. SET statement
Some GUCs support a list of values which is indicated by GUC_LIST_INPUT flag.

When an ALTER ROLE .. SET statement is executed, the new configuration
default for affected users and databases are stored in the
setconfig(text[]) column in a pg_db_role_setting record.

If a GUC that supports a list of values is used in an ALTER ROLE .. SET
statement, we need to split the text into items delimited by commas.

(cherry picked from commit e534dbae4a)
2020-07-21 04:13:32 +03:00
Marco Slot 0bb23cb3d4 Prevent integer overflow in FindShardIntervalIndex 2020-07-16 14:58:12 +02:00
Nils Dijk 5a27a8340e
fix flappy tests due to undeterministic order of test output (#4029)
As reported on #4011 https://github.com/citusdata/citus/pull/4011/files#r453804702 some of the tests were flapping due to an indeterministic order for test outputs.

This PR makes the test output ordered for all tests returning non-zero rows.

Needs to be backported to 9.2, 9.3, 9.4
2020-07-14 15:49:10 +02:00
Nils Dijk 4825447ed4
force aliases in deparsing for queries with anonymous column references (#4011)
DESCRIPTION: Force aliases in deparsing for queries with anonymous column references

Fixes: #3985

The root cause has todo with discrepancies in the query tree we create. I think in the future we should spend some time on categorising all changes we made to ruleutils and see if we can change the data structure `query` we pass to the deparser to have an actual valid postgres query for the deparser to render.

For now the fix is to keep track, besides changing the names of the entries in the target list, also if we have a reference to an anonymous columns. If there are anonymous columns we set the `printaliases` flag to true which forces the deparser to add the aliases.
2020-07-13 18:14:51 +02:00
Onur Tirtir ccb9b8fd51 Update CHANGELOG for 9.3.3
(cherry picked from commit 4c26bb5ffc)
2020-07-10 17:52:42 +03:00
Onur Tirtir 4c9e031974
Bump version to 9.3.3 (#4022) 2020-07-10 16:18:24 +03:00
Hadi Moshayedi df1cbdd1e3 Fix Subtransaction memory leak
(cherry picked from commit 3651fc64ee)
2020-07-10 10:27:21 +03:00
Onur Tirtir 4f574c1712
Merge pull request #3932 from citusdata/release-9.3-push-1592827707
Bump version to 9.3.2 in release-9.3 & Update CHANGELOG
2020-06-22 16:59:51 +03:00
Onur Tirtir 06bfe70cc9 Update CHANGELOG for 9.3.2
(cherry picked from commit d41ad47579)

 Conflicts:
	CHANGELOG.md
2020-06-22 16:30:02 +03:00
Onur Tirtir a6b65e0de3 Bump version to 9.3.2 2020-06-22 15:08:31 +03:00
Onur Tirtir db945e0ca1
Bump version to 9.3.1 (#3928) 2020-06-22 13:19:32 +03:00
Onur Tirtir 85f2703bec Update CHANGELOG for 9.3.1
(cherry picked from commit 4640f90933)

Conflicts:
	CHANGELOG.md
2020-06-17 19:12:33 +03:00
Nils Dijk 73ca2b9382
fix test output for tdigest (#3909)
Due to the problem described in #3908 we don't cover the tdigest integration (and other extensions) on CI.

Due to this a bug got in the patch due to a change in `EXPLAIN VERBOSE` being merged concurrently with the tdigest integration. This PR fixes the test output that missed the newly added information.

(cherry picked from commit f57711b3d2)
2020-06-17 14:36:43 +02:00
Nils Dijk f3f93ffb82
Feature: tdigest aggregate (#3897)
DESCRIPTION: Adds support to partially push down tdigest aggregates

tdigest extensions: https://github.com/tvondra/tdigest

This PR implements the partial pushdown of tdigest calculations when possible. The extension adds a tdigest type which can be combined into the same structure. There are several aggregate functions that can be used to get;
 - a quantile
 - a list of quantiles
 - the quantile of a hypothetical value
 - a list of quantiles for a list of hypothetical values

These function can work both on values or tdigest types.

Since we can create tdigest values either by combining them, or based on a group of values we can rewrite the aggregates in such a way that most of the computation gets delegated to the compute on the shards. This both speeds up the percentile calculations because the values don't have to be sorted while at the same time making the transfer size from the shards to the coordinator significantly less.

(cherry picked from commit da8f2b0134)
2020-06-17 14:36:15 +02:00
Onder Kalaci 885c77d0ae Coerce types properly for INSERT
Also, unify similar code-paths to rely on more accurate function.

(cherry picked from commit 06461ca55f)
2020-06-10 13:55:45 +02:00
Onur Tirtir 95c4aed73b Add changelog entry for 9.3.0 (#3823)
(cherry picked from commit ac1ec40bfb)
2020-05-07 16:11:53 +03:00
Nils Dijk 7973d43ba4 Fix for pruned target list entries (#3818)
DESCRIPTION: Ignore pruned target list entries in coordinator plan

The postgres planner has the ability to prune target list entries that are proven not used in the output relation. When this happens at the `CitusCustomScan` boundary we need to _not_ return these pruned columns to not upset the rest of the planner.

By using the target list the planner asks us to return we fix issues that lead to Assertion failures, and potentially could be runtime errors when they hit in a production build.

Fixes #3809
(cherry picked from commit 105de7beb8)
2020-05-06 15:18:41 +03:00
Hadi Moshayedi e7e36dddca Don't error out when cannot create maintenanced
(cherry picked from commit dbf509bbdd)
2020-05-06 15:16:52 +03:00
Marco Slot 2b8db771ef Make sure we don't wrap GROUP BY expressions in any_value 2020-05-06 06:26:28 +02:00
Onder Kalaci 5474508c01 Rebuild wait event sets after PQconnectPoll() if socket changes
The reason is that PQconnectPoll() may change the underlying
socket. If we don't rebuild the wait event set, the low level
APIs (such as epoll_ctl()) may fail due to invalid sockets.
Instead, rebuilding ensures that we'll use accurate/active sockets.

(cherry picked from commit 77c397e9ae)
2020-05-04 09:02:48 +02:00
Jelte Fennema 8f9b1a839f Add some asserts to pass static analysis (#3805)
(cherry picked from commit c6f5d5fe88)
2020-04-29 11:19:47 +02:00
SaitTalhaNisanci 15fc7821a8 Fix task copy and appending empty task in ExtractLocalAndRemoteTasks (#3802)
* Not append empty task in ExtractLocalAndRemoteTasks

ExtractLocalAndRemoteTasks extracts the local and remote tasks. If we do
not have a local task the localTaskPlacementList will be NIL, in this
case we should not append anything to local tasks. Previously we would
first check if a task contains a single placement or not, now we first
check if there is any local task before doing anything.

* fix copy of node task

Task node has task query, which might contain a list of strings in its
fields. We were using postgres copyObject for these lists. Postgres
assumes that each element of list will be a node type. If it is not a
node type it will error.

As a solution to that, a new macro is introduced to copy a list of
strings.

(cherry picked from commit cbda951395)
2020-04-29 11:41:15 +03:00
Philip Dubé 962bdc67af Fix COPY TO's COPY (SELECT) with distributed table having generated columns
It's necessary to omit generated columns from output

(cherry picked from commit b6b3c1bc17)
2020-04-29 10:50:01 +03:00
SaitTalhaNisanci f7f1b6cc5e Fix typo: longer visible -> no longer visible (#3803) 2020-04-27 16:40:33 +03:00
Onder Kalaci 128273393f Increase the default value of citus.node_connection_timeout
The previous default was 5 seconds, and we change it to 30 seconds.
The main motivation for this is that for busy clusters, 5 seconds
can be too aggressive. Especially with connection throttling, the servers
might be kept busy for a really long time, and users may see the
connection errors more frequently.

We've done some sanity checks, for really quick queries (like
`SELECT count(*) from table`), 30 seconds is a decent value even
if users execute 300 distributed queries on the coordinator. We've
verified this on Hyperscale(Citus).

(cherry picked from commit bc54c5125f)
2020-04-24 16:35:29 +02:00
Onder Kalaci 95ba5dd39c Explicitly mark queries in physical planner for [not] having parameters
Physical planner doesn't support parameters. If the parameters have already
been resolved when the physical planner handling the queries, mark it.
The reason is that the executor is unaware of this, and sends the parameters
along with the worker queries, which fails for composite types.

(See `DissuadePlannerFromUsingPlan()` for the details of paramater resolving)

(cherry picked from commit 0cb7ab2d05)
2020-04-24 13:23:41 +02:00
Onur Tirtir 80da0ed69a Fix build issue in GCC 10 (#3790)
As reported in #3787, we were having issues while building citus with "GCC Red Hat 10" (maybe in some other versions of gcc as well).
Fixes "multiple definition of 'CitusNodeTagNames'" error by explicitly specifying storage of CitusNodeTagNames to be extern.
(cherry picked from commit b8dd8f50d1)
2020-04-22 17:45:08 +03:00
Onur Tirtir 64f9ba2746 Bump Citus version to 9.3.0 2020-04-22 10:22:42 +03:00
Hanefi Onaldi 2e0cb6160c
Merge pull request #3786 from citusdata/coord-skip-dep-setup
Skip dependency setup on coordinator node
2020-04-21 15:29:26 +03:00
Hanefi Önaldı e85b835065
Skip dependency setup on coordinator node 2020-04-21 12:06:31 +03:00
Philip Dubé 2e5b1bfa41
Merge pull request #3756 from citusdata/fix-maintenanced-error-restart
maintenanced: use before_shmem_exit to clear workerPid
2020-04-20 14:57:30 +00:00
Philip Dubé 9093d51a22 maintenanced: handle before_shmem_exit, assert workerPid == 0 on start 2020-04-20 14:41:40 +00:00
Jelte Fennema 1423433531
Fix running check-isolation-base (#3782) 2020-04-20 15:36:09 +02:00
Önder Kalacı 793c65b539
Merge pull request #3606 from citusdata/improve_error_messages
Improve connection error message from the worker nodes
2020-04-20 13:47:43 +02:00
Onder Kalaci e182215d96 Improve connection error message from the worker nodes
We currently put the actual error message to the detail part. However,
many drivers don't show detail part.

As connection errors are somehow common, and hard to trace back, can't
we added the detail to the message itself.

In addition to that, we changed "connection error" message, as it
was confusing to the users who think that the error was happening
while connecting to the coordinator. In fact, this error is showing
up when the coordinator fails to connect remote nodes.
2020-04-20 13:32:55 +02:00
Hadi Moshayedi 797180e0e3
Merge pull request #3778 from citusdata/more_replicate
Replicate reference tables before master_create_empty_shard
2020-04-17 16:54:59 -07:00
Hadi Moshayedi 1250d691d3 Replicate reference tables before master_create_empty_shard 2020-04-17 16:47:03 -07:00
Philip Dubé c03d3714b3
Merge pull request #3779 from citusdata/insert-select-copy-cache-entry
Try copying shard intervals out of cache for long lived borrow
2020-04-17 22:49:58 +00:00
Philip Dubé 8e79672839 Try copying shard intervals out of cache for long lived borrow 2020-04-17 22:00:41 +00:00
Philip Dubé a461ef20d9
Merge pull request #3769 from citusdata/avoid-invalidating-live-cache-entries
Avoid invalidating live cache entries
2020-04-17 15:22:10 +00:00
Philip Dubé c00d57a955 CreateDistributedInsertSelectPlan: avoid calling GetCitusTableCacheEntry in a way that would invalidate live ShardInterval pointers 2020-04-17 14:44:23 +00:00
SaitTalhaNisanci 1d0f4bdcd2
invalidate plan cache in master_update_node (#3758)
* invalidate plan cache in master_update_node

If a plan is cached by postgres but a user uses master_update_node, then
when the plan cache is used for the updated node, they will get the old
nodename/nodepost in the plan. This is because the plan cache doesn't
know about the master_update_node. This could be a problem in prepared
statements or anything that goes into plancache. As a solution the plan
cache is invalidated inside master_update_node.

* add invalidate_inactive_shared_connections test function

We introduce invalidate_inactive_shared_connections udf to be used in
testing. It is possible that a connection count for an inactive node
will be greater than 0 and in that case it will not be removed at the
time of invalidation. However, later we don't have a mechanism to remove
it, which means that it will stay in the hash. For this not to cause a
problem, we use this udf in testing.

* move invalidate_inactive_shared_connections to udfs from test as it will be used in mx

* remove the test udf

* remove the IsInactive check
2020-04-17 17:43:48 +03:00