Commit Graph

802 Commits (ba940a1de9d98629241b9933506d77d19d293a5c)

Author SHA1 Message Date
Metin Doslu ed77260aa1 Return a deep copy shard list from ColocatedShardIntervalList() 2017-01-20 14:38:01 +02:00
Metin Doslu 7cff8719c2 Add worker_hash() and a stub for isolate_tenant_to_new_shard() 2017-01-20 14:38:01 +02:00
Jason Petersen 46abe5b692 Merge pull request #1143 from citusdata/remove_hint_from_master_remove_node
Remove hint message from master_remove_node UDF

cr: @jasonmp85
2017-01-18 22:43:47 -07:00
Murat Tuncer c12bd7b75e
Remove hint message from master_remove_node UDF
Hint about master_disable_node  was giving wrong
impression to users. Removal is better than keeping it.
2017-01-18 22:33:00 -07:00
Eren Başak c0f1a7609f Merge pull request #1103 from citusdata/mx/reference_table_support
MX Support for Reference Tables
2017-01-18 17:15:12 +02:00
Eren Basak 4def1ca696 Prevent COPY to reference tables from worker nodes 2017-01-18 17:38:01 +03:00
Eren Basak e7c15ecc1f Make `upgrade_to_reference_table` function MX-compatible 2017-01-18 16:49:50 +03:00
Eren Basak 56ca590daa Propagate metadata changes for deleted reference table placements on master_remove_node call 2017-01-18 16:00:07 +03:00
Eren Basak be78769ae4 Propagate new reference table placement metadata on `master_add_node` 2017-01-18 15:59:06 +03:00
Eren Basak 23b2619412 Make reference table metadata synced to workers 2017-01-18 15:59:05 +03:00
Eren Basak e44d226221 Propagate Metadata to Workers on `create_reference_table` call. 2017-01-18 11:05:24 +03:00
Eren Başak 2668160fe8 Merge pull request #1090 from citusdata/mx_sequences
Add Sequence Support For MX Tables
2017-01-18 09:18:33 +02:00
Eren Basak b686d9a025 Add Sequence Support for MX Tables
This change adds support for serial columns to be used with MX tables.
Prior to this change, sequences of serial columns were created in all
workers (for being able to create shards) but never used. With MX, we
need to set the sequences so that sequences in each worker create
unique values. This is done by setting the MINVALUE, MAXVALUE and
START values of the sequence.
2017-01-18 09:43:38 +03:00
Eren Basak b1ce8d61c0 Create Invalidation Trigger for pg_dist_local_group Table Updates 2017-01-18 09:43:38 +03:00
Andres Freund b9c4a4b378 Merge pull request #1139 from citusdata/fix-1138
Query placementId in RemoteFinalizedShardPlacementList().
2017-01-17 13:49:53 -08:00
Andres Freund bdef35ac14 Query placementId in RemoteFinalizedShardPlacementList().
Not having the id in the ShardPlacement struct causes issues while
making copy use the placement aware connection management.
2017-01-17 13:27:26 -08:00
Brian Cloutier 67ee357d7f Port WorkerShardStats to new connection API
Part of the work in citusdata/citus#1101, this is a pretty direct port
over to the new functions and shouldn't result in any behavior changes.
2017-01-17 17:04:37 +02:00
Brian Cloutier b1b2b4fadf Create ExecuteOptionalRemoteCommand
A small refactor which pulls some code out of `RecoverWorkerTransactions`
and into `remote_commands.c`. This code block currently only occurs in
`RecoverWorkerTransactions` but will be useful to other functions
shortly.

Unfortunately we couldn't call it `ExecuteRemoteCommand`, that name was
already taken.
2017-01-17 17:04:37 +02:00
Brian Cloutier 539a205462 Pass entire ShardPlacement into WorkerShardStats
A small refactor so we'll be able to call the new connection API (which
requires having a ShardPlacement) from within WorkerShardStats.
2017-01-17 17:04:37 +02:00
Andres Freund 3ea73b7879 Merge pull request #1120 from citusdata/feature/colocation_mapping
Colocation aware placement connections
2017-01-16 13:54:59 -08:00
Andres Freund b9385700ee Make placement_connection.c colocation aware.
Because of foreign keys and similar concerns there should only be a
single modifying/DDL connection for a set of colocated placements to a
node.  To enforce placement_connection.c now has an additional
hash-table keeping track of the connections to a set of colocated
placements.  In addition to enforcing per placement restrictions on
connections, there's now very similar restrictions for sets of
colocated placements.
2017-01-16 13:47:01 -08:00
Andres Freund 6972186652 Add ShardPlacement fields required for colocated placement connection mapping. 2017-01-16 13:42:54 -08:00
Andres Freund 1d79820b74 Fix use of wrong constant.
This could potentially lead to spuriously shared connections if the
first 63 characters of a hostname are the same.
2017-01-16 13:42:53 -08:00
Andres Freund 4b1d37b7be Remove fields used in earlier revisions of placement_connection.c. 2017-01-16 13:42:53 -08:00
Jason Petersen d6ed47a7e6 Merge pull request #1085 from citusdata/improve_insert_select_error_messages
Improve error messages for INSERT INTO .. SELECT

cr: @jasonmp85
2017-01-16 12:26:49 -07:00
Onder Kalaci a7ed49c16e
Improve error messages for INSERT INTO .. SELECT
This commit is intended to improve the error messages while planning
INSERT INTO .. SELECT queries. The main motivation for this change is
that we used to map multiple cases into a single message. With this change,
we added explicit error messages for many cases.
2017-01-16 12:16:14 -07:00
Burak Yücesoy e334e6bc40 Merge pull request #1105 from citusdata/update_reference_table_metadata_on_remove_node
Remove placement metadata of reference tables after master_remove_node
2017-01-16 11:37:52 +03:00
Burak Yucesoy 3315ae6142 Remove placement metadata of reference tables after master_remove_node
With this change, we start to delete placement of reference tables at given worker node
after master_remove_node UDF call. We remove placement metadata at master node but we do
not drop actual shard from the worker node. There are two reasons for that decision,
first, it is not critical to DROP the shards in the workers because Citus will ignore them
as long as node is removed from cluster and if we add that node back to cluster we will
DROP and recreate all reference tables. Second, if node is unreachable, it becomes
complicated to cover failure cases and have a transaction support.
2017-01-16 11:24:56 +03:00
Murat Tuncer 0af5d553d1 Merge pull request #1024 from citusdata/feature/442_view_support
Add view support for select queries
2017-01-13 09:02:07 +02:00
Murat Tuncer e7935a3be4 Report error when original range table id is not found in NewTableId() 2017-01-13 09:39:43 +03:00
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