Commit Graph

399 Commits (a342cacfc40c2c42724d7b14144d9859fabe2bbf)

Author SHA1 Message Date
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
Eren Başak 7e511d278e Lowercase \copy to match PostgreSQL's style for local/psql-level functions 2016-08-22 11:31:26 -06:00
Eren Basak d030eb63d1 Replace \stage With \copy on Regression Tests
Fixes #547

This change removes all references to \stage in the regression tests
and puts \COPY instead. Doing so changed shard counts, min/max
values on some test tables (lineitem, orders, etc.).
2016-08-22 11:31:26 -06:00
Robin Thomas 475a6245bf Remove all usage of pg_dist_shard.shardalias in extension code. (#739)
Remove regression test of non-null shardalias.
2016-08-19 17:06:22 +03:00
Jason Petersen 6b8d140d6c Merge pull request #701 from citusdata/fix_inttypes_warnings
Remove HAVE_INTTYPES_H ifdefs

cr: @anarazel
2016-08-18 15:35:11 -06:00
Jason Petersen eb039bd58e Remove HAVE_INTTYPES_H ifdefs
I've been seeing warnings on OS X/clang for a while about these lines
and finally got tired of it. The main problem is that PRIu64 expects a
uint64_t but we were passing a uint64 (a PostgreSQL-defined type). In
PostgreSQL 9.5, we now have INT64_MODIFIER, so can build our own zero-
padded unsigned 64-bit int format modifier that expects a PostgreSQL-
provided uint64 type.

This simplifies the code slightly (no more ifdefs) and gets rid of the
warning that's been annoying me since April (my TODO creation time).
2016-08-18 15:19:53 -06:00
Jason Petersen 23fd254586 Add 5.2.0 CHANGELOG entry
Our longest yet!
2016-08-15 12:55:12 -06:00
Jason Petersen 8e7a567827 Fix Travis local_first_candidate_nodes failures
A recent change to the image used in Travis causes some problems for
the code we use here to ensure the local replica is first. Since this
code is essentially dead in a post-stage world anyhow, we're OK with
ripping out the tests to placate Travis.
2016-08-14 23:12:10 -06:00
Murat Tuncer ed3a442cda Remove a router planner test for materialized view
PostgreSQL 9.5.4 stopped calling planner for materialized view create
command when NO DATA option is provided.

This causes our test to behave differently between pre-9.5.4 and 9.5.4.
2016-08-14 22:57:09 -06:00
Andres Freund 955644bc6c Merge pull request #717 from citusdata/fix-700
Skip over unreferenced parameters when router executing prepared statement.
2016-08-05 14:22:24 -07:00
Andres Freund d6f447884f Skip over unreferenced parameters when router executing prepared statement.
When an unreferenced prepared statement parameter does not explicitly
have a type assigned, we cannot deserialize it, to send to the remote
side.  That commonly happens inside plpgsql functions, where local
variables are passed in as unused prepared statement parameters.
2016-08-05 14:12:06 -07:00
Jason Petersen 2d7355ffe0 Avoid attempting to lock invalid shard identifier
A recent change generates a "dummy" shard placement with its identifier
set to INVALID_SHARD_ID for SELECT queries against distributed tables
with no shards. Normally, no lock is acquired for SELECT statements,
but if all_modifications_commutative is set to true, we will acquire a
shared lock, triggering an assertion failure within LockShardResource
in the above case.

The "dummy" shard placement is actually necessary to ensure such empty
queries have somewhere to execute, and INVALID_SHARD_ID seems the most
appropriate value for the dummy's shard identifier field, so the most
straightforward fix is to just avoid locking invalid shard identifiers.
2016-08-04 13:49:51 -07:00
Jason Petersen 6558853cc8 Pass -Werror during configure/compile/test step
This will fail any Travis builds that introduce warnings.
2016-08-03 14:59:14 -07:00
Jason Petersen 45d2aab32c Check style during Travis CI builds
This bumps the Citus tools to 0.4.0, which include support for adding
a recent (0.6.3) uncrustify to Travis in addition to support for fully
installing Travis scripts to system locations. For brevity, suffixes
have been removed from Travis shell scripts.

The main additional logic here is just ensuring Travis CI gets a newer
uncrustify install and that `citus_indent` is called with the `--check`
flag, which exits with a nonzero status if any files don't comply.
2016-08-02 23:16:30 -07:00
Jason Petersen a6ca17d0a6 Lock tools version 2016-08-02 21:23:02 -07:00