Commit Graph

413 Commits (b7d4f99d804dc20b57ff280c5aace14f6d9e5b42)

Author SHA1 Message Date
Murat Tuncer b7d4f99d80 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 ba3d035b23 Make where false queries router plannable 2016-09-28 18:49:26 +03:00
Murat Tuncer 49495f2ed2 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 3ef841c67b Add UDF master_expire_table_cache 2016-09-28 12:08:37 +03:00
Jason Petersen b029ef7a5d 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 f9e63097c9 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ü 33b91bbf8e 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 db64995353 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 5047f325db 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 5e01434402 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 6708d0d59f 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 fb74e08fa5 Add tests with spaces in table names 2016-09-26 18:23:43 -06:00
Murat Tuncer 680fab2b67 Remove extra space 2016-09-26 18:23:43 -06:00
Murat Tuncer 25a95d57f8 Refactor SendQueryToPlacements api 2016-09-26 18:23:43 -06:00
Murat Tuncer a342cacfc4 Address feedback 2016-09-26 18:23:42 -06:00
Murat Tuncer 66069ed610 Fix regression test failures after rebase 2016-09-26 18:23:42 -06:00
Murat Tuncer 4416b77088 Add support for truncate statement 2016-09-26 18:23:42 -06:00
Marco Slot 62c65e661b 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 a2276adcd2 Fix segmentation fault in case of joins with WHERE 1=0 2016-09-26 15:12:29 +02:00
Eren Başak 9bbba8a12c 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 6880efce5b 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ü e381b21cc5 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 80a833aeb3 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 c2b07dccab 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 b00b15a718 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 c7d5f4fd6a 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 361e37f921 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 ef7e99d967 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 575bc99be5 Allow noop updates of the partition column 2016-09-07 14:22:41 +02:00
Jason Petersen 3388a29907 Add 5.2.1 CHANGELOG entry
Outer join and memory leak fixes
2016-09-06 11:45:37 -05:00
Jason Petersen 407533d0f9 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 6599036b60 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 355e503ff9 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ü 7b013f13e5 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 2a8b2f6a99 Add complex subquery pushdown regression tests 2016-09-02 14:21:51 +03:00
Metin Doslu 60d67a39f1 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 e5f4eaf0f4 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 619ec529d4 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
Jason Petersen b6b6508253 Merge pull request #707 from citusdata/feature/allow_single_ddl_xact_block
Permit single DDL commands in transaction blocks

cr: @marcocitus
2016-08-31 10:44:45 -06:00
Jason Petersen c684ac11ec Re-permit DDL in transactions, selectively
Recent changes to DDL and transaction logic resulted in a "regression"
from the viewpoint of users. Previously, DDL commands were allowed in
multi-command transaction blocks, though they were not processed in any
actual transactional manner. We improved the atomicity of our DDL code,
but added a restriction that DDL commands themselves must not occur in
any BEGIN/END transaction block.

To give users back the original functionality (and improved atomicity)
we now keep track of whether a multi-command transaction has modified
data (DML) or schema (DDL). Interleaving the two modification types in
a single transaction is disallowed.

This first step simply permits a single DDL command in such a block,
admittedly an incomplete solution, but one which will permit us to add
full multi-DDL command support in a subsequent commit.
2016-08-30 20:37:19 -06:00
Metin Döşlü a3bb891dab Merge pull request #757 from citusdata/fix_MultiClientQueryResult
Return false in MultiClientQueryResult() on failing query
2016-08-29 17:44:58 +03:00
Metin Doslu f1bab608c1 Return false in MultiClientQueryResult() on failing query 2016-08-29 17:05:35 +03:00
Brian Cloutier 2085002a94 Merge pull request #737 from citusdata/622-remove-csql
Remove csql, remove multi-check-fdw tests, and bump citusdata/tools version that travis uses to v0.4.1
2016-08-26 11:34:19 +03:00
Brian Cloutier a76041106e Remove csql, \stage is no longer needed 2016-08-26 10:41:59 +03:00
Brian Cloutier 24bd08d287 Remove check-multi-fdw tests, nobody uses Citus with fdws 2016-08-26 10:41:33 +03:00
Brian Cloutier f2e64a141f Bump tools version, to make list of tests travis runs explicit & configurable 2016-08-26 10:38:12 +03:00
Jason Petersen 2e76ceed75 Merge pull request #630 from citusdata/replace_stage_with_copy_in_tests
Replace \stage With \copy in Regression Tests

cr: @jasonmp85
2016-08-22 13:41:10 -06:00
Jason Petersen 1ed9871ead Rename test files with 'stage' in name
Ignored FDW files as those test are being removed entirely, I believe.
2016-08-22 13:32:53 -06:00
Jason Petersen 945ce21320 Replace verb 'stage' with 'load' in test comments
"Staging table" will be the only valid use of 'stage' from now on, we
will now say "load" when talking about data ingestion. If creation of
shards is its own step, we'll just say "shard creation".
2016-08-22 13:24:18 -06:00
Jason Petersen 1500438313 Replace verb 'stage' with 'load' in schedules
"Staging table" will be the only valid use of 'stage' from now on.
2016-08-22 11:48:41 -06:00