Commit Graph

6740 Commits (7e0dc18b22b71b16a3b418d7c2c2d86d65bff8a2)

Author SHA1 Message Date
Andres Freund 0a1c8723c4
Fix make install for VPATH builds.
copy_to_distributed_table is in the source, not the build directory. As
there might be scripts in either at some point, install scripts from
both.
2016-02-17 16:48:06 -07:00
Marco Slot 9e944fbcfc Merge pull request #326 from citusdata/feature/drop_shards_on_drop_table
Drop shards when a distributed table is dropped
2016-02-17 23:47:49 +01:00
Marco Slot 71af0e496e Rename citusdb to citus in regression test output 2016-02-17 23:33:30 +01:00
Marco Slot 75a141a7c6 Merge remote-tracking branch 'origin/master' into feature/drop_shards_on_drop_table 2016-02-17 22:52:58 +01:00
Marco Slot 9aa1f1e1e7 Rename topLevel variable to isTopLevel 2016-02-17 22:52:35 +01:00
Jason Petersen 1d0a6506fd Merge pull request #339 from citusdata/use_default_staging#323
Change tests to use default staging policy

cr: @metdos
2016-02-17 11:14:21 -07:00
Jason Petersen ec1e74e7f9
Change tests to use default staging policy
The default staging policy is now round-robin, though tests were still
configured to use local-first. Testing with the shipping default seems
like the best option, correctness-wise, and since local-first has some
issues with OSes where connecting from localhost doesn't always resolve
to 'localhost', just going with the default is a win-win.
2016-02-17 11:03:17 -07:00
Murat Tuncer 6d4fb39f91 Merge pull request #349 from citusdata/feature/citusdb-to-citus
Change product name to Citus (cont)
2016-02-17 17:53:02 +02:00
Murat Tuncer df5851366c Fixed merge leftovers 2016-02-17 15:44:24 +02:00
Murat Tuncer 5fb1fabc21 Merge pull request #337 from citusdata/feature/citusdb-to-citus
Change product name to citus
2016-02-17 15:24:22 +02:00
Murat Tuncer 3528d7ce85 Merge from master branch into feature/citusdb-to-citus 2016-02-17 14:49:01 +02:00
Metin Döşlü 39b333996b Merge pull request #335 from citusdata/check_count_distinct_on_single_subquery
Check count distinct on single subquery
2016-02-17 14:37:11 +02:00
Metin Doslu 6123022ca7 Add check for count distinct on single table subqueries
Fixes #314
2016-02-17 14:24:07 +02:00
Murat Tuncer 2160a2951b Merge pull request #334 from citusdata/feature/append_table_to_shard
Add support for appending to cstore table shards
2016-02-17 09:19:33 +02:00
Jason Petersen 8ad5b09251 Merge pull request #344 from citusdata/fix_shard_lock_acquisition#342
Ensure router executor acquires proper shard lock

cr: @onderkalaci
2016-02-16 16:43:39 -07:00
Jason Petersen 2fcfa011ae Merge pull request #327 from citusdata/apply_formatting_tool
Apply Citus Data coding conventions

cr: @sumedhpathak @anarazel
2016-02-16 12:24:42 -07:00
Jason Petersen 622eb29996
Add make targets for applying and checking style
Need to change to the project's top srcdir, as citus_indent expects to
be able to find styled files using git ls-files, and VPATH builds would
otherwise not return any results.
2016-02-16 12:04:06 -07:00
Jason Petersen 0d196d1bf4
Ensure router executor acquires proper shard lock
Though Citus' Task struct has a shardId field, it doesn't have the same
semantics as the one previously used in pg_shard code. The analogous
field in the Citus Task is anchorShardId. I've also added an argument
check to the relevant locking function to catch future locking attempts
which pass an invalid argument.
2016-02-16 11:20:18 -07:00
Marco Slot 37f580f9c7 Trim comment about invalidating dropped relations 2016-02-16 14:04:12 +01:00
Marco Slot 2af6797c04 Perform relcache invalidation in CitusInvalidateRelcacheByRelid 2016-02-16 12:59:38 +01:00
Murat Tuncer 444f305165 Add support for appending to cstore table shards
- Flexed the check which prevented append operation cstore tables
  since its storage type is not SHARD_STORAGE_TABLE.
- Used process utility function to perform copy operation in
  worker_append_table_to shard() instead of directly calling
  postgresql DoCopy().
- Removed the additional check in master_create_empty_shard() function.
  This check was redundant and erroneous since it was called after
  CheckDistributedTable() call.
- Modified WorkerTableSize() function to retrieve cstore table shard
  size correctly.
2016-02-16 13:58:39 +02:00
Marco Slot 52f11223e5 Drop shards when a distributed table is dropped
After this change, shards and associated metadata are automatically
dropped when running DROP TABLE on a distributed table, which fixes #230.
It also adds schema support for master_apply_delete_command, which
fixes #73.

Dropping the shards happens in the master_drop_all_shards UDF, which is
called from the SQL_DROP trigger. Inside the trigger, the table is no
longer visible and calling master_apply_delete_command directly wouldn't
work and oid <-> name mappings are not available. The
master_drop_all_shards function therefore takes the relation id, schema
name, and table name as parameters, which can be obtained from
pg_event_trigger_dropped_objects() in the SQL_DROP trigger. If the user
calls master_drop_all_shards while the table still exists, the schema
name and table name are ignored.

Author: Marco Slot
Reviewed-By: Andres Freund
2016-02-16 10:54:29 +01:00
Jason Petersen 20c68fe251
Switch to using git attributes to ignore files
Ties into the script introduced [here][1].

[1]: https://github.com/citusdata/tools/pull/2
2016-02-15 23:41:51 -07:00
Jason Petersen 920e0c406d
Format csql's stage files
These are entirely Citus-produced, so need full formatting.
2016-02-15 23:37:37 -07:00
Jason Petersen 19c529f311
Omit most of copy_options from formatting
Only a small portion is Citus style.
2016-02-15 23:37:37 -07:00
Jason Petersen 2b5ae847d4
Make copy_options.ch similar to PostgreSQL copy.c
We reorganized these functions in our copy; not sure why (makes diffing
harder). I'm moving it back.
2016-02-15 23:37:37 -07:00
Jason Petersen bc23113732
Omit backend/copy.c-inspired parts from formatting
I think we need to assess whether this function is still as in-sync
with upstream as we believe, but for now I'm omitting it from formatting.
2016-02-15 23:29:33 -07:00
Jason Petersen 74372f70e0
Omit get_extension_schema from formatting
It exactly matches the implementation in extension.c.
2016-02-15 23:29:33 -07:00
Jason Petersen f874a56e24
Omit RangeVarCallbackForDropIndex from formatting
I removed two braces to have this function remain more similar to the
original PostgreSQL function and added uncrustify commands to disable
formatting of its contents.
2016-02-15 23:29:33 -07:00
Jason Petersen fdb37682b2
First formatting attempt
Skipped csql, ruleutils, readfuncs, and functions obviously copied from
PostgreSQL. Seeing how this looks, then continuing.
2016-02-15 23:29:32 -07:00
Murat Tuncer 55c44b48dd Changed product name to citus
All citusdb references in
- extension, binary names
- file headers
- all configuration name prefixes
- error/warning messages
- some functions names
- regression tests

are changed to be citus.
2016-02-15 16:04:31 +02:00
Jason Petersen 334f800016 Merge pull request #329 from citusdata/feature-fix_naming_conflicts#236
Rename GetConnection to address name conflict

cr: @onderkalaci
2016-02-12 16:58:33 -07:00
Jason Petersen 4494e57bbd
Rename GetConnection to address name conflict
The postgres_fdw extension has an extern function with an identical
signature, which can cause problems when both extensions are loaded.
A simple rename can fix this for now (this is the only function with)
such a conflict.
2016-02-12 13:35:02 -07:00
Önder Kalacı a55287411b Merge pull request #332 from citusdata/bugfix/memory_context_leak
Remove unnecessary memory context switch on the planner
2016-02-12 11:13:12 -08:00
Onder Kalaci 0a6839e544 Perform distributed planning in the calling memory context
Previously we used, for historical reasons, MessageContext.
That is problematic if a single message from the client
causes a lot of statements to be planned. E.g. for the
copy_to_distributed_table script one insert statement
is planned for each row inserted via COPY, and only freed
when COPY has finished.
2016-02-12 20:50:40 +02:00
Jason Petersen b1ef2e59a2 Merge pull request #331 from citusdata/feature-permit_dml_to_append_tables#321
Allow DML commands on append-partitioned tables

cr: @lithp
2016-02-12 11:24:06 -07:00
Jason Petersen 5028f61a47 Merge pull request #328 from citusdata/feature-fix_varchar#201
Handle hash-partitioned aliased data types

cr: @marcocitus
2016-02-12 10:04:57 -07:00
Jason Petersen 6f308c5e2d
Allow DML commands on append-partitioned tables
This entirely removes any restriction on the type of partitioning
during DML planning and execution. Though there aren't actually any
technical limitations preventing DML commands against append- (or even
range-) partitioned tables, we had initially forbidden this, as any
future stage operation could cause shards to overlap, banning all
subsequent DML operations to partition values contained within more
than one shards. This ended up mostly restricting us, so we're now
removing that restriction.
2016-02-11 16:09:35 -07:00
Jason Petersen d164305929
Handle hash-partitioned aliased data types
When two data types have the same binary representation, PostgreSQL may
add an implicit coercion between them by wrapping a node in a relabel
type. This wrapper signals that the wrapped value is completely binary
compatible with the designated "final type" of the relabel node. As an
example, the varchar type is often relabeled to text, since functions
provided for use with text (comparisons, hashes, etc.) are completely
compatible with varchar as well.

The hash-partitioned codepath contains functions that verify queries
actually contain an equality constraint on the partition column, but
those functions expect such constraints to be comparison operations
between a Var and Const. The RelabelType wrapper node causes these
functions to always return false, which bypasses shard pruning.
2016-02-11 13:50:43 -07:00
Onder Kalaci 136306a1fe Initial commit of Citus 5.0 2016-02-11 04:05:32 +02:00