Commit Graph

2297 Commits (e521e7e39cc0b8093fadcae767e8f934edefecae)

Author SHA1 Message Date
Onder Kalaci e521e7e39c Apply feedback 2019-02-22 18:14:30 +03:00
Onder Kalaci 407d0e30f5 Fix selectForUpdate bug 2019-02-21 18:21:41 +03:00
Onder Kalaci f144bb4911 Introduce fast path router planning
In this context, we define "Fast Path Planning for SELECT" as trivial
queries where Citus can skip relying on the standard_planner() and
handle all the planning.

For router planner, standard_planner() is mostly important to generate
the necessary restriction information. Later, the restriction information
generated by the standard_planner is used to decide whether all the shards
that a distributed query touches reside on a single worker node. However,
standard_planner() does a lot of extra things such as cost estimation and
execution path generations which are completely unnecessary in the context
of distributed planning.

There are certain types of queries where Citus could skip relying on
standard_planner() to generate the restriction information. For queries
in the following format, Citus does not need any information that the
standard_planner() generates:

  SELECT ... FROM single_table WHERE distribution_key = X;  or
  DELETE FROM single_table WHERE distribution_key = X; or
  UPDATE single_table SET value_1 = value_2 + 1 WHERE distribution_key = X;

Note that the queries might not be as simple as the above such that
GROUP BY, WINDOW FUNCIONS, ORDER BY or HAVING etc. are all acceptable. The
only rule is that the query is on a single distributed (or reference) table
and there is a "distribution_key = X;" in the WHERE clause. With that, we
could use to decide the shard that a distributed query touches reside on
a worker node.
2019-02-21 13:27:01 +03:00
Marco Slot fbc22aa6d3
Merge pull request #2521 from citusdata/citus-sql-auto-target
Simplify make file for citus sql files
2019-02-20 12:06:27 +01:00
Nils Dijk 1623c44fc7 Simplify make file for citus sql files 2019-02-19 21:29:20 -05:00
Hanefi Onaldi d6767ad521
Merge pull request #2572 from citusdata/execute-functions-on-coordinator
Wrap function calls in joins inside subqueries
2019-02-04 23:27:04 +03:00
Hanefi Onaldi 148dcad0bb
More documentation and stale comments rewritten 2019-02-04 20:21:51 +03:00
Hanefi Onaldi 825666f912
Query samples in docs and better errors 2019-02-04 19:20:02 +03:00
Hanefi Onaldi 574b071113
Add wrapper function introduced in PG11 for compatibility 2019-02-04 19:20:02 +03:00
Hanefi Onaldi 1106e14385
Wrap functions in subqueries
remove debug logs to fix travis tests

Support RowType functions in joins

Regression tests for a custom type function in join
2019-02-04 19:19:29 +03:00
Hanefi Onaldi 588e7e673d
Merge pull request #2535 from citusdata/failure_mx_metadata_sync
Failure/cancellation tests for mx metadata sync
2019-02-01 12:17:05 +03:00
Hanefi Onaldi 4dd1f5784b
Failure&cancellation tests for mx metadata sync
Failure&Cancellation tests for initial start_metadata_sync() calls
to worker and DDL queries that send metadata syncing messages to an MX node

Also adds message type definitions for messages that are exchanged
during metadata syncing
-
2019-02-01 11:50:25 +03:00
Murat Tuncer 967b369f10
Merge pull request #2590 from citusdata/relax_reference_union_pushdown
Relax reference table restrictions in subquery union pushdowns
2019-01-31 16:04:06 +03:00
Murat Tuncer b36b59dd4f Relax reference table restrictions in subquery union pushdowns
We used to error out if there is a reference table
in the query participating a union. This has caused
pushdownable queries to be evaluated in coordinator.

Now we let reference tables inside union queries as long
as there is a distributed table in from clause.

Existing join checks (reference table on the outer part)
sufficient enought that we do not need check the join relation
of reference tables.
2019-01-31 15:34:29 +03:00
Önder Kalacı 501eaebe77
Merge pull request #2598 from citusdata/fix_router_errors
Queries with only intermediate results do not rely on task assignment policy
2019-01-28 16:39:29 +01:00
Onder Kalaci ec67381ba2 Queries with only intermediate results do not rely on task assignment policy
Previously we allowed task assignment policy to have affect on router queries
with only intermediate results. However, that is erroneous since the code-path
that assigns placements relies on shardIds and placements, which doesn't exists
for intermediate results.

With this commit, we do not apply task assignment policies when a router query
hits only intermediate results.
2019-01-28 17:59:17 +03:00
Murat Tuncer 913cac2391
Merge pull request #2599 from citusdata/fix_fk_from_partition_to_reference
Fix partitioned table operations involving foreign key to reference table
2019-01-28 17:01:43 +03:00
Murat Tuncer cd5213abee Set sequential mode execution GUC for alter partitioned table
PG recently started propagating foreign key constraints
to partition tables. This came with a select query
to validate the the constaint.

We are already setting sequential mode execution for this
command. In order for validation select query to respect
this setting we need to explicitly set the GUC.

This commit also handles detach partition part.
2019-01-25 15:28:07 +03:00
Burak Velioglu 1f4f6ea041
Merge pull request #2585 from citusdata/plan_recursive_exception
Reset planner context instead of popping with recursive planning
2019-01-17 17:24:19 +03:00
velioglu 1bb0ec316a Reset planner restriction context instead of popping with recursive planning 2019-01-17 14:35:16 +03:00
Jason Petersen 339e6e661e
Remove 9.6 (#2554)
Removes support and code for PostgreSQL 9.6

cr: @velioglu
2019-01-16 13:11:24 -07:00
Nils Dijk 0de756559c
Merge pull request #2576 from citusdata/test/base-valgrind
Add make target to run regression tests in isolation with valgrind
2019-01-16 12:26:14 +01:00
Nils Dijk 3f2bac18df
Add make target to run regression tests in isolation with vagrant
Also allow `multi_alter_table_add_constraints` to run in isolation
2019-01-16 11:41:09 +01:00
Jason Petersen 183b2d6c06
Remove 9.6
To spare people the pain while I finish my PR feedback.
2019-01-14 23:46:19 -07:00
Hanefi Onaldi 21f72f5002
Add changelog entry for 8.0.3 (#2581) 2019-01-09 15:21:45 +03:00
Marco Slot d7ee6f2127
Merge pull request #2481 from citusdata/outer_join_pushdown
Plan outer joins through pushdown planning
2019-01-08 10:46:59 +01:00
Hanefi Onaldi ad05634444
Add changelog entry for 8.1.1 2019-01-07 18:44:20 +03:00
Marco Slot 1656b519c4 Plan outer joins through pushdown planning 2019-01-05 20:55:27 +01:00
Murat Tuncer cb77fcce85
Merge pull request #2569 from citusdata/fix_having_with_joins
Fix having clause bug for complex joins
2019-01-04 13:32:28 +03:00
Murat Tuncer b389bebda1 Move repeated code to a function 2019-01-03 17:19:01 +03:00
Murat Tuncer a72d959735 Fix multi_view tests 2019-01-03 17:07:26 +03:00
Murat Tuncer 2ed7d24591 Fix having clause bug for complex joins
We update column attributes of various clauses for a query
inluding target columns, select clauses when we introduce
new range table entries in the query.

It seems having clause column attributes were not updated.

This fix resolves the issue
2019-01-03 17:07:26 +03:00
Murat Tuncer 1d421e60f9
Merge pull request #2573 from citusdata/fix_more_spinlocks
Move functions calls that can fail to outside of spinlock
2019-01-03 16:55:45 +03:00
Murat Tuncer ec36030fae Move functions calls that can fail to outside of spinlock
We had recently fixed a spinlock issue due to functions
failing, but spinlock is not being released.

This is the continuation of that work to eliminate possible
regression of the issue. Function calls that are moved out of
spinlock scope are macros and plain type casting. However,
depending on the configuration they have an alternate implementation
in PG source that performs memory allocation.

This commit moves last bit of codes to out of spinlock for completion purposes.
2019-01-03 15:59:56 +03:00
Murat Tuncer 1dbbc6664f
Merge pull request #2568 from citusdata/fix_spinlock_use
Make sure spinlock is not left unreleased when an exception is thrown
2018-12-25 16:27:49 +03:00
Murat Tuncer 3b95a03c3e
Merge branch 'master' into fix_spinlock_use 2018-12-25 14:41:21 +03:00
Hadi Moshayedi 38579d52d0
Speed-up run_command_on_shards(). (#2564)
We were establishing connections synchronously. Establishing
connections asynchronously results in some parallelization, saving
hundreds of milliseconds.

In a test I did, this decreased the query time from 150ms to 40ms.
2018-12-24 08:47:01 -05:00
Murat Tuncer 9671bc3cbb Make sure spinlock is not left unreleased when an exception is thrown
A spinlock is not released when an exception is thrown after
spinlock is acquired. This has caused infinite wait and eventual
crash in maintenance daemon.

This work moves the code than can fail to the outside of spinlock
scope so that in the case of failure spinlock is not left locked
since it was not locked in the first place.
2018-12-24 15:47:21 +03:00
Hanefi Onaldi fb497ddad1
Bump 8.2devel on master (#2567) 2018-12-24 13:49:50 +03:00
Jason Petersen 9da2254bfb
Merge pull request #2541 from citusdata/disable_appveyor
Disable appveyor

cr: @jasonmp85
2018-12-21 16:40:40 -07:00
Onder Kalaci 8dee92bad2
Revert adb4669 2018-12-21 15:36:41 -07:00
Onder Kalaci 9fff7d28a7
Revert 4925521 2018-12-21 15:36:40 -07:00
Jason Petersen ca83c48097
Merge pull request #2559 from citusdata/concurrent_concurrently
Execute CREATE INDEX CONCURRENTLY in parallel

cr: @jasonmp85
2018-12-21 15:36:17 -07:00
Marco Slot 2e4029973c
Remove sequential create index concurrently test 2018-12-21 14:03:00 -07:00
Marco Slot 1b1c6374f7
Execute CREATE INDEX CONCURRENTLY concurrently 2018-12-21 14:02:59 -07:00
Hadi Moshayedi eb398580f7
Git ignore LLVM bitcode files. (#2565) 2018-12-21 14:55:24 -05:00
Marco Slot 6ca91c1332
Merge pull request #2563 from citusdata/transactions_pgmonitor
Restrict visibility of get_*_active_transactions functions to pg_monitor
2018-12-21 14:40:34 +01:00
Marco Slot 8a54999c5c
Merge pull request #2561 from citusdata/run-time-bound-check
Move an assert-only array-bound check to run-time.
2018-12-20 17:09:04 +01:00
Marco Slot 3ff2b47366 Restrict visibility of get_*_active_transactions functions to pg_monitor 2018-12-19 18:32:42 +01:00
Dimitri Fontaine 6a1a2b8458 Move an assert-only array-bound check to run-time.
When the bound-check fails at run-time, better abort with an error message
rather than trying to user memory we did not allocate.
2018-12-19 06:12:05 +01:00