Commit Graph

681 Commits (76a8b3286afaaacc519a72cc2751b4ff8f09bb3b)

Author SHA1 Message Date
Burak Yucesoy 76a8b3286a Modify tests to create clean workspace
Since we will now replicate reference tables each time we add node, we need to ensure
that test space is clean in terms of reference tables before any add node operation.
For this purpose we had to change order of multi_drop_extension test which caused
change of some of the colocation ids.
2017-01-05 12:22:44 +03:00
Önder Kalacı 9429956b91 Merge pull request #1058 from citusdata/reference_tables_use_2pc_and_add_to_task
Allow reference tables to use 2PC for all modifications
2017-01-04 12:57:01 +02:00
Onder Kalaci 0a05f12475 Use 2PC for reference table modification
With this commit, we ensure that router executor always uses
2PC for reference table modifications and never mark the placements
of it as INVALID.
2017-01-04 12:46:35 +02:00
Burak Yücesoy 5e61087ae9 Merge pull request #1075 from citusdata/upgrade_reference_table
Add upgrade_to_reference_table
2017-01-02 17:03:59 +02:00
Burak Yucesoy 541e45c26e Add upgrade_to_reference_table
With this change we introduce new UDF, upgrade_to_reference_table, which can be used to
upgrade existing broadcast tables reference tables. For upgrading, we require that given
table contains only one shard.
2017-01-02 17:54:42 +02:00
Eren Başak 0183aaadd2 Merge pull request #1068 from citusdata/mx_error_on_unsupported_operations
Error on Unsupported Features on Workers
2017-01-02 16:40:29 +02:00
Eren Basak da3ce88091 Error on Unsupported Features on Workers
This change makes the metadata workers error out on unsupported commands.
2017-01-02 16:03:45 +03:00
Jason Petersen ef1a74e9d4 Merge pull request #1063 from citusdata/multi_shard_multi_connection
Convert multi_shard_transaction to the new connection API

cr: @jasonmp85
2016-12-30 14:56:17 -07:00
Marco Slot 6b7404f59c Use MultiConnection in multi-shard transactions 2016-12-30 14:43:21 -07:00
Metin Döşlü d98ceccd7a Merge pull request #1073 from citusdata/refactor_shard_index
Add binary search capability to ShardIndex()
2016-12-30 18:02:22 +02:00
Metin Doslu 8282fe4af0 Add binary search capability to ShardIndex()
Renamed FindShardIntervalIndex() to ShardIndex() and added binary search
capability. It used to assume that hash partition tables are always
uniformly distributed which is not true if upcoming tenant isolation
feature is applied. This commit also reduces code duplication.
2016-12-30 18:55:34 +02:00
Murat Tuncer f74fa82de4 Merge pull request #1070 from citusdata/feature/where_is_null
Add null clause test cases to router planner regression tests
2016-12-29 09:51:25 +02:00
Murat Tuncer 9bc7c44625 Add null clause test cases to router planner regression tests
Router planner already handles cases when all shards
are pruned out. This is about missing test cases. Notice that
"column is null" and "column = null" have different shard
pruning behavior.
2016-12-29 10:42:31 +03:00
Eren Başak 4ff75c318b Merge pull request #1067 from citusdata/fix_mx_drop_sequence_deadlock
Prevent Deadlock on Dropping MX Tables with Sequences
2016-12-28 15:52:53 +02:00
Eren Basak a11b199ff1 Prevent Deadlock on Dropping MX Tables with Sequences
This change prevents a deadlock situation during DROP TABLE on an
mx table with sequences on workers with metadata.
2016-12-28 16:32:20 +03:00
Burak Yücesoy 1c58ec1d3d Merge pull request #1061 from citusdata/error_out_fk_on_reference_tables
Error out on foreign keys with reference tables
2016-12-28 14:56:43 +02:00
Burak Yucesoy 48fd5f7bc0 Address Onder's comments 2016-12-28 12:26:16 +03:00
Burak Yucesoy 4b3757c9d1 Error out on foreign keys with reference tables
We have one replication of reference table for each node. Therefore all problems with
replication factor > 1 also applies to reference table. As a solution we will not allow
foreign keys on reference tables. It is not possible to define foreign key from, to or
between reference tables.
2016-12-28 10:58:26 +03:00
Murat Tuncer 2957e291cc Merge pull request #1031 from citusdata/fix/750_better_error
Add error hint to failing modify query
2016-12-23 18:54:42 +02:00
Murat Tuncer 96a6069dd9 Add error hint to failing modify query 2016-12-23 19:43:55 +03:00
Marco Slot 5e1a1b79f6 Merge pull request #1057 from citusdata/bugfix/add_node_failure
Convert worker_transactions to new connection API
2016-12-23 16:30:40 +01:00
Marco Slot e55a27a487 Enable transaction recovery in connection API 2016-12-23 16:14:29 +01:00
Marco Slot 06e3eff3d2 Convert worker_transactions to new connection API 2016-12-23 16:14:29 +01:00
Marco Slot 6ea2cb7c8e Add a wrapper for PQsendQuery 2016-12-23 16:14:29 +01:00
Marco Slot b9cc1d4d2c Connectionapify SendCommandListToWorkerInSingleTransaction 2016-12-23 16:14:29 +01:00
Burak Yücesoy cedc4b6ce9 Merge pull request #1062 from citusdata/grant_public_select_access_to_metadata_tables
GRANT SELECT access for metadata tables to public
2016-12-23 16:43:15 +03:00
Burak Yucesoy 4c8da43617 GRANT SELECT access for metadata tables to public
Previously, we errored out if non-user tries to SELECT query for some metadata tables. It
seems that we already GRANT SELECT access to some metadata tables but not others. With
this change, we GRANT SELECT access to all existing Citus metadata tables.
2016-12-23 16:32:47 +03:00
Eren Başak 8bd5229c8c Merge pull request #1045 from citusdata/propagate_mx_metadata_changes
Propagate MX Metadata Changes
2016-12-23 14:58:49 +02:00
Eren Basak 93bc2c6c12 Handle MX tables on workers during drop table commands 2016-12-23 15:43:32 +03:00
Eren Basak bdf732d115 Propagate `mark_tables_colocated` changes in `pg_dist_partition` table to metadata workers. 2016-12-23 15:43:32 +03:00
Eren Basak 9876e253b7 Propagate DDL commands to metadata workers for MX tables 2016-12-23 15:43:32 +03:00
Eren Basak 3d9540e500 Propagate MX table and shard metadata on `create_distributed_table` call 2016-12-23 15:43:32 +03:00
Eren Basak 54c2de697c Rename multi_metadata_snapshot to multi_metadata_sync to make it include future mx metadata syncing regression tests 2016-12-23 15:43:32 +03:00
Eren Basak 02e44745ec Mark hash distributed tables with replication factor = 1 as streaming replicated tables (repmodel=s).
This works only with `create_distributed_table` call.
2016-12-23 15:43:31 +03:00
Marco Slot 8debcca017 Merge pull request #1010 from citusdata/feature/insert_select_functions
Evaluate functions in INSERT..SELECT
2016-12-23 13:24:21 +01:00
Marco Slot 9cdea04466 Enable evaluation of stable functions in INSERT..SELECT 2016-12-23 12:47:21 +01:00
Marco Slot f058ba3ec0 Add explicit RelationShards mapping to tasks 2016-12-23 10:23:43 +01:00
Marco Slot 3520121e92 Merge pull request #1056 from citusdata/feature/mx_locks
Add shard locking UDFs
2016-12-22 11:20:43 +01:00
Marco Slot 483648a4a4 Add shard locking UDFs 2016-12-22 11:04:34 +01:00
Burak Yücesoy f0e9f132c8 Add get_distribution_value_shardid UDF (#1048)
* Add get_distribution_value_shardid UDF

With this UDF users can now map given distribution value to shard id. We mostly hide
shardids from users to prevent unnecessary complexity but some power users might need
to know about which entry/value is stored in which shard for maintanence purposes.

Signature of this UDF is as follows;

bigint get_distribution_value_shardid(table_name regclass, distribution_value anyelement)
2016-12-22 12:17:08 +03:00
Eren Başak 4cbf4df01a Merge pull request #1055 from citusdata/ignore_multi_outer_join_reference_outputs
Make git ignore multi_outer_join_reference test outputs
2016-12-21 15:11:29 +02:00
Eren Basak cff5ed552c Make git ignore multi_outer_join_reference test outputs 2016-12-21 15:58:22 +03:00
Önder Kalacı 6b5ca72db6 Merge pull request #1018 from citusdata/reference_table_base
Reference table Phase-1
2016-12-20 14:15:20 +02:00
Onder Kalaci e0ef4b2f08 Improve regression tests for multi_colocated_shard_transfer
Ensure that regression tests outputs are consistent
for multi_colocated_shard_transfer.
2016-12-20 14:09:35 +02:00
Onder Kalaci 807fc1cc28 Reference Table Support - Phase 1
With this commit, we implemented some basic features of reference tables.

To start with, a reference table is
  * a distributed table whithout a distribution column defined on it
  * the distributed table is single sharded
  * and the shard is replicated to all nodes

Reference tables follows the same code-path with a single sharded
tables. Thus, broadcast JOINs are applicable to reference tables.
But, since the table is replicated to all nodes, table fetching is
not required any more.

Reference tables support the uniqueness constraints for any column.

Reference tables can be used in INSERT INTO .. SELECT queries with
the following rules:
  * If a reference table is in the SELECT part of the query, it is
    safe join with another reference table and/or hash partitioned
    tables.
  * If a reference table is in the INSERT part of the query, all
    other participating tables should be reference tables.

Reference tables follow the regular co-location structure. Since
all reference tables are single sharded and replicated to all nodes,
they are always co-located with each other.

Queries involving only reference tables always follows router planner
and executor.

Reference tables can have composite typed columns and there is no need
to create/define the necessary support functions.

All modification queries, master_* UDFs, EXPLAIN, DDLs, TRUNCATE,
sequences, transactions, COPY, schema support works on reference
tables as expected. Plus, all the pre-requisites associated with
distribution columns are dismissed.
2016-12-20 14:09:35 +02:00
Eren Başak ca35163648 Merge pull request #912 from citusdata/add_timeout_guc
Add citus.node_connection_timeout GUC
2016-12-20 13:33:54 +02:00
Eren Basak 5eb90d6d93 Add citus.node_connection_timeout GUC 2016-12-20 14:11:37 +03:00
Marco Slot 7a39282597 Merge pull request #1049 from citusdata/bugfix/schema_owner
Fix permissions for multi-user re-partition queries
2016-12-20 11:22:59 +01:00
Marco Slot c772dcd32e Run copy commands in worker_merge_files_into_table as superuser 2016-12-20 10:15:42 +01:00
Marco Slot 2ebd92de0a Set user as pg_merge_job_* schema owner 2016-12-20 10:15:42 +01:00