Commit Graph

2125 Commits (b15d1eee62a7619a6d265bee36b369cef1141917)

Author SHA1 Message Date
Sumedh Pathak b15d1eee62
Update Contributing to install PG10 instead of 9.6 (#2436)
* Update Contributing to note PG10 install

* Updated suggested link to PG10
2018-10-16 12:31:17 -07:00
Hadi Moshayedi 431ac80563
Keep track of cached entries in case of interruption. (#2433)
* Keep track of cached entries in case of interruption.

Previously we set DistTableCacheEntry->sortedShardIntervalArray
and DistTableCacheEntry->shardIntervalArrayLength after we entered
all related shard entries into DistShardCacheHash. The drawback was
that if populating DistShardCacheHash was interrupted,
ResetDistTableCacheEntry() didn't see the shard hash entries created,
so was unable to clean them up.

This patch fixes that by setting sortedShardIntervalArray earlier,
and incrementing shardIntervalArrayLength as we enter shards into
the cache.
2018-10-15 14:06:56 -04:00
Marco Slot a9f183a284
Merge pull request #2432 from citusdata/fix_typos
Fix user-facing typos
2018-10-10 14:25:59 -07:00
Jason Petersen 9fb951c312
Fix user-facing typos
Lintian found these (presumably by looking in the text section and
running them through e.g. aspell).
2018-10-09 16:54:03 -07:00
Burak Velioglu 8b9aeb374b
Merge pull request #2425 from citusdata/real-time-select-failure
Add failure tests for real time select queries
2018-10-09 14:27:45 -07:00
velioglu 5713019058 Add failure tests for real time select queries 2018-10-09 14:12:02 -07:00
Önder Kalacı d5ebf22ba1
Merge pull request #2424 from citusdata/clear_intermediate_results
Make sure not to leak intermediate result folders on the workers
2018-10-09 23:50:27 +03:00
Onder Kalaci 73696a03e4 Make sure not to leak intermediate result folders on the workers 2018-10-09 22:47:56 +03:00
Marco Slot 5886e69a3a
Merge pull request #2423 from citusdata/writable_standby_coordinator
Allow simple DML commands from hot standby
2018-10-09 11:43:08 -07:00
Jason Petersen 1cb48416eb
Add reference table failure tests
Fairly straightforward; verified that modifications fail atomically if
a worker is down or fails mid-transaction (i.e. all workers need to ack
modifications to reference tables in order to persist changes).
2018-10-09 09:39:30 -07:00
Jason Petersen 9bcf2873a7
Add single-shard router select failure tests
Including several examples from #1926. I couldn't understand why the
recover_prepared_transactions "should be an error", and EXPLAIN has
changed since the original bug (so that it runs EXPLAINs in txns, I
think for EXPLAIN ANALYZE to not have side effects); other than that,
most of the reported bugs now error out rather than crash or return
an empty result set.
2018-10-09 08:51:10 -07:00
Jason Petersen 8f2aa00951
Add failure tests for VACUUM/ANALYZE
VACUUM runs outside of a transaction, so the failure modes for it are
somewhat straightforward, though ANALYZE runs in a 1pc transaction and
multi-table VACUUM can fail between statements (PG 11 and higher).
2018-10-09 08:50:37 -07:00
Jason Petersen ee4114bc7a Failure tests for modifying multiple shards in txn
Tests various failure points during a multi-shard modification within
a transaction with multiple statements. Verifies three cases:

  * Reference tables (single shard, many placements)
  * Normal table with replication factor two
  * Multi-shard table with no replication

In the replication-factor case, we expect shard health to be affected
in some transactions; most others fail the transaction entirely and
all we need verify is that no effects of the transaction are visible.

Had trouble testing the final PREPARE/COMMIT/ROLLBACK phase of the 2pc,
in particular because the error message produced includes the PID of
the backend, which is unpredictable.
2018-10-09 09:17:32 -06:00
Murat Tuncer b45754a4d0
Merge pull request #2428 from citusdata/fix_mx_drop_schema_with_partitions
Fix drop schema in mx with partitioned tables
2018-10-09 03:50:32 +03:00
Murat Tuncer 4f8042085c Fix drop schema in mx with partitioned tables
Drop schema command fails in mx mode if there
is a partitioned table with active partitions.

This is due to fact that sql drop trigger receives
all the dropped objects including partitions. When
we call drop table on parent partition, it also drops
the partitions on the mx node. This causes the drop
table command on partitions to fail on mx node because
they are already dropped when the partition parent was
dropped.

With this work we did not require the table to exist on
worker_drop_distributed_table.
2018-10-08 17:01:54 -07:00
Murat Tuncer 24e247c1b9
Merge pull request #2426 from citusdata/failure_pull_push_insert_select
Add failure tests for insert/select via coordinator
2018-10-08 19:32:29 +03:00
Hadi Moshayedi 7509c6c8fb Add tests which check we disallow writes to local tables. 2018-10-06 10:54:44 +02:00
Marco Slot d56baefe3d Allow simple DML commands from hot standby 2018-10-06 10:54:44 +02:00
Murat Tuncer 71a910d2fa Add failure tests for insert/select via coordinator 2018-10-04 18:01:19 +03:00
Murat Tuncer c8151818e7
Merge pull request #2318 from citusdata/mt_failure_test
Add new failure tests for multi-shard/CTE modify and cte coordinator pull
2018-10-03 17:07:03 +03:00
Murat Tuncer 0a987e9c0e Fix cte subquery failure test 2018-10-03 15:43:48 +03:00
Murat Tuncer d26b312cad Add failure test for coordinator pull/push for cte 2018-10-03 15:43:48 +03:00
Murat Tuncer 6c66033455 Add failure tests for multi-shard update/delete
Failure tests for update/delete  on hash distributed tables
using 1PC and 2PC
2018-10-03 15:43:48 +03:00
Burak Velioglu 322dd54eee
Merge pull request #2412 from citusdata/add_all_transactions_to_views
Show router modify,select and real-time queries on MX views
2018-10-02 22:23:47 +03:00
velioglu 512d23934f Show router modify,select and real-time queries on MX views 2018-10-02 13:59:38 +03:00
Murat Tuncer 43a4ef939a
Merge pull request #2410 from citusdata/mx_partition_foreign_key
Do not create inherited constraints at worker tables
2018-09-28 16:53:13 +03:00
Murat Tuncer 9bdef67bab Do not create inherited constraints on worker shards
PG now allows foreign keys on partitioned tables.
Each foreign key constraint on partitioned table
is propagated down to partitions.

We used to create all constraints on shards when we are creating
a new shard, or when just simply moving a shard from one worker
to another. We also used the same logic when creating a copy of
coordinator table in mx node.

With this change we create the constraint on worker node only if
it is not an inherited constraint.
2018-09-28 14:14:51 +03:00
Murat Tuncer 0aa9988ae9
Merge pull request #2413 from citusdata/fix_memory_leak_minimal
Fix memory leak in FinishRemoteTransactionPrepare
2018-09-28 13:54:07 +03:00
Murat Tuncer 653c7e4ae0 Fix memory leak in FinishRemoteTransactionPrepare 2018-09-28 11:13:21 +03:00
Önder Kalacı 6c389497ab
Merge pull request #2404 from citusdata/fix_truncate
Make sure to use correct execution mode for TRUNCATE
2018-09-25 16:31:45 +03:00
Onder Kalaci cdc0d1491c Make sure to use correct execution mode for TRUNCATE
We used to set the execution mode in the truncate trigger. However,
when multiple tables are truncated with a single command, we could
set the execution mode very late. Instead, now set the execution mode
on the utility hook.
2018-09-25 15:35:27 +03:00
Marco Slot b2c3fd891b
Merge pull request #2396 from citusdata/insert_select_parameters
Do not allow unresolved parameters in INSERT...SELECT
2018-09-24 15:05:55 +02:00
Marco Slot 1ca9a5b867 Do not allow unresolved parameters in INSERT...SELECT 2018-09-24 14:12:04 +02:00
Murat Tuncer 535c535010
Merge pull request #2356 from citusdata/enable_jit
Re-enable JIT in PostgreSQL 11 tests
2018-09-24 09:55:11 +03:00
Jason Petersen d7f10b0896 Rewrite parallel ID test to avoid costly JITting
By setting the CPU tuple cost so high, we were triggering JIT. Instead,
we should use parallel_tuple_cost.

See: rhaas.blogspot.com/2018/06/using-forceparallelmode-correctly.html
2018-09-24 09:29:53 +03:00
Jason Petersen e62a1ab43d Revert "Disable JIT during PostgreSQL 11 test runs"
This reverts commit a2fb5a84f1.

JIT wasn't actually interfering with the operation of Citus, a test was
just written in a way which caused JIT to run for a function on every
row in a 150k-row table.
2018-09-24 09:29:53 +03:00
Jason Petersen 26178f72d3
Merge pull request #2358 from citusdata/fix_func_eval
Evaluate functions and parameters anywhere in query

cr: @jasonmp85
2018-09-21 13:58:53 -06:00
Marco Slot 877d703ac5
Evaluate functions (and when applicable, parameters) anywhere in query 2018-09-21 12:57:50 -06:00
Metin Döşlü 22173ae272
Merge pull request #2389 from citusdata/partitioned_tables_with_replication
Support partitioned tables with replication factor > 1
2018-09-21 18:06:41 +03:00
Onder Kalaci abc443d7fa Make sure that shard repair considers replication factor 2018-09-21 15:24:49 +03:00
Onder Kalaci 8520a5b432 worker_append_table_to_shard becomes aware of partitioned tables 2018-09-21 14:40:42 +03:00
Onder Kalaci c1b5a04f6e Allow partitioned tables with replication factor > 1
With this commit, we all partitioned distributed tables with
replication factor > 1. However, we also have many restrictions.

In summary, we disallow all kinds of modifications (including DDLs)
on the partition tables. Instead, the user is allowed to run the
modifications over the parent table.

The necessity for such a restriction have two aspects:
   - We need to acquire shard resource locks appropriately
   - We need to handle marking partitions INVALID in case
     of any failures. Note that, in theory, the parent table
     should also become INVALID, which is too aggressive.
2018-09-21 14:40:41 +03:00
Murat Tuncer 22f5af1bc3
Merge pull request #2391 from citusdata/truncate_utility
Add distributed locking to truncated mx tables
2018-09-21 14:38:00 +03:00
Murat Tuncer b6930e3db9 Add distributed locking to truncated mx tables
We acquire distributed lock on all mx nodes for truncated
tables before actually doing truncate operation.

This is needed for distributed serialization of the truncate
command without causing a deadlock.
2018-09-21 14:23:19 +03:00
Burak Velioglu 5b1dc0ac8d
Merge pull request #2381 from citusdata/add_citus_lock_waits
Add citus_lock_waits to show locked distributed queries
2018-09-20 14:59:28 +03:00
velioglu d7f75e5b48 Add citus_lock_waits to show locked distributed queries 2018-09-20 14:13:51 +03:00
Murat Tuncer 14d514d1df
Merge pull request #2383 from citusdata/pg11_drop_index
Fix drop index bug on PG11 partitioned table
2018-09-20 12:24:56 +03:00
Murat Tuncer 0f6e514bfb Fixes a bug on not being able to drop index on a partitioned table.
Reason for the failure is that PG11 introduced a new relation kind
RELKIND_PARTITIONED_INDEX to be used for partitioned indices.

We expanded our check to cover that case.
2018-09-19 13:15:05 +03:00
Marco Slot 9215c00ee2
Merge pull request #2379 from citusdata/fix_procedure_rollback
Fixes a bug preventing rollback in stored procedure
2018-09-19 11:35:30 +02:00
Önder Kalacı 513e753492
Merge pull request #2386 from citusdata/improve_walker
Use tree walker instead of mutator in relation visibility
2018-09-18 10:22:51 +03:00