Commit Graph

822 Commits (e3c763c3f75fb65366b8ca421e944611ee3a39b5)

Author SHA1 Message Date
Murat Tuncer 77f8db6b14 Add view support
Enables use views within distributed queries.
User can create and use a view on distributed tables/queries
as he/she would use with regular queries.

After this change router queries will have full support for views,
insert into select queries will support reading from views, not
writing into. Outer joins would have a limited support, and would
error out at certain cases such as when a view is in the inner side
of the outer join.

Although PostgreSQL supports writing into views under certain circumstances.
We disallowed that for distributed views.
2017-01-13 09:39:42 +03:00
Önder Kalacı feef1bc70b Merge pull request #1128 from citusdata/add_order_by_to_shardstate_tests
Add ORDER BY clause to shard state tests to have consistent output
2017-01-13 03:18:47 +02:00
Burak Yucesoy b2c61be4a2 Add ORDER BY clause to shard state tests to have consistent output
In tests related to automatic reference table creation and deletion, there were some
tests whose output may change order thus creating inconsistent test results. With this
change we add ORDER BY clause to related tests to have consistent output.
2017-01-13 02:42:28 +03:00
Önder Kalacı efa01be99e Merge pull request #1122 from citusdata/onder_update_ref
Refactor CheckShardPlacements() and improve support for node removal
2017-01-12 20:22:00 +02:00
Onder Kalaci aed5f817fa Refactor CheckShardPlacements() and improve support for node removal
This commit refactors CheckShardPlacements() so that it only considers
modifyingConnection. Also, it skips nodes which are removed from the
cluster.
2017-01-12 20:10:10 +02:00
Murat Tuncer dbaf7f0e7e Merge pull request #1074 from citusdata/router_query_hint
Add hint to errored real time queries
2017-01-12 10:56:28 +02:00
Murat Tuncer cb1dfd0a17 Add hint to errored real time queries 2017-01-12 11:33:35 +03:00
Önder Kalacı eeee0a7898 Merge pull request #1116 from citusdata/fix_reference_copy
Copy on reference tables should never mark placements invalid
2017-01-12 02:55:16 +02:00
Onder Kalaci 1efa301ada Copy on reference tables should never mark placements invalid
This commit ensures that COPY does not mark any placement
of reference's state as INVALID in case of an error.
2017-01-12 02:43:41 +02:00
Eren Başak 6eb7751647 Merge pull request #1112 from citusdata/fix_worker_rack_escaping_bug
Fix escaping of workerrack in NodeListInsertCommand
2017-01-11 09:25:12 +02:00
Eren Basak 859b920ba9 Fix escaping of workerrack in NodeListInsertCommand
This change fixes a small bug about quoting of workerrack column in
NodeListInsertCommand:

Previous: `"..., '%s'", workerRack`
Now: `"..., %s", quote_literal_cstr(workerRack)`
2017-01-11 10:18:48 +03:00
Andres Freund c4b18da0dd Merge pull request #1113 from citusdata/feature/colocation_mapping
ShardInterval (improved) and ShardPlacement (new) caching.
2017-01-10 18:31:15 -08:00
Andres Freund b813b39241 Cache ShardPlacements in metadata cache.
So far we've reloaded them frequently. Besides avoiding that cost -
noticeable for some workloads with large shard counts - it makes it
easier to add information to ShardPlacements that help us make
placement_connection.c colocation aware.
2017-01-10 18:14:18 -08:00
Andres Freund 8cb47195ba Make LoadShardInterval() backed by the metadata cache.
Doing so requires adding a mapping from shardId to the cache
entries. For that metadata_cache.c now maintains an additional
hashtable. That hashtable only references shard intervals in the
dist table cache.
2017-01-10 17:00:19 -08:00
Andres Freund f6e8647337 Split DistTableCacheEntry() into separate functions.
Previously the function was getting too large. Thus this splits the
function into separate parts for looking up the cache entry and
building the cache contents.
2017-01-10 15:23:18 -08:00
Önder Kalacı 8624ef5ac4 Merge pull request #1115 from citusdata/fix_remove_node
Fix CloseNodeConnections to actually close connections
2017-01-11 01:21:21 +02:00
Onder Kalaci cd8e41bb79 Fix CloseNodeConnections to actually close connections
CloseNodeConnections() is supposed to close connections to a given node.
However, before this commit it lacks to actually call PQFinish() on the
connections. Using CloseConnection() handles closing and all other necessary
actions.
2017-01-11 01:13:58 +02:00
Andres Freund 2435cdb5d1 Merge pull request #1114 from citusdata/pg_regress_fix
Fix diff option failure in regression test
2017-01-10 13:18:07 -08:00
Murat Tuncer 739934cdcb Fix diff option failure in regression test 2017-01-10 22:58:47 +03:00
Murat Tuncer 54b1ebb14e Merge pull request #1069 from citusdata/feature/citus_tools
Feature/citus tools
2017-01-10 17:01:42 +02:00
Murat Tuncer 95862632de Add citus tools to default configuration 2017-01-10 17:53:27 +03:00
Murat Tuncer ec2ecafcf9 Merge pull request #1095 from citusdata/master_disable_node
Add master_disable_node UDF
2017-01-10 10:10:15 +02:00
Murat Tuncer b93185d800 Add master_disable_node UDF
We can now remove nodes from cluster regardless of them
having an active shard placement.
2017-01-10 10:54:57 +03:00
Burak Yücesoy 2a13f23176 Merge pull request #1106 from citusdata/error_out_cte_with_modify
Error out on CTEs with data modifying statement
2017-01-10 09:35:46 +02:00
Burak Yucesoy 59d3d05bc4 Error out on CTEs with data modifying statement
With this change we start to error out on router planner queries where a common table
expression with data-modifying statement is present. We already do not support if
there is a data-modifying statement using result of the CTE, now we also error out
if CTE itself is data-modifying statement.
2017-01-10 10:30:09 +02:00
Andres Freund 8b3dc1f974 Merge pull request #1110 from citusdata/feature/pg_regress_diffopts
Change diff output to unified in pg_regress_multi.pl.
2017-01-09 21:04:13 -08:00
Andres Freund f2ee63d638 Change diff output to unified in pg_regress_multi.pl.
Unified is better understood by a lot of people, and the default
almost everywhere (including github).
2017-01-09 20:51:01 -08:00
Marco Slot 16608a3259 Merge pull request #1109 from citusdata/transaction_recovery_connection_api
Use GetNodeConnection to establish a connection in transaction recovery
2017-01-09 18:31:00 -08:00
Marco Slot ef326b202a PQclear in ReportResultError to prevent memory leaks 2017-01-10 02:51:39 +01:00
Marco Slot 31231ce196 Use GetNodeConnection to establish a connection in transaction recovery 2017-01-10 02:44:34 +01:00
Andres Freund 4f6c2cac67 Merge pull request #1108 from citusdata/feature/interruptible-router-queries
Use interrupt checking libpq wrappers in router executor.
2017-01-09 16:33:57 -08:00
Andres Freund c390daed0f Use interrupt checking libpq wrappers in router executor. 2017-01-09 14:02:45 -08:00
Andres Freund d8cdb552e5 Merge pull request #1079 from citusdata/feature/shardstate
Centralized placement ->connection mapping & placement health management
2017-01-09 13:28:22 -08:00
Andres Freund 7320c17f00 Convert router executor to placement connection management infrastructure.
Remove the router specific transaction and shard management, and
replace it with the new placement connection API.  This mostly leaves
behaviour alone, except that it is now, inside a transaction, legal to
select from a shard to which no pre-existing connection exists.

To simplify code the code handling task executions for select and
modify has been split into two - the previous coding was starting to
get confusing due to the amount of only conditionally applicable code.

Modification connections & transactions are now always established in
parallel, not just for reference tables.
2017-01-09 13:13:02 -08:00
Andres Freund bfa742d794 Centralized shard/placement connection and state management.
Currently there are several places in citus that map placements to
connections and that manage placement health. Centralize this
knowledge.  Because of the centralized knowledge about which
connection has previously been used for which shard/placement, this
also provides the basis for relaxing restrictions around combining
various forms of DDL/DML.

Connections for a placement can now be acquired using
GetPlacementConnection(). If the connection is used for DML or DDL the
FOR_DDL/DML flags should be used respectively.  If an individual
remote transaction fails (but the transaction on the master succeeds)
and FOR_DDL/DML have been specified, the placement is marked as
invalid, unless that'd mark all placements for a shard as invalid.
2017-01-09 13:13:02 -08:00
Andres Freund aca3770364 Merge pull request #1104 from citusdata/connmgr_cleanup
Minor connection/transaction management related cleanups
2017-01-06 09:31:24 -08:00
Andres Freund 3286b99ff1 Remove useless changing of CurrentMemoryContext. 2017-01-06 09:16:45 -08:00
Andres Freund 6291998ae1 Use FinishConnectionListEstablishment() instead of manually iterating. 2017-01-06 09:16:01 -08:00
Andres Freund d256f3fca9 Remove unused LogPreparedTransactions() function.
This is unused since 92c7567008.
2017-01-06 09:15:01 -08:00
Burak Yücesoy 350b1e6431 Merge pull request #1091 from citusdata/replicate_reference_table_on_add_node
Replicate reference tables when new node is added
2017-01-05 13:37:45 +02:00
Burak Yucesoy 9c9f479e4b Replicate reference tables when new node is added
With this change, we start to replicate all reference tables to the new node when new node
is added to the cluster with master_add_node command. We also update replication factor
of reference table's colocation group.
2017-01-05 14:30:41 +03:00
Burak Yucesoy 1d18950860 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ı 2e3e801768 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 6d050fd677 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 43f5efecff Merge pull request #1075 from citusdata/upgrade_reference_table
Add upgrade_to_reference_table
2017-01-02 17:03:59 +02:00
Burak Yucesoy 31cd2357fe 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 7953916ae2 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 7e09bd6836 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 3182287574 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 59bc5972fa
Use MultiConnection in multi-shard transactions 2016-12-30 14:43:21 -07:00