Commit Graph

893 Commits (6b66a023aac3b9c1473d2abcc2b00d99d434e44a)

Author SHA1 Message Date
Onder Kalaci 6b66a023aa Fix pushing down wrong queries for INSERT ... SELECT queries
Before this commit, in certain cases router planner allowed pushing
down JOINs that are not on the partition keys.

With @anarazel's suggestion, we change the logic to use uninstantiated
parameter. Previously, the planner was traversing on the restriction
information and once it finds the parameter, it was replacing it with
the shard range. With this commit, instead of traversing the restrict
infos, the planner explicitly checks for the equivalence of the relation
partition key with the uninstantiated parameter. If finds an equivalence,
it adds the restrictions. In this way, we have more control over the
queries that are pushed down.
2017-03-24 11:37:35 +02:00
Ozgun Erdogan 8d2ea0cc0a Merge pull request #1295 from citusdata/ozgune-readme-step-numbering
Minor update README.md to fix the numbers in Docker installation steps.
2017-03-23 14:52:26 -07:00
Ozgun Erdogan 4150a062af Update README.md
Updated the Local Cluster steps to include the right numbering.
2017-03-23 11:00:32 -07:00
Jason Petersen 009970e8e5 Merge pull request #1278 from citusdata/master_ddl_first
Execute DDL on coordinator before workers

cr: @metdos, @anarazel
2017-03-22 17:45:06 -06:00
Jason Petersen ef1a42c4dc Address code review comments 2017-03-22 17:29:17 -06:00
Jason Petersen 48db2f1fc8 Rework ReplicateGrantStmt to use new flow
This was the impetus for the previous commit that changed from using a
DDLJob * to a List * of them.
2017-03-22 17:29:16 -06:00
Jason Petersen 41b2317457 Change DDLJob usage to be wrapped in lists
To prepare for GRANT fixes.
2017-03-22 17:29:16 -06:00
Jason Petersen dd3f2f6fbb Fix MX tests
Missed some of these. One had a bad DDL statement to begin with (mixed
up column type and column name) and other was just master/worker order.
2017-03-22 17:21:49 -06:00
Jason Petersen a5d32a0c22 Move worker execution to after master, fix tests
Some tests relied on worker errors though local commands were invalid.
Fixed those by ensuring preconditions were met to have command work
correctly. Otherwise most test changes are related to slight changes
in local/remote error ordering.
2017-03-22 17:21:49 -06:00
Jason Petersen c04ecae919 Remove execution from stmt-specific util functions
Now have a single Execute call in the main body.
2017-03-22 17:21:49 -06:00
Jason Petersen 55910d4851 Rename Process*Stmt functions to Plan*Stmt
To reflect their new purpose planning a DDLJob rather than fully
processing a distributed DDL statement.
2017-03-22 17:21:49 -06:00
Jason Petersen 041aff8eed Refactor ExecuteDistDDLCommand to expect struct
Will let us separate out the determination of what to execute from its
actual execution.
2017-03-22 17:21:49 -06:00
Jason Petersen 5838581854 Minor permissions test fix
When running under Enterprise, some of the GRANT commands and whatnot
are propagated. Guarding that section with a call to disable DDL prop.
fixes everything.
2017-03-22 17:07:05 -06:00
Jason Petersen f800e0c01d Merge pull request #1281 from citusdata/fix_permission_check
Fix access permission checks for distributed relations

cr: @jasonmp85
2017-03-22 15:35:59 -06:00
Metin Doslu 2260adf163 Add basic permission checking tests 2017-03-22 15:25:00 -06:00
Metin Doslu 1268a2553d Update regression tests for changing explain output 2017-03-22 15:25:00 -06:00
Metin Doslu 16a014e50d Fix access permission checks for distributed relations
With this commit, we add the range table list of the original query to our
custom plan. Therefore, PostgreSQL can check relations in the original query
for access permissions and error out if the proper access is not granted.
2017-03-22 15:25:00 -06:00
Jason Petersen eb7cb5af9c Set tab size for GitHub display
Hooray!
2017-03-22 13:03:39 -06:00
Murat Tuncer 1488f152a4 Merge pull request #1142 from citusdata/bugfix/750_router_modify_errors
Rephrase router modify errors
2017-03-16 14:52:25 +02:00
Murat Tuncer 86e938ab96 Rephrase router modify errors
generic "distributed modifications must target exactly one shard"
message is replaced by more context aware error messages.
2017-03-16 15:09:10 +03:00
Burak Velioglu 117ca8f225 Merge pull request #1267 from citusdata/add_udf_to_get_size_of_table
Add udfs to get size of table
2017-03-16 15:02:11 +03:00
velioglu d7e244792f Size UDFs implemented
citus_table_size, citus_relation_size and citus_total_relation_size UDFs are implemented.
2017-03-16 13:50:30 +03:00
Metin Döşlü de1e0c5eb1 Merge pull request #1185 from citusdata/custom_plan
Use CustomScan API for query execution
2017-03-14 11:39:16 +02:00
Metin Doslu 76ab7040cb Use CustomScan API for query execution
Custom Scan is a node in the planned statement which helps external providers
to abstract data scan not just for foreign data wrappers but also for regular
relations so you can benefit your version of caching or hardware optimizations.
This sounds like only an abstraction on the data scan layer, but we can use it
as an abstraction for our distributed queries. The only thing we need to do is
to find distributable parts of the query, plan for them and replace them with
a Citus Custom Scan. Then, whenever PostgreSQL hits this custom scan node in
its Vulcano style execution, it will call our callback functions which run
distributed plan and provides tuples to the upper node as it scans a regular
relation. This means fewer code changes, fewer bugs and more supported features
for us!

First, in the distributed query planner phase, we create a Custom Scan which
wraps the distributed plan. For real-time and task-tracker executors, we add
this custom plan under the master query plan. For router executor, we directly
pass the custom plan because there is not any master query. Then, we simply let
the PostgreSQL executor run this plan. When it hits the custom scan node, we
call the related executor parts for distributed plan, fill the tuple store in
the custom scan and return results to PostgreSQL executor in Vulcano style,
a tuple per XXX_ExecScan() call.

* Modify planner to utilize Custom Scan node.
* Create different scan methods for different executors.
* Use native PostgreSQL Explain for master part of queries.
2017-03-14 12:17:51 +02:00
Andres Freund 2a6188d8a1 Initial temp table removal implementation 2017-03-14 12:09:49 +02:00
Jason Petersen 73e0e2a79a Revert "Remove unused SendCommandToWorker"
This reverts commit c8c308c109.
2017-03-13 15:48:51 -06:00
Murat Tuncer faf1f9ec99 Merge pull request #1272 from citusdata/router_planner_range_partitioned
Enable router planner for queries on range partitioned table
2017-03-09 16:18:12 +02:00
Murat Tuncer 7abc7080f2 Enable router planner for queries on range partitioned tables
Router planner now supports queries using range partitioned
tables. Queries on append partitioned tables are still not
supported.
2017-03-09 16:39:15 +03:00
Jason Petersen b1aec5b403 Merge pull request #1263 from citusdata/docker-engine
Newer docker installation instructions

cr: @jasonmp85
2017-03-08 16:18:49 -07:00
Joe Nelson 10a5309b20 Use curl everywhere and prevent nested shell session 2017-03-08 15:43:26 -07:00
Joe Nelson 387f779fe0 More consistent references to Docker products 2017-03-08 15:43:26 -07:00
Joe Nelson 44524e879f Link to (for now) newest docker-compose binary 2017-03-08 15:43:26 -07:00
Joe Nelson a037c42418 Make outermost list ordered to emphasize the sequence 2017-03-08 15:43:25 -07:00
Joe Nelson 194a47f449 Docker download url has changed 2017-03-08 15:43:25 -07:00
Joe Nelson 61285ba367 Link to the new tutorial as well 2017-03-08 15:43:25 -07:00
Joe Nelson f0cec85c77 Native docker on mac, plus smoother instructions 2017-03-08 15:43:24 -07:00
Brian Cloutier ebc7779457 Remove unused SendCommandToWorker 2017-03-08 16:30:23 +03:00
Jason Petersen f1e7b1e180 Merge pull request #1255 from citusdata/remove-unused-func
Remove unused metadata functions.

cr: @jasonmp85
2017-03-07 16:37:54 -07:00
Brian Cloutier aed36acfeb Remove unused master_stage_shard_{placement_,}row 2017-03-07 11:59:26 +03:00
Brian Cloutier 9f876986e2 Remove unused master_get_round_robin_candidate_nodes 2017-03-07 11:51:24 +03:00
Brian Cloutier c3e9bb880b Remove master_get_local_first_candidate_nodes 2017-03-07 11:50:59 +03:00
Andres Freund 99d660c45f Fix SendRemoteCommandParams() handling of a NULL MultiConnection->pgConn. (#1271)
Previously we'd segfault in PQisnonblocking() which, contrary to other
libpq calls, doesn't handle a NULL PQconn (because there'd be no
appropriate return value for that).

cr: @jasonmp85
2017-03-03 12:02:15 -07:00
Murat Tuncer c16712c1c1 Merge pull request #1264 from citusdata/bugfix/1251_remove_default_value
Remove default clause from shard DDL when sequences are used
2017-03-01 21:03:40 +02:00
Murat Tuncer e718b10ce9 Remove default clause from shard DDL when sequences are used 2017-03-01 17:32:48 +03:00
Marco Slot 0a31d33cf9 Fix spelling in master_initialize_node_metadata comment 2017-03-01 12:27:50 +01:00
Jason Petersen e08c73f135 Merge pull request #1117 from citusdata/create_table_data_migration
Migrate data on create_distributed_table

cr: @jasonmp85
2017-02-28 22:55:06 -07:00
Jason Petersen d3653051ab Rename misleading allowEmpty parameter
Last bit of PR feedback.
2017-02-28 22:48:00 -07:00
Marco Slot ba764be3bb Address review feedback in create_distributed_table data loading 2017-02-28 17:39:45 +01:00
Marco Slot 29b1fb97c5 Address review feedback in COPY refactoring 2017-02-28 17:39:45 +01:00
Marco Slot 92c8d6cf54 Use CitusCopyDestReceiver for regular COPY 2017-02-28 17:24:45 +01:00