Commit Graph

432 Commits (a533b8e7c116eb8b538cd0080d6e7b15505770d6)

Author SHA1 Message Date
Onder Kalaci a533b8e7c1 Differentiate worker and master job temporary folders
This commit enables to create different worker and master temporary folders.
This change is important for citus-mx on task-tracker execution. In simple words,
on citus-mx, the worker could actually be reponsible for the master tasks as well.
Prior to this change, both master and worker logic on task-tracker executor was
accessing and using the same files for different purposes which was dangerous on
certain cases (i.e., when task_tracker_delay is low).
2016-10-03 14:24:08 +03:00
Jason Petersen a8701841b5 Merge pull request #824 from citusdata/use_lock_tranches
Move task tracker lwlocks into their own tranche

cr: @anarazel
2016-09-30 16:11:11 -06:00
Andres Freund 77efe7fcd4
Move task tracker lwlocks into their own tranche.
RequestAddinLWLocks()/LWLockAssign() are gone in 9.6. Luckily all citus
supported postgres versions support tranches, so use those.
2016-09-30 16:06:49 -06:00
Jason Petersen d52ebffce5 Merge pull request #823 from citusdata/update_postgresql_files
Update PostgreSQL-sourced files with latest changes

cr: @anarazel
2016-09-30 16:06:28 -06:00
Jason Petersen f59cf2b818
Remove references to 9.4
Some still lingered.
2016-09-29 17:35:19 -06:00
Jason Petersen 37631cd132
Remove alternate multi_hash test file
This was made irrelevant by Citus v5.1.0.
2016-09-29 16:43:19 -06:00
Jason Petersen 3046c2b62c
Remove references to PostgreSQL 9.4 support files
No longer extant.
2016-09-29 15:54:38 -06:00
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