Commit Graph

425 Commits (5634b027b54d7cacf69b63c7c2c07f61a45d45e5)

Author SHA1 Message Date
Jason Petersen 5634b027b5
Remove gitattributes for csql files
This was missed before.
2016-09-29 15:54:38 -06:00
Jason Petersen 6671cf5171
Remove unused dumputils.h header
Believe this was used by csql, which is now gone.
2016-09-29 15:54:38 -06:00
Jason Petersen 1c560dfa9c
Update ruleutils_95 with latest PostgreSQL changes
Hand-applied changes from a diff I generated between 9.5.0 and 9.5.4.
2016-09-29 15:54:38 -06:00
Marco Slot 9a5b844a81 Merge pull request #815 from citusdata/bugfix/count_null
Make count return 0 if all shards are pruned away
2016-09-29 20:32:46 +02:00
Marco Slot c4bc0742a7 Make count return 0 if all shards are pruned away
Before this change, count on a distributed returned NULL if all shards
were pruned away, because on the master we replace with count(..) call
with a sum(..) call to sum the counts from the shards. However, sum
returns NULL when there are no rows, whereas count is expected to return
0.
2016-09-29 20:27:26 +02:00
Jason Petersen 9c19ad8b78 Merge pull request #818 from citusdata/fix_xact_callbacks
Directly register transaction callbacks in PG_init

cr: @anarazel
2016-09-29 11:52:03 -06:00
Jason Petersen 5b80d4e8dd
Directly register multi-shard callbacks in PG_init
I had changed these callbacks to use the same method I chose for the
router executor (for consistency), but as that method is flawed, we now
want to ensure we directly register them from PG_init as well.
2016-09-29 11:43:19 -06:00
Jason Petersen 5f6264105d
Directly register router xact callbacks in PG_init
Not entirely sure why we went with the shared memory hook approach, but
it causes problems (multiple registration) during crashes. Changing to
a simple direct registration call from PG_init.
2016-09-29 11:43:18 -06:00
Burak Yücesoy e2f720dbe7 Merge pull request #785 from citusdata/colocation_features
Internal co-location API
2016-09-29 12:43:02 +03:00
Burak Yucesoy 1ee39eb098 Internal co-location API
With this commit we introduce internal API for co-location related operations.
2016-09-29 11:56:53 +03:00
Jason Petersen 127c0e513f Merge pull request #814 from citusdata/copy_to_distributed_table_final_goodbye
Remove copy_to_distributed_table

cr: @jasonmp85
2016-09-28 11:32:08 -06:00
Marco Slot 5cdbe2b86c
Remove copy_to_distributed_table 2016-09-28 11:27:54 -06:00
Murat Tuncer 854ed613fb Merge pull request #806 from citusdata/fix_805_where_false
Make join queries with where false clauses router plannable
2016-09-28 18:54:19 +03:00
Murat Tuncer 5b42318ac4 Make where false queries router plannable 2016-09-28 18:49:26 +03:00
Murat Tuncer 116fcdbcc8 Merge pull request #784 from citusdata/fix_594_shard_refresh
Add UDF master_expire_table_cache
2016-09-28 12:13:01 +03:00
Murat Tuncer c16dec88c3 Add UDF master_expire_table_cache 2016-09-28 12:08:37 +03:00
Jason Petersen e8a942485c Merge pull request #812 from citusdata/fix_uniq_constraint_segfault
Fix unique-violation-in-xact segfault

cr: @anarazel
2016-09-27 16:51:48 -06:00
Jason Petersen 0caf0d95f1
Fix unique-violation-in-xact segfault
An interaction between ReraiseRemoteError and DML transaction support
causes segfaults:

  * ReraiseRemoteError calls PurgeConnection, freeing a connection...
  * That connection is still in the xactParticipantHash

At transaction end, the memory in the freed connection might happen to
pass the "is this connection OK?" check, causing us to try to send an
ABORT over that connection. By removing it from the transaction hash
before calling ReraiseRemoteError, we avoid this possibility.
2016-09-27 16:44:03 -06:00
Metin Döşlü 1a04cd123d Merge pull request #770 from citusdata/fix/insert_query_inside_plpgsql
Pass text oid instead of invalid oid for null values
2016-09-27 08:46:04 +03:00
Metin Doslu c9dcad9b05 Pass text oid inteads of invalid oid for null values
Passing invalid oids even for null values in PQsendQueryParams() causes worker
nodes to fail. Therefore, we pass text oid for null values.
2016-09-27 08:15:46 +03:00
Jason Petersen dbc58c60ca Merge pull request #776 from citusdata/feature/no-movement
Support NoMovement direction in router executor

cr: @jasonmp85
2016-09-26 18:32:33 -06:00
Andres Freund 776b3868b9
Support NoMovement direction in router executor
This is mainly interesting because it allows to use RETURN QUERY/RETURN
QUERY EXECUTE and FOR ... IN .. LOOPs in plpgsql.
2016-09-26 18:28:36 -06:00
Jason Petersen 33552c2f13 Merge pull request #721 from citusdata/feature_truncate
Add truncate support for distributed tables

cr: @jasonmp85
2016-09-26 18:27:52 -06:00
Murat Tuncer 32003c4aa1
Add tests with spaces in table names 2016-09-26 18:23:43 -06:00
Murat Tuncer 2f78fb8f1b
Remove extra space 2016-09-26 18:23:43 -06:00
Murat Tuncer 902e68c9ef
Refactor SendQueryToPlacements api 2016-09-26 18:23:43 -06:00
Murat Tuncer 6317bbe9a8
Address feedback 2016-09-26 18:23:42 -06:00
Murat Tuncer 877694296f
Fix regression test failures after rebase 2016-09-26 18:23:42 -06:00
Murat Tuncer 2eec0167be
Add support for truncate statement 2016-09-26 18:23:42 -06:00
Marco Slot ad9d0bb69c Merge pull request #804 from citusdata/bugfix/join_filter_crash
Fix segmentation fault in case of joins with WHERE false
2016-09-26 15:23:57 +02:00
Marco Slot 3318288d75 Fix segmentation fault in case of joins with WHERE 1=0 2016-09-26 15:12:29 +02:00
Eren Başak 70fd42c41c Merge pull request #749 from robin900/forbid-exclusion-constraints
Handle EXCLUDE constraints properly on distributed tables
2016-09-22 11:37:25 +03:00
Robin Thomas 614c858375 Forbid EXCLUDE constraints on distributed tables just as we forbid
UNIQUE or PRIMARY KEY constraints. Also, properly propagate valid
EXCLUDE constraints to worker shard tables.

If an EXCLUDE constraint includes the distribution column,
the operator must be an equality operator.
Tests in regression suite for exclusion constraints that include
the partition column, omit it, and include it but with non-equality
operator. Regression tests also verify that valid exclusion constraints
are propagated to the shard tables. And the tests work in different
timezones now.

Fixes citusdata/citus#748 and citusdata/citus#778.
2016-09-21 14:02:42 -04:00
Metin Döşlü a0fa7bf130 Merge pull request #777 from citusdata/remove_pg_toast_from_regression_tests
Remove pg_toast_* references from regression tests
2016-09-10 10:32:02 +03:00
Metin Doslu 35eceb6cca Remove pg_toast_* references from regression tests
pg_toast_* oids are constantly changing, and this causes regression tests to
fail time to time. With this commit, we remove all of the pg_toast_* references
from regression test outputs.
2016-09-09 11:31:51 +03:00
Jason Petersen 9fd6dafe33 Merge pull request #764 from citusdata/feature/allow_multi_ddl_xact_block
Permit multiple DDL commands in a transaction

cr: @marcocitus
2016-09-08 22:50:07 -05:00
Jason Petersen 74f4e0003b
Permit multiple DDL commands in a transaction
Three changes here to get to true multi-statement, multi-relation DDL
transactions (same functionality pre-5.2, with benefits of atomicity):

    1. Changed the multi-shard utility hook to always run (consistency
       with router executor hook, removes ad-hoc "installed" boolean)

    2. Change the global connection list in multi_shard_transaction to
       instead be a hash; update related functions to operate on global
       hash instead of local hash/global list

    3. Remove check within DDL code to prevent subsequent DDL commands;
       place unset/reset guard around call to ConnectToNode to permit
       connecting to additional nodes after DDL transaction has begun

In addition, code has been added to raise an error if a ROLLBACK TO
SAVEPOINT is attempted (similar to router executor), and comprehensive
tests execute all multi-DDL scenarios (full success, user ROLLBACK, any
actual errors (say, duplicate index), partial failure (duplicate index
on one node but not others), partial COMMIT (one node fails), and 2PC
partial PREPARE (one node fails)). Interleavings with other commands
(DML, \copy) are similarly all covered.
2016-09-08 22:35:55 -05:00
Jason Petersen 8b3286b1f5 Merge pull request #773 from citusdata/zombo_final
Add syscols in queries; extend relnames in indexes

cr: @jasonmp85
2016-09-07 11:59:38 -05:00
Eric B. Ridge e80f1612a6
Add syscols in queries; extend relnames in indexes
To permit use with ZomboDB (https://github.com/zombodb/zombodb), two
changes were necessary:

  1. Permit use of `tableoid` system column in queries
  2. Extend relation names appearing in index expressions

The first is accomplished by simply changing the deparse logic to allow
system columns in queries destined for distributed tables. The latter
was slightly more complex, given that DDL extension currently occurs on
workers. But since indexes cannot reference tables other than the one
being indexed, it is safe to look for any relation reference ending in
a '*' character and extend their penultimate segments with a shard id.

This change also adds an error to prevent users from distributing any
relations using the WITH (OIDS) feature, which is unsupported.
2016-09-07 11:54:55 -05:00
Marco Slot 1f15d6b162 Merge pull request #769 from citusdata/feature/partcol
Allow noop updates of the partition column
2016-09-07 17:15:32 +02:00
Marco Slot 6f6cb1a0d6 Allow noop updates of the partition column 2016-09-07 14:22:41 +02:00
Jason Petersen be113e99cc
Add 5.2.1 CHANGELOG entry
Outer join and memory leak fixes
2016-09-06 11:45:37 -05:00
Jason Petersen ed027f060e
Add sort call to shard placement test
The comparator is kind of broken, but I think this is better than the
current state of random failures.
2016-09-06 11:07:27 -05:00
Jason Petersen 0bc3638855 Merge pull request #768 from citusdata/fix/xact_hash_mem_leak
Fix CreateShardConnectionHash memory leak

cr: @jasonmp85
2016-09-06 11:54:54 -04:00
Jason Petersen b3684074f3
Fix CreateShardConnectionHash memory leak
The call to hash_create specified HASH_CONTEXT without actually setting
one using the provided HASHCTL. The hashes returned by this function
are used locally, so simply using CurrentMemoryContext is sufficient.
2016-09-06 10:17:18 -05:00
Metin Döşlü 6333f9ba6f Merge pull request #755 from citusdata/fix_754_add_outer_join_clause_list_check
Add outer join clause list extraction for subquery pushdown logic
2016-09-02 15:01:49 +03:00
Metin Doslu 5b50f2c333 Add complex subquery pushdown regression tests 2016-09-02 14:21:51 +03:00
Metin Doslu 7d212b847f Add outer join clause list extraction for subquery pushdown logic
In subquery pushdown, we allow outer joins if the join condition is on the
partition columns. WhereClauseList() used to return all join conditions including
outer joins. However, this has been changed with a commit related to outer join
support on regular queries. With this commit, we refactored ExtractFromExpressionWalker()
to return two lists of qualifiers. The first list is for inner join and filter
clauses and the second list is for outer join clauses. Therefore, we can also
use outer join clauses to check subquery pushdown prerequisites.
2016-09-02 11:54:44 +03:00
Burak Yücesoy 6d2567f1a2 Merge pull request #762 from citusdata/fix/fix_510_error_out_if_table_to_distribute_has_data
Error out at master_create_distributed_table if the table has any rows
2016-09-01 17:47:29 +03:00
Burak Yucesoy 12d1aba1fc Error out at master_create_distributed_table if the table has any rows
Before this change, we do not check whether given table which already contains any data
in master_create_distributed_table command. If that table contains any data, making it
it distributed, makes that data hidden to user. With this change, we now gave error to
user if the table contains data.
2016-09-01 17:42:47 +03:00