Commit Graph

3744 Commits (fix-repartition-join-single-node)

Author SHA1 Message Date
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
Jason Petersen 7168fdf62e 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 850c51947a
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ü adf992324a 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 75618fc3fb Return false in MultiClientQueryResult() on failing query 2016-08-29 17:05:35 +03:00
Brian Cloutier 33973d9f20 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 4ecd6b58fb Remove csql, \stage is no longer needed 2016-08-26 10:41:59 +03:00
Brian Cloutier 640bb8863b Remove check-multi-fdw tests, nobody uses Citus with fdws 2016-08-26 10:41:33 +03:00
Brian Cloutier 2758af8f83 Bump tools version, to make list of tests travis runs explicit & configurable 2016-08-26 10:38:12 +03:00
Jason Petersen 2c87244ed4 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 e54d3f6d32
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 b391abda3d
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 35e9f51348
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 0322916700
Lowercase \copy to match PostgreSQL's style for local/psql-level functions 2016-08-22 11:31:26 -06:00
Eren Basak b513f1c911
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 010cbf16fc 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 b4e6dc16d3 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 91578ff149
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 b59ab75e2b
Add 5.2.0 CHANGELOG entry
Our longest yet!
2016-08-15 12:55:12 -06:00
Jason Petersen 900f7590ab
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 3a49cf830e
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 3ea352e5f9 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 7fdb5fbe29 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 eba8396501
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 ccc32f9da8
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 3a8534eb21
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 6be5217872
Lock tools version 2016-08-02 21:23:02 -07:00
Metin Doslu 3ff1877108
Bump version numbers for 5.2 release 2016-08-01 13:48:24 -07:00
Marco Slot ae7bcfff45 Merge pull request #670 from citusdata/bugfix/empty_stage
Improve WorkerShardStats to avoid invalid value bugs
2016-07-29 20:17:08 +02:00
Marco Slot 9705cbcdf8 Rewrite WorkerShardStats to avoid invalid value bugs 2016-07-29 20:11:18 +02:00
Marco Slot 5e432449ba Add MultiClientExecute and MultiClientValueIsNull for simple remote query execution 2016-07-29 20:07:18 +02:00
Andres Freund ea2c2f096a Merge pull request #677 from citusdata/fix-674
Don't access pg_dist_partition->partkey directly, use heap_getattr().
2016-07-29 10:14:38 -07:00