Commit Graph

829 Commits (bb1d782384474f146c1b96904812f006edcb15d1)

Author SHA1 Message Date
sumedhpathak bb1d782384 Update links to Documentation to 6.1 2017-02-10 17:02:18 -08:00
Jason Petersen bc21da6f6f Add 6.1.0 CHANGELOG entries (#1219)
This is probably missing some stuff, but is my edit of the initial list
compiled by Burak.

cr: @craigkerstiens
2017-02-09 17:05:17 -07:00
Jason Petersen ad19b668ac Fix tests broken by new PostgreSQL patch releases (#1220)
PostgreSQL 9.5.6 and 9.6.2 were released today and broke several tests
by adding TABLESPACE pg_default output to some DDL commands. Fixed all
occurrences.

cr: @anarazel
2017-02-09 16:53:02 -07:00
Önder Kalacı 1875f86d3b Merge pull request #1213 from citusdata/fix_fkey_crash
Bugfix for creating foreign key
2017-02-07 10:26:11 +02:00
Onder Kalaci 95f8382ca2 Bugfix for creating foreign key
This commit fixes crash for adding foreign keys without
specifying the referenced column crashes the backend.
2017-02-07 09:34:24 +02:00
Brian Cloutier e6e5f63d9d Utility hook does nothing if the extension is not loaded 2017-02-02 17:48:31 +02:00
Brian Cloutier a30b9b93a4 Set a memory context when throwing deferred errors 2017-02-02 15:14:21 +02:00
Brian Cloutier e3c763c3f7 Start remote transactions in master_append_table_to_shard
Add a call to RemoteTransactionBeginIfNecessary so that BEGIN is
actually sent to the remote connections. This means that ROLLBACK and
Ctrl-C are respected and don't leave the table in a partial state.
2017-02-01 18:12:19 +02:00
Jason Petersen 1ff9d68e68 Merge pull request #1182 from citusdata/fix_random_travis_failure
Fix Random Fails on Travis

cr: @jasonmp85
2017-01-31 16:42:19 -07:00
Eren Basak 005c533ee8 Fix Random Fails on Travis
This change fixes the random failures on Travis, which is a bug introduced
with citus/#1124. Before this fix, travis was failing randomly on `check_multi_mx`
test schedule, specifically in the parallel group of `multi_mx_metadata`,
'multi_mx_modifications` and `multi_mx_modifying_xacts` tests. This change fixes this
by serializing these three test cases.
2017-01-31 15:23:06 -08:00
Eren Başak 20139b9b1a Merge pull request #1183 from citusdata/allow_drop_sequence_on_worker
Allow dropping sequences on mx workers
2017-01-31 14:59:29 -08:00
Eren Basak ae0bfb1394 Allow dropping sequences on mx workers
This change allows users to drop sequences on MX workers. Previously, Citus didn't allow dropping
sequences on MX workers because it could cause shards to be dropped if `DROP SEQUENCE ... CASCADE`
is used. We now allow that since allowing sequence creation but not dropping hurts user experience
and also may cause problems with custom Citus solutions.
2017-01-31 14:51:44 -08:00
Samay Sharma 88f4956064 Merge pull request #1178 from citusdata/ozgune-patch-1
Update README.md to include use cases
2017-01-30 13:24:52 -08:00
Ozgun Erdogan 80e241e5c8 Update README.md to include use cases
Updated to the README.md to reflect newer product features.

* Include references to the multi-tenant use case
* Minor update to tutorial link to include 6.0
* Minor update to Contributing guidelines (we haven't used #helpwanted tags over the past year)
* Minor update to remove link to support & training
2017-01-27 16:36:33 -08:00
Brian Cloutier 6843ad8e91 Fix bug where router executor sends query to failed connections 2017-01-27 09:40:30 +02:00
Brian Cloutier 1173f3f225 Refactor CheckShardPlacements
- Break CheckShardPlacements into multiple functions (The most important
  is MarkFailedShardPlacements), so that we can get rid of the global
  CoordinatedTransactionUses2PC.
- Call MarkFailedShardPlacements in the router executor, so we mark
  shards as invalid and stop using them while inside transaction blocks.
2017-01-26 13:20:45 +02:00
Marco Slot c44ae463ae Merge pull request #1168 from citusdata/copy_inactive
Set placement to inactive on connection failure in COPY
2017-01-26 13:23:13 +04:00
Murat Tuncer 0e635b69f0 Add copy failure tests inside transactions 2017-01-26 11:54:40 +03:00
Murat Tuncer 1107439ade Fix dependent tests 2017-01-25 19:19:39 +03:00
Murat Tuncer 5194111420 Add failure case for regression tests 2017-01-25 19:19:39 +03:00
Marco Slot f56454360c Mark failed placements as inactive immediately after COPY 2017-01-25 19:19:39 +03:00
Marco Slot b1626887d5 Don't mark placements inactive in COPY after successful connection 2017-01-25 19:19:38 +03:00
Marco Slot d0c76407b8 Set placement to inactive on connection failure in COPY 2017-01-25 19:19:38 +03:00
Marco Slot 4476a7be81 Merge pull request #1171 from citusdata/utility_schemanode_fix
Remove call to SchemaNode() in multi_ProcessUtility
2017-01-25 12:23:47 +01:00
Marco Slot 85c1a87999 Short circuit in multi_ProcessUtility on ABORT/COMMIT 2017-01-25 11:57:00 +01:00
Marco Slot 2748660b1c Always skip foreign key validation when enable_ddl_propagation is off 2017-01-25 11:56:59 +01:00
Marco Slot 4929e2b503 Merge pull request #1163 from citusdata/mx_errors
Improve terminology in MX error messages
2017-01-25 11:14:21 +01:00
Marco Slot ba940a1de9 Use coordinator instead of schema node in terminology 2017-01-25 11:07:23 +01:00
Marco Slot 72725ba30c Use bigserial instead of BIGINT in sequence error 2017-01-25 11:07:23 +01:00
Burak Yücesoy 9f9fc09320 Merge pull request #1172 from citusdata/add_order_by_to_tests
Add ORDER BY to some tests to have consistent output
2017-01-25 11:49:05 +03:00
Burak Yucesoy 00dd42dc44 Add ORDER BY to some tests to have consistent output 2017-01-25 11:43:25 +02:00
Marco Slot a16c333dfc Merge pull request #1165 from citusdata/updating-readme
Updating citus cloud link to point to sign up
2017-01-24 09:52:58 +01:00
Craig Kerstiens dfa547dbc1 updating citus cloud link to point to sign up 2017-01-24 09:09:06 +01:00
Eren Başak 8a83665ea0 Merge pull request #1124 from citusdata/mx_worker_tests
MX regression tests for queries from workers
2017-01-24 09:53:50 +02:00
Eren Basak 88e9a429e1 Add Regression Tests For Querying MX Tables from Workers 2017-01-24 10:36:59 +03:00
Burak Yücesoy e796d5cb2b Merge pull request #1136 from citusdata/convert_drop_shards_to_use_new_api
Convert drop shards to use new API
2017-01-23 21:16:16 +03:00
Burak Yucesoy d80e7849a4 Convert DropShards to use new connection API
With this change DropShards function started to use new connection API. DropShards
function is used by DROP TABLE, master_drop_all_shards and master_apply_delete_command,
therefore all of these functions now support transactional operations. In DropShards
function, if we cannot reach a node, we mark shard state of related placements as
FILE_TO_DELETE and continue to drop remaining shards; however if any error occurs after
establishing the connection, we ROLLBACK whole operation.
2017-01-23 21:08:41 +03:00
Burak Yucesoy 2489c59c15 In case of failed transactions update shard state only if it is FILE_FINALIZED
Before this change, when a transaction failed, we update related placements shard states
to FILE_INACTIVE during XACT_EVENT_PRE_COMMIT. However that means if another code block
changed shard state to something else (e.g. FILE_TO_DELETE) before XACT_EVENT_PRE_COMMIT
we overwrite that. To prevent that problem, in case of failure we started to change
shard state, only if its current shard state is FILE_FINALIZED.
2017-01-23 21:04:57 +03:00
Burak Yucesoy 484cb12cd0 Add LoadShardPlacement UDF
This UDF returns a shard placement from cache given shard id and placement id. At the
moment it iterates over all shard placements of given shard by ShardPlacementList and
searches given placement id in that list, which is not a good solution performance-wise.
However, currently, this function will be used only when there is a failed transaction.
If a need arises we can optimize this function in the future.
2017-01-23 21:04:57 +03:00
Marco Slot c227b35ca1 Merge pull request #1158 from citusdata/convert_multi_shard
Use placement connection API for multi-shard transactions
2017-01-23 18:55:16 +01:00
Marco Slot 1585c02322 Use placement connection API for multi-shard transactions 2017-01-23 18:34:50 +01:00
Andres Freund 6becd43c8d Merge pull request #1134 from citusdata/prepare_hack_poc
Extended Prepared Statement Support
2017-01-23 09:31:33 -08:00
Andres Freund 6939cb8c56 Hack up PREPARE/EXECUTE for nearly all distributed queries.
All router, real-time, task-tracker plannable queries should now have
full prepared statement support (and even use router when possible),
unless they don't go through the custom plan interface (which
basically just affects LANGUAGE SQL (not plpgsql) functions).

This is achieved by forcing postgres' planner to always choose a
custom plan, by assigning very low costs to plans with bound
parameters (i.e. ones were the postgres planner replanned the query
upon EXECUTE with all parameter values provided), instead of the
generic one.

This requires some trickery, because for custom plans to work the
costs for a non-custom plan have to be known, which means we can't
error out when planning the generic plan.  Instead we have to return a
"faux" plan, that'd trigger an error message if executed.  But due to
the custom plan logic that plan will likely (unless called by an SQL
function, or because we can't support that query for some reason) not
be executed; instead the custom plan will be chosen.
2017-01-23 09:23:50 -08:00
Andres Freund c244b8ef4a Make router planner error handling more flexible.
So far router planner had encapsulated different functionality in
MultiRouterPlanCreate. Modifications always go through router, selects
sometimes. Modifications always error out if the query is unsupported,
selects return NULL.  Especially the error handling is a problem for
the upcoming extension of prepared statement support.

Split MultiRouterPlanCreate into CreateRouterPlan and
CreateModifyPlan, and change them to not throw errors.

Instead errors are now reported by setting the new
MultiPlan->plannigError.

Callers of router planner functionality now have to throw errors
themselves if desired, but also can skip doing so.

This is a pre-requisite for expanding prepared statement support.

While touching all those lines, improve a number of error messages by
getting them closer to the postgres error message guidelines.
2017-01-23 09:23:50 -08:00
Andres Freund 7681f6ab9d Centralize more of distributed planning into CreateDistributedPlan().
The name CreatePhysicalPlan() hasn't been accurate for a while, and
the split of work between multi_planner() and CreatePhysicalPlan()
doesn't seem perfect.  So rename to CreateDistributedPlan() and move a
bit more logic in there.
2017-01-23 09:23:50 -08:00
Andres Freund 557ccc6fda Support for deferred error messages.
It can be useful, e.g. in the upcoming prepared statement support, to
be able to return an error from a function that is not raised
immediately, but can later be thrown.  That allows e.g. to attempt to
plan a statment using different methods and to create good error
messages in each planner, but to only error out after all planners
have been run.

To enable that create support for deferred error messages that can be
created (supporting errorcode, message, detail, hint) in one function,
and then thrown in different place.
2017-01-23 09:23:50 -08:00
Andres Freund 9a82e8f06b Make usage of static a bit more consistent in multi_planner.c. 2017-01-23 09:23:50 -08:00
Jason Petersen 849f70a409 Merge pull request #1137 from citusdata/make_rep_model_explicit
Add replication_model GUC

cr: @anarazel
2017-01-23 09:16:52 -07:00
Jason Petersen 56197dbdba
Add replication_model GUC
This adds a replication_model GUC which is used as the replication
model for any new distributed table that is not a reference table.
With this change, tables with replication factor 1 are no longer
implicitly MX tables.

The GUC is similarly respected during empty shard creation for e.g.
existing append-partitioned tables. If the model is set to streaming
while replication factor is greater than one, table and shard creation
routines will error until this invalid combination is corrected.

Changing this parameter requires superuser permissions.
2017-01-23 09:05:14 -07:00
Brian Cloutier fe5465aa4e Port master_append_table_to_shard to new connection API (#1149)
If any placements fail it doesn't update shard statistics on those placements.

A minor enabling refactor: Make CoordinatedTransactionUses2PC public (it used to be CoordinatedTransactionUse2PC but that symbol already existed, so renamed it as well)
2017-01-23 15:57:44 +02:00