Commit Graph

4778 Commits (fix/partitionCommandsOrdering)

Author SHA1 Message Date
Sait Talha Nisanci 63efc140de Create partitions before copying data 2021-05-10 00:39:30 +03:00
Ahmet Gedemenli 8cb505d6e1
Fix matview access method change issue (#4959)
* Fix matview access method change issue

* Use pg function get_am_name

* Split view generation command into pieces
2021-05-07 15:47:24 +03:00
SaitTalhaNisanci 6b1904d37a
When moving a shard to a new node ensure there is enough space (#4929)
* When moving a shard to a new node ensure there is enough space

* Add WairForMiliseconds time utility

* Add more tests and increase readability

* Remove the retry loop and use a single udf for disk stats

* Address review

* address review

Co-authored-by: Jelte Fennema <github-tech@jeltef.nl>
2021-05-06 17:28:02 +03:00
Ahmet Gedemenli ff4098724a
Merge pull request #4957 from citusdata/log-remote-commands-for-shard-cost-func
Log remote commands for shard cost func at multi_partitioninig
2021-05-06 17:17:34 +03:00
Ahmet Gedemenli bc818e76e2 Add notice log message for skipping child tables for optimization 2021-05-06 16:49:37 +03:00
Ahmet Gedemenli 2fed133cf8
Merge pull request #4951 from citusdata/fix-nested-select-query-bug
Fix nested select query with union bug
2021-05-05 22:59:16 +03:00
Ahmet Gedemenli 2e0bb5c0c8 Fix nested select query with union bug 2021-05-05 20:35:00 +03:00
Jelte Fennema d0ba122061
Editorconfig: configure 4 spaces for python files (#4953) 2021-05-05 10:32:47 +00:00
Jelte Fennema 0e6c080e81
Run copy_modified in upgrade tests (#4952)
This allows running the following command to update the expected files
with normalized output files for upgrade tests too:

```bash
cp src/test/regress/{results,expected}/upgrade_rebalance_strategy_before.out
```
2021-05-05 12:28:05 +02:00
Jelte Fennema 50357db957
Simplify code that tests the shard rebalancer algorithm (#4925)
This modifies the test code to use sane defaults instead of requiring
all values to be specified in the test.
2021-05-03 15:47:19 +02:00
Hanefi Onaldi 23a505d41f
Bump PG versions in CI (#4941)
Co-authored-by: Hanefi Onaldi <Hanefi.Onaldi@microsoft.com>
Co-authored-by: Sait Talha Nisanci <s.talhanisanci@gmail.com>
2021-05-03 13:51:20 +03:00
SaitTalhaNisanci 2b70987341
Merge pull request #4919 from citusdata/continue_dropping_shards
Continue to remove shards after first failure in DropMarkedShards
2021-04-30 18:22:39 +03:00
Jelte Fennema 2f29d4e53e Continue to remove shards after first failure in DropMarkedShards
The comment of DropMarkedShards described the behaviour that after a
failure we would continue trying to drop other shards. However the code
did not do this and would stop after the first failure. Instead of
simply fixing the comment I fixed the code, because the described
behaviour is more useful. Now a single shard that cannot be removed yet
does not block others from being removed.
2021-04-30 15:42:09 +03:00
SaitTalhaNisanci ca5d281784
Merge pull request #4940 from citusdata/reduce_memory_usage_rebalancer
Decrease memory usage with rebalancer
2021-04-30 11:15:11 +03:00
Sait Talha Nisanci 8cabd2e822 Decrease memory usage with rebalancer
We decrease memory usage by:
- Freeing temporary buffers
- Using separate memory context for blocks that uses "small" amount of
memory but can be repeated many times such as loops
2021-04-29 13:40:47 +03:00
Hanefi Onaldi 2f90ce931b
Fix minor issues with makefile targets (#4717) 2021-04-28 15:46:55 +03:00
Marco Slot 6a050ab6b9
Merge pull request #4865 from citusdata/marcocitus/fix-from-only
Fix FROM ONLY queries on partitioned tables
2021-04-28 14:17:12 +02:00
Marco Slot 4b49cb112f Fix FROM ONLY queries on partitioned tables 2021-04-27 16:10:07 +02:00
Ahmet Gedemenli 9c08ab49df
Merge pull request #4917 from citusdata/sort-gucs-alphabetically
Sort GUCs in alphabetic order
2021-04-26 16:31:47 +03:00
Ahmet Gedemenli fe65be993e Sort GUCs in alphabetic order 2021-04-26 15:05:42 +03:00
Onur Tirtir f8bacbedac
Merge pull request #4920 from citusdata/add-citus-10.0-upgrade
Preparation for adding citus 10.0 to upgrade tests
2021-04-26 15:04:02 +03:00
Onur Tirtir 889ad6fa8c Run some upgrade tests only when old version=9.0 2021-04-26 14:53:53 +03:00
Onur Tirtir 6afa4f2e62 Export upgrade_test_old_citus_version to use in some upgrade tests 2021-04-26 14:53:53 +03:00
Jelte Fennema 7ee9a0d1c4
Enable security flags in CI (#4924) 2021-04-26 10:28:35 +02:00
Ahmet Gedemenli 332c5ce4ad
Fix worker partitioned size functions (#4922) 2021-04-26 10:29:46 +03:00
Philip Dubé 8cd9b8d8af
Merge pull request #4926 from citusdata/diff-filter-full-search
Fix diff-filter to search the whole line for matches
2021-04-23 13:08:36 +00:00
Jelte Fennema 763fa1cf41 Fix diff-filter to search the whole line for matches
Recently two new normalization line deletion rules have been added that
don't match the start of a line:
```
/local tables that are added to metadata but not chained with reference tables via foreign keys might be automatically converted back to postgres tables$/d
/Consider setting citus.enable_local_reference_table_foreign_keys to 'off' to disable this behavior$/d
```

Because `diff-filter` used `regex.match` these lines were not removed
when creating a new diff. This could cause some confusing diffs, where
the wrong lines were shown as changed. This fixes that by using
`regex.search` instead of `regex.match`.
2021-04-23 12:43:49 +02:00
Önder Kalacı 3dfb766f35
Merge pull request #4915 from citusdata/allow_values
Allow constant VALUES clause in pushdown queries
2021-04-21 14:39:50 +02:00
Onder Kalaci 918838e488 Allow constant VALUES clauses in pushdown queries
As long as the VALUES clause contains constant values, we should not
recursively plan the queries/CTEs.

This is a follow-up work of #1805. So, we can easily apply OUTER join
checks as if VALUES clause is a reference table/immutable function.
2021-04-21 14:28:08 +02:00
SaitTalhaNisanci 93c2dcf3d2
Fix data-race with concurrent calls of DropMarkedShards (#4909)
* Fix problews with concurrent calls of DropMarkedShards

When trying to enable `citus.defer_drop_after_shard_move` by default it
turned out that DropMarkedShards was not safe to call concurrently.
This could especially cause big problems when also moving shards at the
same time. During tests it was possible to trigger a state where a shard
that was moved would not be available on any of the nodes anymore after
the move.

Currently DropMarkedShards is only called in production by the
maintenaince deamon. Since this is only a single process triggering such
a race is currently impossible in production settings. In future changes
we will want to call DropMarkedShards from other places too though.

* Add some isolation tests

Co-authored-by: Jelte Fennema <github-tech@jeltef.nl>
2021-04-21 10:59:48 +03:00
Ahmet Gedemenli 33c620f232
Optimize partitioned disk size calculation (#4905)
* Optimize partitioned disk size calculation

* Polish

* Fix test for citus_shard_cost_by_disk_size

Try optimizing if not CSTORE
2021-04-19 13:30:56 +03:00
Onur Tirtir 96278822d9
Move columnar test helpers to a separate file (#4908)
* Move columnar test helpers to another file

* Rename column_store_memory_stats to columnar_store_memory_stats
2021-04-16 18:56:21 +03:00
Önder Kalacı 31d4ed41d7
Merge pull request #4892 from citusdata/connection_execution_stats
Keep more statistics about connection establishment times
2021-04-16 15:03:19 +02:00
Onder Kalaci 5482d5822f Keep more statistics about connection establishment times
When DEBUG4 enabled, Citus now prints per connection establishment
time.
2021-04-16 14:56:31 +02:00
Önder Kalacı 0a060b327b
Merge pull request #4859 from citusdata/task_execution_stats
Keep more execution statistics
2021-04-16 14:51:24 +02:00
Onder Kalaci 5b78f6cd63 Keep more execution statistics
When DEBUG4 enabled, Citus now prints per task execution times.
2021-04-16 14:45:00 +02:00
jeff-davis 9ed56928d3
Columnar: fix use-after-free. (#4906)
Co-authored-by: Jeff Davis <jefdavi@microsoft.com>
2021-04-15 01:00:00 -07:00
Hanefi Onaldi 987137ef97
Merge pull request #4794 from citusdata/fix/4736 2021-04-14 18:43:13 +03:00
Hanefi Onaldi 9919fbe3f8 Switch to sequential mode on long partition names
This commit adds support for long partition names for distributed tables:
- ALTER TABLE dist_table ATTACH PARTITION ..
- CREATE TABLE .. PARTITION OF dist_table ..

Note: create_distributed_table UDF does not support long table and
partition names, and is not covered in this commit
2021-04-14 15:27:50 +03:00
Ahmet Gedemenli e445e3d39c
Introduce 3 partitioned size udfs (#4899)
* Introduce 3 partitioned size udfs

* Add tests for new partition size udfs

* Fix type incompatibilities

* Convert UDFs into pure sql functions

* Fix function comment
2021-04-13 17:36:27 +03:00
Onur Tirtir fe5c985e1d
Remove HAS_TABLEAM config since we dropped pg11 support (#4862)
* Remove HAS_TABLEAM config

* Drop columnar_ensure_objects_exist

* Not call columnar_ensure_objects_exist in citus_finish_pg_upgrade
2021-04-13 10:51:26 +03:00
Onur Tirtir 716cc629f1
Refactor ColumnarReadNextRow for better readability (#4823) 2021-04-13 10:44:00 +03:00
jeff-davis 3efdfdd791
Columnar: make projectedColumnList an integer list. (#4869)
Co-authored-by: Jeff Davis <jefdavi@microsoft.com>
2021-04-12 19:07:21 -07:00
Ahmet Gedemenli d74d358a45
Refactor size queries with new enum SizeQueryType (#4898)
* Refactor size queries with new enum SizeQueryType

* Polish
2021-04-12 17:14:29 +03:00
SaitTalhaNisanci b453563e88
Warm up connections params hash (#4872)
ConnParams(AuthInfo and PoolInfo) gets a snapshot, which will block the
remote connectinos to localhost. And the release of snapshot will be
blocked by the snapshot. This leads to a deadlock.

We warm up the conn params hash before starting a new transaction so
that the entries will already be there when we start a new transaction.
Hence GetConnParams will not get a snapshot.
2021-04-12 13:08:38 +03:00
Ahmet Gedemenli a1a394dbc9
Merge pull request #4894 from citusdata/add-comment-to-postprocess-create-table
Update func comment for PostprocessCreateTableStmt
2021-04-10 20:03:20 +03:00
Ahmet Gedemenli caef0463b0 Update func comment for PostprocessCreateTableStmt 2021-04-09 13:41:59 +03:00
Ahmet Gedemenli 52e467a9a0
Error out if inheriting a distributed table (#4871)
* Error out if inheriting a distributed table

* Add test inheriting a distirbuted table
2021-04-07 11:21:06 +03:00
Ahmet Gedemenli e4c4a9b683
Fix error message for local table joins (#4870)
* Fix error message for local table joins

* Fix error messages for regression tests expected outputs
2021-04-06 16:18:28 +03:00
Ahmet Gedemenli b3ef3194e3
Merge pull request #4866 from citusdata/fix-shard-not-found-issue-for-public-schema
Fix shard not found issue for public schema
2021-04-06 10:37:36 +03:00