Commit Graph

2253 Commits (1b1c6374f7ecb2784090f15b7f9cb1584f28dda8)

Author SHA1 Message Date
Brian Cloutier a54f9a6d2c network proxy-based failure testing
- Lots of detail is in src/test/regress/mitmscripts/README
- Create a new target, make check-failure, which runs tests
- Tells travis how to install everything and run the tests
2018-07-06 12:38:53 -07:00
Burak Velioglu c6cf40e9c7
Merge pull request #2261 from citusdata/changelog_6-2-6
Add changelog entry for 6.2.6
2018-07-06 15:37:22 +03:00
velioglu a7200d557d Add changelog entry for 6.2.6 2018-07-06 15:24:01 +03:00
velioglu 76477fd44e Revert "Add changelog entry for 6.2.5"
This reverts commit 50807bca98.
2018-07-06 15:23:03 +03:00
Burak Velioglu 30fa6e57a4
Merge pull request #2260 from citusdata/changelog_6-2-5
Add changelog entry for 6.2.5
2018-07-06 15:14:43 +03:00
velioglu 50807bca98 Add changelog entry for 6.2.5 2018-07-06 14:58:38 +03:00
Murat Tuncer cdbe752e2d
Merge pull request #2255 from citusdata/relax_count_distinct
Expand count distinct support
2018-07-06 11:44:38 +03:00
Murat Tuncer f20258ef10 Expand count distinct support
We can now support more complex count distinct operations by
pulling necessary columns to coordinator and evalutating the
aggreage at coordinator.

It supports broad range of expression with the restriction that
the expression must contain a column.
2018-07-06 09:44:20 +03:00
Önder Kalacı 80132b5481
Merge pull request #2253 from citusdata/improve_foreign_keys_code
Some stylistic improvements in the foreign keys to reference table changes
2018-07-06 00:51:15 +03:00
Onder Kalaci 7fb529aab9 Some stylistic improvements in the foreign keys to reference table
changes.
2018-07-05 23:23:34 +03:00
Marco Slot 6656592b8e
Merge pull request #2243 from citusdata/better-guc-description
Remove sslmode structs and add more helpful description
2018-07-05 14:33:05 +02:00
Brian Cloutier 735218ee5d Remove sslmode structs and add more helpful description 2018-07-05 14:12:36 +02:00
Nils Dijk 1bff1c2d3d
Merge pull request #2254 from citusdata/feature/policy-stub
create placeholder for policy ddl
2018-07-05 12:45:35 +02:00
Nils Dijk c1c8c38dc9 create placeholder for policy ddl 2018-07-05 11:07:01 +02:00
Mehmet Furkan ŞAHİN 19e92ee369
Merge pull request #2186 from citusdata/hll_agg_support
Hll aggregate support
2018-07-05 10:42:00 +03:00
mehmet furkan şahin df11dda750 hll aggregates are tested 2018-07-05 08:19:01 +03:00
mehmet furkan şahin 06217be326 hll aggregate functions are supported natively 2018-07-04 16:41:09 +03:00
Marco Slot 0c33d7ea9a
Merge pull request #2251 from citusdata/landlord_base
Move partition key logging related code from enterprise
2018-07-04 12:34:28 +02:00
Murat Tuncer 901066a421 Move partition key logging related code from enterprise 2018-07-04 13:11:34 +03:00
Mehmet Furkan ŞAHİN b480bf8d0e
Merge pull request #2240 from citusdata/foreign_master
Foreign Key support from distributed to reference tables
2018-07-03 17:55:59 +03:00
mehmet furkan şahin f7b901e3fd CopyShardForeignConstraintCommandList API change for grouped constraints 2018-07-03 17:05:55 +03:00
mehmet furkan şahin 35eac2318d lock referenced reference table metadata is added
For certain operations in enterprise, we need to lock the
referenced reference table shard distribution metadata
2018-07-03 17:05:55 +03:00
Onder Kalaci d83be3a33f Enforce foreign key restrictions inside transaction blocks
When a hash distributed table have a foreign key to a reference
table, there are few restrictions we have to apply in order to
prevent distributed deadlocks or reading wrong results.

The necessity to apply the restrictions arise from cascading
nature of foreign keys. When a foreign key on a reference table
cascades to a distributed table, a single operation over a single
connection can acquire locks on multiple shards of the distributed
table. Thus, any parallel operation on that distributed table, in the
same transaction should not open parallel connections to the shards.
Otherwise, we'd either end-up with a self-distributed deadlock or
read wrong results.

As briefly described above, the restrictions that we apply is done
by tracking the distributed/reference relation accesses inside
transaction blocks, and act accordingly when necessary.

The two main rules are as follows:
   - Whenever a parallel distributed relation access conflicts
     with a consecutive reference relation access, Citus errors
     out
   - Whenever a reference relation access is followed by a
     conflicting parallel relation access, the execution mode
     is switched to sequential mode.

There are also some other notes to mention:
   - If the user does SET LOCAL citus.multi_shard_modify_mode
     TO 'sequential';, all the queries should simply work with
     using one connection per worker and sequentially executing
     the commands. That's obviously a slower approach than Citus'
     usual parallel execution. However, we've at least have a way
     to run all commands successfully.

   - If an unrelated parallel query executed on any distributed
     table, we cannot switch to sequential mode. Because, the essense
     of sequential mode is using one connection per worker. However,
     in the presence of a parallel connection, the connection manager
     picks those connections to execute the commands. That contradicts
     with our purpose, thus we error out.

   - COPY to a distributed table cannot be executed in sequential mode.
     Thus, if we switch to sequential mode and COPY is executed, the
     operation fails and there is currently no way of implementing that.
     Note that, when the local table is not empty and create_distributed_table
     is used, citus uses COPY internally. Thus, in those cases,
     create_distributed_table() will also fail.

   - There is a GUC called citus.enforce_foreign_key_restrictions
     to disable all the checks. We added that GUC since the restrictions
     we apply is sometimes a bit more restrictive than its necessary.
     The user might want to relax those. Similarly, if you don't have
     CASCADEing reference tables, you might consider disabling all the
     checks.
2018-07-03 17:05:55 +03:00
velioglu 6be6911ed9 Create foreign key relation graph and functions to query on it 2018-07-03 17:05:55 +03:00
mehmet furkan şahin 89a8d6ab95 FK from dist to ref is tested for partitioning, MX 2018-07-03 17:05:55 +03:00
mehmet furkan şahin 4db72c99f6 Specific DDLs are sequentialized when there is FK
-[x] drop constraint
-[x] drop column
-[x] alter column type
-[x] truncate

are sequentialized if there is a foreign constraint from
a distributed table to a reference table on the affected relations
by the above commands.
2018-07-03 17:05:55 +03:00
mehmet furkan şahin e37f76c276 tests are added 2018-07-03 17:05:01 +03:00
mehmet furkan şahin 2c5d59f3a8 create_distributed_table in transaction is fixed 2018-07-03 17:05:01 +03:00
mehmet furkan şahin 45f8017f42 create_distributed_table with fk to ref table is implemented 2018-07-03 17:05:01 +03:00
mehmet furkan şahin 2fa4e38841 FK from dist to ref can be added with alter table 2018-07-03 17:05:01 +03:00
Murat Tuncer 58486fd1b9
Merge pull request #2247 from citusdata/enable_preloading_libraries
Add pg_stat_statements to shared_preload_libraries if installed
2018-07-03 16:59:34 +03:00
Murat Tuncer 3fc98e8225 Add pg_stat_statements to shared_preload_libraries if installed 2018-07-03 16:33:15 +03:00
Murat Tuncer 54aa865c3c
Merge pull request #2249 from citusdata/landlord_base
Update citus_stat_statements view and regression tests
2018-07-03 16:32:47 +03:00
Murat Tuncer 23800f50f1 Update citus_stat_statements view and regression tests 2018-07-03 16:14:13 +03:00
Murat Tuncer 493e3b1b9e
Merge pull request #2248 from citusdata/partition_key_extraction_fix
Strip implicit coercions when determining partition key value of an INSERT
2018-07-02 18:21:16 +03:00
Murat Tuncer e532755a6e Fix bug in partition column extraction
added strip_implicit_coercion prior to
checking if the expression is Const.
This is important to find values for types
like bigint.
2018-07-02 18:08:16 +03:00
Murat Tuncer a3f1350bfe
Merge pull request #2246 from citusdata/bump-tools-version
Bump tools version in .travis.yml
2018-07-02 15:44:36 +03:00
Burak Yucesoy 06589131d7 Bump tools version in .travis.yml
To be able to test landlord in travis, we need pg_stat_statements from
contrib packages. New tools version, 0.7.8, installs pg_stat_statements
too, so we are switching to version 0.7.8 in our travis tests.
2018-07-02 14:55:23 +03:00
Murat Tuncer 1c95d5d497
Merge pull request #2242 from citusdata/master_stage_protocol_refactoring
Apply master_stage_protocol refactoring changes
2018-06-28 14:23:48 +03:00
Murat Tuncer 3fc7cdfe6d Apply master_stage_protocol refactoring changes 2018-06-28 11:24:57 +03:00
Murat Tuncer 86a3dd5a90
Merge pull request #2235 from citusdata/landlord_base
Add groundwork for citus_stat_statements api
2018-06-27 14:47:18 +03:00
Murat Tuncer 4d35b92016 Add groundwork for citus_stat_statements api 2018-06-27 14:20:03 +03:00
Brian Cloutier 5ce18327a7 Don't spinloop when trying to cleanup a failed connection 2018-06-26 13:13:34 -07:00
Önder Kalacı d63cbf3822
Merge pull request #2220 from citusdata/relation_access_via_placement_access
Track relation accesses using the connection management infrastructure
2018-06-25 22:52:57 +03:00
Onder Kalaci 4ccabf9544 Increase timeout to keep appveyor happy 2018-06-25 18:40:40 +03:00
Onder Kalaci 7d0f7835e7 Improve relation accesses association to do less job 2018-06-25 18:40:40 +03:00
Onder Kalaci 8ccb8b679e Real-time executor marks multi shard relation accesses before opening connections 2018-06-25 18:40:31 +03:00
Onder Kalaci 2890154420 Make sure that TRUNCATE always opens a DDL access 2018-06-25 18:40:31 +03:00
Onder Kalaci 21038f0d0e Make sure that inter-shard DDL commands are always covers both tables 2018-06-25 18:40:30 +03:00
Onder Kalaci 2f01894589 Track relation accesses using the connection management infrastructure 2018-06-25 18:40:30 +03:00