Commit Graph

3550 Commits (limit-subquery)

Author SHA1 Message Date
Philip Dubé 0f3531faea We don't need to PartiallyEvaluateExpression on original limit/offset 2020-04-14 20:20:40 +00:00
Philip Dubé 3d5660cb3f subqueryEntryList needs to come from queryTree, not originalQuery 2020-04-14 20:20:40 +00:00
Philip Dubé 176396460a Fix task-tracker ignoring LIMIT/OFFSET with subqueries which pass single relation repartition test 2020-04-14 20:20:40 +00:00
Philip Dubé 004bfca7b2 Instead of deoptimizing limitCount/limitOffset, pass around the original nodes too. Use those nodes for constructing queries which will eventually go through standard_planner again. This still is failing to work with task-tracker 2020-04-14 20:20:40 +00:00
Philip Dubé 4dcbb9f82b Trying to debug why subquery limits don't work with task-tracker 2020-04-14 20:20:40 +00:00
Philip Dubé 8c959fd6f9 Allow subqueries in LIMIT/OFFSET 2020-04-14 20:20:40 +00:00
SaitTalhaNisanci 132efdbc56
add execution params struct (#3747)
We had 9+ parameters in some of the functions related to execution.
Execution params is created to simplify this a bit so that we can set
only the fields that we are interested in and it is easier to read.
2020-04-14 14:32:40 +03:00
SaitTalhaNisanci d58b5e67c1
not run multi_router_planner_fast_path in parallel (#3744) 2020-04-14 13:14:23 +03:00
Önder Kalacı 9229db2081
Merge pull request #3692 from citusdata/shared_connection_counter
Throttle connections to the worker  nodes
2020-04-14 10:37:57 +02:00
Onder Kalaci aa6b641828 Throttle connections to the worker nodes
With this commit, we're introducing a new infrastructure to throttle
connections to the worker nodes. This infrastructure is useful for
multi-shard queries, router queries are have not been affected by this.

The goal is to prevent establishing more than citus.max_shared_pool_size
number of connections per worker node in total, across sessions.

To do that, we've introduced a new connection flag OPTIONAL_CONNECTION.
The idea is that some connections are optional such as the second
(and further connections) for the adaptive executor. A single connection
is enough to finish the distributed execution, the others are useful to
execute the query faster. Thus, they can be consider as optional connections.
When an optional connection is not allowed to the adaptive executor, it
simply skips it and continues the execution with the already established
connections. However, it'll keep retrying to establish optional
connections, in case some slots are open again.
2020-04-14 10:27:48 +02:00
Onder Kalaci 38b8a9ad62 Add citus_remote_connection_stats() function
This function is intended to be used for monitoring
the remote connections.
2020-04-14 10:03:27 +02:00
Onder Kalaci 0dbfbe0c37 Add the necessary shared memory infrastructure
- The hashmap in the shared memory
- The lock to access the hashmap
- The GUC to control the size
2020-04-14 10:03:26 +02:00
Hadi Moshayedi 4e3d402473
Merge pull request #3742 from citusdata/fix_sync
Ensure metadata is synced on master_copy_shard_placement(..., do_repair := false)
2020-04-13 12:57:11 -07:00
Hadi Moshayedi 2639a9a19d Test master_copy_shard_placement errors on foreign constraints 2020-04-13 12:45:27 -07:00
Hadi Moshayedi f9de734329 Ensure metadata is synced on ReplicateColocatedShardPlacement 2020-04-13 11:45:21 -07:00
Hadi Moshayedi 2218b7e38d Refactor ReplicateColocatedShardPlacement 2020-04-13 11:07:26 -07:00
SaitTalhaNisanci 2b2a146af4
update gitignores with new files in test folder (#3749) 2020-04-13 17:09:18 +03:00
SaitTalhaNisanci 2438e80a58
use CURSOR_OPT_PARALLEL_OK flag in local execution (#3745)
We currently don't use any cursor flags in local execution, but we can
use CURSOR_OPT_PARALLEL_OK flag to potentially benefit from parallelism
when possible.
2020-04-12 19:49:22 +03:00
Philip Dubé c8d0e45dd4
Merge pull request #3489 from citusdata/fix-having-some-not-recursively-planned
Fix subquery arguments in aggregates
2020-04-10 13:37:53 +00:00
Philip Dubé 30f10984e1 Defer get_agg_clause_costs, it happens later & avoids errors 2020-04-10 13:26:05 +00:00
Philip Dubé b054911466
Merge pull request #3740 from citusdata/avoid-freeconn-segfault
GetConnParams: Set runtimeParamStart before setting keywords/values to avoid out of bounds access
2020-04-10 13:25:32 +00:00
Philip Dubé ab0b59ad3b GetConnParams: Set runtimeParamStart before setting keywords/values to avoid out of bounds access 2020-04-10 13:14:06 +00:00
Halil Ozan Akgül 475c98a62a
Merge pull request #3546 from citusdata/connection-string-tests-9.2
Regression Tests on an Existing Cluster
2020-04-10 16:12:14 +03:00
Halil Ozan Akgul 34c2b7e056 Fixes the psql connection bug 2020-04-10 15:54:47 +03:00
Halil Ozan Akgul 56e814a333 Adds public host to only hyperscale tests 2020-04-10 15:54:47 +03:00
Halil Ozan Akgul d574ac33a8 Adds next shard ids to multi_create_table tests 2020-04-10 15:54:47 +03:00
Halil Ozan Akgul a701fc774a Adds multi_schedule_hyperscale schedule 2020-04-10 15:54:47 +03:00
Halil Ozan Akgul 5bf350faf9 Removes failing tests
This task just removes the failing tests. It doesn't mean this tests cannot be saved. It's just a starting point
2020-04-10 15:54:47 +03:00
Halil Ozan Akgul 1aa1f55d8e Adds check_multi_hyperscale_superuser schedule 2020-04-10 13:05:07 +03:00
Halil Ozan Akgul c2edf989cf Adds public host parameters 2020-04-10 13:04:24 +03:00
Halil Ozan Akgul 4b9705f714 Adds worker host parameters 2020-04-10 13:03:28 +03:00
Halil Ozan Akgul 119bf590c8 Creates normalize_modified.sed 2020-04-10 13:03:19 +03:00
Halil Ozan Akgul c8a81ef1ce Changes copy to \copy 2020-04-10 13:03:15 +03:00
Halil Ozan Akgul 93b97248b2 Adds a connection string to run tests on that connection 2020-04-10 13:03:03 +03:00
SaitTalhaNisanci 17373d51da
not wait forever in upgrade distributed function before (#3731) 2020-04-10 09:43:42 +03:00
SaitTalhaNisanci 07f9a442b0
Refactor CopyLocalDataIntoShards (#3693)
This PR:
- Declares variables when they are needed.
- Creates DoCopyFromLocalTableIntoShards for better readability.
- Doesn't use a hardcoded value, instead use a variable for better
readability.
2020-04-10 09:25:26 +03:00
Philip Dubé d99043fe0c
Merge pull request #3690 from citusdata/fix/limit_non_const
Correctly handle non-constant LIMIT/OFFSET clauses
2020-04-09 20:25:27 +00:00
Marco Slot a4b2197450 Correctly handle non-constant LIMIT/OFFSET clauses 2020-04-09 19:59:50 +00:00
SaitTalhaNisanci 3dc7cad754
use an enum for local execution status (#3733)
We have two variables that are related to local execution status.
TransactionAccessedLocalPlacement and
TransactionConnectedToLocalGroup. Only one of these fields should be
set, however we didn't have any check for this contraint and it was
error prone.

What those two variables are used is that we are trying to understand if
we should use local execution, the current session, or if we should be
using a connection to execute the current query, therefore the tasks. In
the enum, now it is more clear what these variables mean.

Also, now we have a method to change the local execution status. The
method will error if we are trying to transition from a state to a wrong
state. This will help us avoid problems.
2020-04-09 19:11:04 +03:00
SaitTalhaNisanci 24dcb02bca
enable local table join with reference table (#3697)
* enable local table join with reference table

* test different cases with local table and reference join
2020-04-09 15:25:54 +03:00
SaitTalhaNisanci ebda3eff61
read database name inside the function (#3730) 2020-04-09 13:11:13 +03:00
SaitTalhaNisanci 233e4a24d1
use local execution within transaction block (#3714)
* use local executon when in a transaction block

When we are inside a transaction block, there could be other methods
that need local execution, therefore we will use local execution in a
transaction block.

* update test outputs with transaction block local execution

* add a test to verify we dont leak intermediate schemas
2020-04-09 12:41:58 +03:00
SaitTalhaNisanci fa88046ce1
test that we don't leak intermediate schemas (#3737)
* test that we don't leak intermediate schemas

We have tests to make sure that we don't intermediate any intermediate
files, tables etc but we don't test if we are leaking schemas. It makes
sense to test this as well.

* remove all repartition schemas in case of error

This solution is not an ideal one but it seems to be doing the job.
We should have a more generic solution for the cleanup but it seems that
putting the cleanup in the abort handler is dangerous and it was
crashing.
2020-04-09 12:17:41 +03:00
SaitTalhaNisanci 362d72853c
return early in ExecuteTaskListExtended (#3738)
It is possible to return an error in ExecuteTaskListExtended after
performing local execution with the current structure. However there is
no point in execution the local tasks if we are going to return an error
later. So the local execution is moved after the error check.
2020-04-09 10:10:49 +03:00
Hadi Moshayedi 117233c1e0
Merge pull request #3736 from citusdata/remove_todo
Remove todo from reference_table_utils
2020-04-08 12:54:48 -07:00
Hadi Moshayedi cd877f3fdd
Merge pull request #3637 from citusdata/defer_reference_table_replication_copy
Defer reference table replication
2020-04-08 12:54:04 -07:00
Hadi Moshayedi 9b8802ba2d Remove todo from reference_table_utils 2020-04-08 12:46:55 -07:00
Hadi Moshayedi dda53a0bba GUC for replicate reference tables on activate. 2020-04-08 12:42:45 -07:00
Hadi Moshayedi c168a53ebc Tests for replicate_reference_tables 2020-04-08 12:41:36 -07:00
Hadi Moshayedi acfa850c38 Make multi_replicate_reference_table check-base friendly 2020-04-08 12:41:36 -07:00