Commit Graph

1468 Commits (a4d3002b0493b824d31f5595a0e5baf7a817d77c)

Author SHA1 Message Date
Metin Döşlü a4d3002b04
Merge pull request #1782 from citusdata/warn_on_cluster_command
Warn on CLUSTER command for distributed tables
2017-11-10 11:31:08 +02:00
metdos 111c04c2bd Warn on CLUSTER command for distributed tables 2017-11-10 12:14:45 +02:00
Burak Yücesoy cf7a4ae608
Merge pull request #1774 from citusdata/fix_partitioning_in_schema
Fix attaching partition to a distributed table in schema
2017-11-09 12:49:55 +02:00
Burak Yücesoy 863df0b874
Merge branch 'master' into fix_partitioning_in_schema 2017-11-09 12:49:35 +02:00
Burak Yucesoy 17229ed7bd Fix attaching partition to a distributed table in schema
While attaching a partition to a distributed table in schema, we mistakenly
used unqualified name to find partitioned table's oid. This caused problems
while using partitioned tables with schemas. We are fixing this issue in
this PR.
2017-11-09 13:20:29 +03:00
Önder Kalacı 14ff31704c
Merge pull request #1777 from citusdata/skip_page_locks
Skip page-level locks for distributed deadlock detection
2017-11-09 13:01:21 +03:00
Onder Kalaci 94921a2be1 Skip page-level locks on distributed deadlock detection
Short-term share/exclusive page-level locks are used for
read/write access. Locks are released immediately after
each index row is fetched or inserted.

Since those locks may not lead to any deadlocks, it's safe
to ignore them in the distributed deadlock detection.
2017-11-09 10:37:23 +02:00
Marco Slot a85a973c3e
Merge pull request #1768 from citusdata/sslmode_guc
Add GUC for specifying sslmode in connections to workers
2017-11-08 14:42:26 +01:00
Marco Slot f71728f634 Add GUC for specifying sslmode in connections to workers 2017-11-08 14:15:58 +01:00
Murat Tuncer 4e3d633ebf
Add check for connection failures during multishard update (#1765) 2017-11-07 12:33:25 +02:00
Metin Döşlü 731b1254f9
Merge pull request #1764 from citusdata/relcache_leak
Fix a relcache reference leak in stats collection.
2017-11-07 11:59:00 +02:00
Hadi Moshayedi 6d79d25101 Fix a relcache reference leak in stats collection.
In DistributedTablesSize() we didn't close the relations that had
replication factor > 2. This caused relcache reference leaks, and
warning messages like following in logs:

    WARNING:  relcache reference leak: relation "researchers" not closed
2017-11-06 23:16:43 -05:00
Metin Döşlü 5984e7f009
Merge pull request #1762 from citusdata/check_connection_status
Check connection status before using it
2017-11-06 15:50:37 +02:00
metdos c83edc36b5 Check connection status before using it 2017-11-06 14:53:35 +02:00
Murat Tuncer 2332678793
Fix intermittent test failures on count distinct tests (#1761)
Added analyze to test which seem to force planner to use index.
2017-11-06 10:58:46 +02:00
Brian Cloutier 7be1545843 Support implicit casts during INSERT/SELECT
It's possible to build INSERT SELECT queries which include implicit
casts, currently we attempt to support these by adding explicit casts to
the SELECT query, but this sometimes crashes because we don't update all
nodes with the new types. (SortClauses, for instance)

This commit removes those explicit casts and passes an unmodified SELECT
query to the COPY executor (how we implement INSERT SELECT under the
scenes). In lieu of those cases, COPY has been given some extra logic to
inspect queries, notice that the types don't line up with the table it's
supposed to be inserting into, and "manually" casting every tuple before
sending them to workers.
2017-11-03 22:27:15 -07:00
Metin Döşlü 074ae766de
Merge pull request #1751 from citusdata/build_custom_pg_at_push_builds
Use custom compiled PostgreSQL on push builds
2017-11-03 11:34:07 +02:00
Marco Slot 55baf0e754
Merge pull request #1759 from citusdata/partitioned_tables
Allow distributed partitioned table creation in Cloud
2017-11-03 10:22:22 +01:00
Marco Slot 6883a09cdd Allow distributed partitioned table creation in Cloud 2017-11-03 10:09:18 +01:00
Marco Slot 6219186683 Allow distributed INSERT...SELECT via worker nodes in MX 2017-11-02 14:38:39 +01:00
Burak Yucesoy 3cf1ef06c0 Use custom compiled PostgreSQL on push builds
Previously we compiled PostgreSQL for PR and we used already compiled
PostgreSQL packages for push builds. Compiling PostgreSQL allows us to
run isolation/vanilla tests. Thus we only ran those tests for PR builds.
We did not used compiled PostgreSQL for both builds because;
- We wanted to run our tests against packages
- Compiling takes too much time.

However, there are some benefits in using custom compiled PostgreSQL
in push builds instead of PR builds such as;
- At the moment, we do not run isolation/vanilla tests until we open a
PR, which does not make any sense.
- After merging a PR (i.e. after push to the master) push builds run
and we do not run isolation tests.
- While merging community to enterprise, we have to open a temporary
PR to make travis run isolation/vanilla tests.
- With this change master branch will have its own cache that means
every branch originated from master branch can re-use master branch's
cache. (Currently we cannot use cache for the first PR build)

With this PR we switch from using custom compiled for PR builds to push
builds.
2017-11-01 06:29:59 -07:00
Hadi Moshayedi 7280774cf4 Use list_length() != 1 in SingleReplicatedTable().
ShardPlacementList's implementation can return NIL. In previous implementation
we got a segmentation fault in this case. The relation can be dropped after
getting distributed table list but before calling SingleReplicatedTable().
2017-10-31 21:51:43 -04:00
Hadi Moshayedi 7691991cb5 Do PG_TRY() inside a subtransaction block.
If we don't propagate the errors we are catching in PG_CATCH(), database's
internal state might not be clean. So we do PG_TRY() inside a subtransaction
so we can rollback to it after catching errors.
2017-10-31 21:51:43 -04:00
Hadi Moshayedi 9bfbbf8a04 Make reports hostname configurable and enable stats collection in tests.
This patch adds --with-reports-host configure option, which sets the
REPORTS_BASE_URL constant. The default is reports.citusdata.com.

It also enables stats collection in tests.
2017-10-31 21:51:43 -04:00
Hadi Moshayedi acaf085a80 Add callback function for request by CollectBasicUsageStatistics().
Curl writes the received response to stdout if we don't specify a response
callback or an output file. This can pollute the PostgreSQL log. In this change
we add a callback function so the response messages aren't added to the log file.
2017-10-31 21:51:43 -04:00
Hadi Moshayedi 747e439601 Limit number of stats collection retries to once a day. 2017-10-31 21:51:43 -04:00
Hadi Moshayedi 78a2cd9052 Check for Citus updates.
Sends a request to /v1/releases/latest?flavor=$CITUS_EDITION once a day,
which returns a response similar to {"version": "7.1.0", "major": 7,
"minor": 1, "patch": 0}. Then compares it with current Citus version,
and if the latest release is newer, logs a LOG message.
2017-10-31 21:51:43 -04:00
Hadi Moshayedi 34f3ec0961 Call FlushDistTableCache() before stats collection. 2017-10-31 21:51:43 -04:00
Hadi Moshayedi c18c6625d9 Lock relations before calling citus_table_size().
This is to make sure they don't get dropped.
2017-10-31 21:51:43 -04:00
Hadi Moshayedi 97d544b75c Follow the patterns used in Deadlock Detection in Stats Collection.
This includes:

(1) Wrap everything inside a StartTransactionCommand()/CommitTransactionCommand().
This is so we can access the database. This also switches to a new memory context
and releases it, so we don't have to do our own memory management.

(2) LockCitusExtension() so the extension cannot be dropped or created concurrently.

(3) Check CitusHasBeenLoaded() && CheckCitusVersion() before doing any work.

(4) Do not PG_TRY() inside a loop.
2017-10-31 21:51:43 -04:00
Marco Slot 100aaeb3f5 Fix typo in distributed deadlock error message 2017-10-31 19:39:32 +01:00
Metin Döşlü d7171838d7
Merge pull request #1749 from citusdata/fix_reference_table_insert_into_select
Don't try to add restrictions for reference tables in insert into select
2017-10-31 19:01:36 +02:00
metdos 8c356b2bc8 Don't try to add restrictions for reference tables in insert into select 2017-10-31 19:44:10 +02:00
Mehmet Furkan ŞAHİN ca24713b1a
Merge pull request #1739 from citusdata/add_const_prim_key_using_ind
Add constraint %s primary key using index %s support
2017-10-31 16:16:49 +03:00
mehmet furkan şahin 32fb19911c Add Constraint %s Add Primary Key Using index %s support
This commit makes a change in relay_event_utility.c to check if the
Alter Table command adds a constraint using index. If this is the
case, it appends the shard id to the index name.
2017-10-31 16:03:56 +03:00
Marco Slot c69d8bf4a6
Merge pull request #1743 from citusdata/add_shard_move_mode_param
Add shard transfer mode parameter to shard copy functions
2017-10-31 13:54:37 +01:00
Marco Slot 7e34348334 Add shard transfer mode parameter to shard copy functions 2017-10-31 13:30:48 +01:00
Marco Slot bc3bdeaac8
Merge pull request #1737 from citusdata/fix_writeability_checks
Fix issues in WaitForAllConnections
2017-10-31 13:16:06 +01:00
Marco Slot 2bb46bb5ee Reset connectionReady flag after moving a connection in WaitForAllConnections 2017-10-31 12:06:53 +01:00
Marco Slot e6e6897499 Defer initial PQflush to main loop in WaitForAllConnections 2017-10-31 12:06:53 +01:00
Marco Slot d6dadb1b25 Use correct index for ModifyWaitEvent in WaitForAllConnections 2017-10-31 12:06:53 +01:00
Mehmet Furkan ŞAHİN d85a3952f5
Merge pull request #1734 from citusdata/create_table_replica_identity
create_distributed_table minds the replica identity
2017-10-31 13:31:28 +03:00
Furkan Sahin 2b39c52f0b Replica identity on create_distributed_table
By this commit, citus minds the replica identity of the table when
we distribute the table. So the shards of the distributed table
have the same replica identity with the local table.
2017-10-31 13:08:36 +03:00
Marco Slot 5661062a69
Merge pull request #1687 from citusdata/omit_public_shard_name
Omit public schema from shard_name output
2017-10-31 09:33:48 +01:00
Marco Slot 7f68f78ee9 Omit public schema from shard_name output 2017-10-31 00:22:07 +01:00
Murat Tuncer e16805215d
Support count(distinct) for non-partition columns (#1692)
Expands count distinct coverage by allowing more cases. We used to support
count distinct only if we can push down distinct aggregate to worker query
i.e. the count distinct clause was on the partition column of the table,
or there was a grouping on the partition column.

Now we can support
- non-partition columns, with or without grouping on partition column
- partition, and non partition column in the same query
- having clause
- single table subqueries
- insert into select queries
- join queries where count distinct is on partition, or non-partition column
- filters on count distinct clauses (extends existing support)

We first try to push down aggregate to worker query (original case), if we
can't then we modify worker query to return distinct columns to coordinator
node. We do that by adding distinct column targets to group by clauses. Then
we perform count distinct operation on the coordinator node.

This work should reduce the cases where HLL is used as it can address anything
that HLL can. However, if we start having performance issues due to very large
number rows, then we can recommend hll use.
2017-10-30 13:12:24 +02:00
Marco Slot 6bb4cf998e Merge pull request #1725 from citusdata/restore_point_2pc
Block only 2PCs instead of all writes in citus_create_restore_point
2017-10-27 00:19:54 +02:00
Marco Slot be46661bf7 Block only 2PCs instead of all writes in citus_create_restore_point 2017-10-27 00:07:32 +02:00
Mehmet Furkan ŞAHİN 58a511a791 Merge pull request #1731 from citusdata/alter_table_replication_identity
ALTER TABLE .. REPLICA IDENTITY support is implemented
2017-10-26 14:18:18 +03:00
mehmet furkan şahin 83ac84d594 order by and unnest are added to multi_colocation_utils tests 2017-10-26 13:44:28 +03:00