Commit Graph

2662 Commits (ea2e010d42cd65a16643649f3e0020f490773bcc)

Author SHA1 Message Date
velioglu faf50849d7 Enhance pushdown planning logic to handle full outer joins with using clause
Since flattening query may flatten outer joins' columns into coalesce expr that is
in the USING part, and that was not expected before this commit, these queries were
erroring out. It is fixed by this commit with considering coalesce expression as well.
2019-03-05 11:49:30 +03:00
Önder Kalacı 6594ffafa1
Merge pull request #2618 from citusdata/fix_relation_size_leak
Make sure to clear `PGresult` in missing places
2019-03-01 14:44:43 +01:00
Onder Kalaci 26f569abd8 Make sure to clear PGresult on few places
This leads to a memory leak otherwise.
2019-02-28 13:44:34 +03:00
Jason Petersen bf9a119b6f
Merge pull request #2616 from citusdata/circleci
Enable CircleCI
2019-02-26 23:48:11 -07:00
Jason Petersen dceaae3b95
Remove codecov push from Travis build 2019-02-26 23:01:40 -07:00
Jason Petersen 6c3f7b665f
Squelch indentation errors (uncrustify is old in Travis) 2019-02-26 23:01:40 -07:00
Jason Petersen 3df2f51881
Turn on style-checking, fix lingering violations
We'd been ignoring updating uncrustify for some time now because I'd
thought these were misclassifications that would require an update in
our rules to address. Turns out they're legit, so I'm checking them in.
2019-02-26 23:01:40 -07:00
Jason Petersen 383871af7e
Upload Codecov results after test runs
Our first orb use!
2019-02-26 23:01:40 -07:00
Jason Petersen 5817bc3cce
Add test-timing script
Through some clever stream redirections and options, we can get decent
timing data for each of our tests.
2019-02-26 23:01:40 -07:00
Jason Petersen 1b605a6109
Modernize coverage options
These hadn't been looked at in a while, and I'm somewhat certain they
actually were running with optimization on, which is pretty bad.

Swapped out the lower-level flags for `--coverage`, which will work
with both `clang` and `gcc`. On some platforms, linker flags are need-
ed as well.
2019-02-26 22:20:31 -07:00
Jason Petersen 5db45bac45
Enable CircleCI
The configuration for the build is in the YAML file; the changes to the
regression runner are backward-compatible with Travis and just add the
logic to detect whether our custom (isolation- and vanilla-enabled) pkg
is present.
2019-02-26 22:17:26 -07:00
Önder Kalacı 25b5fc9d14
Merge pull request #2610 from citusdata/improve_round_robin
Add transactionId based round robin policy
2019-02-25 13:12:24 +01:00
Onder Kalaci f706772b2f Round-robin task assignment policy relies on local transaction id
Before this commit, round-robin task assignment policy was relying
on the taskId. Thus, even inside a transaction, the tasks were
assigned to different nodes. This was especially problematic
while reading from reference tables within transaction blocks.
Because, we had to expand the distributed transaction to many
nodes that are not necessarily already in the distributed transaction.
2019-02-22 19:26:38 +03:00
Önder Kalacı acc2b0a387
Merge pull request #2606 from citusdata/fast_path_router_planner
Introduce fast path router planning
2019-02-22 17:17:17 +01:00
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 c5c3d6d0a3
Update the mitmscripts readme
and migrate readme to markdown
and create contribution guidelines
2019-02-04 11:30:05 +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