Commit Graph

3397 Commits (605b9016375097a9642d8d976a0682becc0e0e3d)

Author SHA1 Message Date
Halil Ozan Akgul 8ce4f20061 Fixes the bug of grants on public schema propagation 2020-02-05 18:05:58 +03:00
SaitTalhaNisanci 89dc7d5e41
remove outdated information in citus upgrade readme (#3471) 2020-02-05 13:31:02 +03:00
Marco Slot 8c972dc614
Merge pull request #3470 from citusdata/insert_select_issue
Rename discarded target list items in repartitioned INSERT/SELECT
2020-02-05 11:21:05 +01:00
Marco Slot 64ca5c9acb Add additional INSERT..SELECT repartition tests 2020-02-05 11:06:44 +01:00
Hadi Moshayedi 9dd14fa90d Rename discarded target list items in repartitioned INSERT/SELECT 2020-02-05 11:06:44 +01:00
Önder Kalacı 1aa89d3242
Merge pull request #3467 from citusdata/fix_crash_numeric
Improve single hash-repartitioning with numeric (or non-int) types
2020-02-05 09:12:41 +01:00
Onder Kalaci c7e2309f4c Improve single hash-repartitioning with numeric (or non-int) types
We used to treat the shard interval array that we passed as numeric[].
However, it should be int[], as the shard ranges are int[].
2020-02-04 20:30:04 +01:00
Hadi Moshayedi 3826e81056
Merge pull request #3460 from citusdata/fix_permissions
Create merge task temporary schemas with current user
2020-02-04 10:05:02 -08:00
Hadi Moshayedi bc1a800f70 Use current user for repartition join temp schemas.
Otherwise when using a less privileged user we might get
errors when trying to create the schema.
2020-02-04 09:48:20 -08:00
Hadi Moshayedi 13d27cb280
Merge pull request #3451 from citusdata/insert_select_partitioned_joins_2
Don't error out when subquery in INSERT/SELECT is not router plannable.
2020-02-03 13:29:04 -08:00
Hadi Moshayedi 890e23e734 Update multi_insert_select_non_pushable_queries 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 5818bcd27e Update with_dml 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 46f60e1ac0 Update multi_insert_select_conflict 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 05f58c9ec5 Update multi_insert_select 2020-02-03 13:13:30 -08:00
Hadi Moshayedi 264530311a Don't use distributed insert/select for repartitioned joins 2020-02-03 13:13:30 -08:00
Marco Slot 2e8c118a8f
Make connection assignment more liberal after parallel join wit… (#3456)
Make connection assignment more liberal after parallel join with reference table
2020-02-03 20:11:20 +01:00
Onder Kalaci 8be1b0112d Add failure test for parallel reference table join 2020-02-03 19:35:07 +01:00
Marco Slot be77d3304f Fixup 2020-02-03 11:59:55 +01:00
Marco Slot a6bd6c657e Add tests that exercise parallel reference table join logic 2020-02-03 11:54:29 +01:00
Marco Slot b0fd6aa006 If reference tables was read over multiple connections, do not assign connection 2020-02-03 11:54:29 +01:00
Önder Kalacı 508b392304
Merge pull request #3454 from citusdata/recursively_check_params
Make sure to recursively go into the functions to search for PARAMs
2020-02-03 11:27:12 +01:00
Onder Kalaci 2f274a4fce Make sure to go deeper into the functions to search for PARAMs
For example, a PARAM might reside inside a function just because
of a casting of a type such as the follows:

```
               {FUNCEXPR
               :funcid 1740
               :funcresulttype 1700
               :funcretset false
               :funcvariadic false
               :funcformat 2
               :funccollid 0
               :inputcollid 0
               :args (
                  {PARAM
                  :paramkind 0
                  :paramid 15
                  :paramtype 23
                  :paramtypmod -1
                  :paramcollid 0
                  :location 356
                  }
               )
```

We should recursively check the expression before bailing out.
2020-02-03 09:36:12 +01:00
Hadi Moshayedi 1adc293286
Merge pull request #3450 from citusdata/fix-ci-locale-issues
diff-filter: use utf8 encoding, not ascii
2020-01-30 21:57:18 -08:00
Philip Dubé db2eac5658 diff-filter: use utf8 encoding, not ascii 2020-01-31 00:03:17 +00:00
Hadi Moshayedi b0f9f94a52
Merge pull request #3448 from citusdata/insert_select_leak
Add insert/select connection leak tests
2020-01-30 14:20:14 -08:00
Hadi Moshayedi 9d988b3437 Add insert/select connection leak tests 2020-01-30 14:09:07 -08:00
Philip Dubé 461facb149
Merge pull request #3447 from citusdata/fix-group-by-distribution-no-group-by
Intermediate row pull up should be false whenever we can fully push down grouping
2020-01-30 21:31:34 +00:00
Philip Dubé d43c80d4d8 pullUpIntermediateRows should not be true when groupedByDisjointPartitionColumn is true
This was causing 'SELECT id, stdev(y_int) FROM tbl GROUP BY id' to push down stddev without group by
2020-01-30 21:18:08 +00:00
Philip Dubé d7204c9696
Merge pull request #3423 from citusdata/remove-directory-even-if-new-files-added
CitusRemoveDirectory: loop when directory is not empty
2020-01-30 20:21:47 +00:00
Philip Dubé 84a500ffc6 CitusRemoveDirectory: loop when directory is not empty
Sometimes during errors workers will create files while we're deleting intermediate directories

example:
DEBUG:  could not remove file "base/pgsql_job_cache/10_0_431": Directory not empty
DETAIL:  WARNING from localhost:57637
2020-01-30 20:02:08 +00:00
Philip Dubé 6b43fab325
Merge pull request #3406 from citusdata/fix-limit-approx
Expand the set of aggregates which cannot have LIMIT approximated
2020-01-30 18:00:40 +00:00
Philip Dubé 5fccc56d3e Expand the set of aggregates which cannot have LIMIT approximated
Previously we only prevented AVG from being pushed down, but this is incorrect:
- array_agg, while somewhat non sensical to order by, will potentially be missing values
- combinefunc aggregation will raise errors about cstrings not being comparable (while we also can't know if the aggregate is commutative)

This commit limits approximating LIMIT pushdown when ordering by aggregates to:
min, max, sum, count, bit_and, bit_or, every, any
Which means of those we previously supported, we now exclude:
avg, array_agg, jsonb_agg, jsonb_object_agg, json_agg, json_object_agg, hll_add, hll_union, topn_add, topn_union
2020-01-30 17:45:18 +00:00
Önder Kalacı 8584cb005b
Do not evaluate functions on the coordinator for SELECT queries (#3440)
Previously, the logic for evaluting the functions and the parameters
were the same. That ended-up evaluting the functions inaccurately
on the coordinator. Instead, split the function evaluation logic
from parameter evalution logic.
2020-01-30 08:47:28 +01:00
Önder Kalacı e9c17b71a4
Add missing ORDER BY (#3441)
As it causes some random failures
2020-01-29 17:36:32 +01:00
Önder Kalacı 412fe719f7
Hide citus.enable_ddl_propagation setting (#3437)
As that is powerful and cause metadata inconsistency. See the following steps:

(Note that we cannot use PGC_SUSET because on Citus MX we need this flag for non-
superusers as well)

```SQL
CREATE TABLE test_ref_table(key int);
SELECT create_reference_table('test_ref_table');

SELECT logicalrelid, logicalrelid::oid FROM pg_dist_partition;
┌────────────────┬──────────────┐
│  logicalrelid  │ logicalrelid │
├────────────────┼──────────────┤
│ test_ref_table │        16831 │
└────────────────┴──────────────┘
(1 row)

Time: 0.929 ms

SELECT relname FROM pg_class WHERE oid = 16831;
┌────────────────┐
│    relname     │
├────────────────┤
│ test_ref_table │
└────────────────┘
(1 row)

Time: 0.785 ms

SET citus.enable_ddl_propagation TO off;

 DROP TABLE test_ref_table ;

SELECT logicalrelid, logicalrelid::oid FROM pg_dist_partition;
┌──────────────┬──────────────┐
│ logicalrelid │ logicalrelid │
├──────────────┼──────────────┤
│ 16831        │        16831 │
└──────────────┴──────────────┘
(1 row)
Time: 0.972 ms

SELECT relname FROM pg_class WHERE oid = 16831;
┌─────────┐
│ relname │
├─────────┤
└─────────┘
(0 rows)

Time: 0.908 ms

 SELECT master_add_node('localhost', 9703);
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
Time: 5.028 ms
!>

```
2020-01-29 10:17:53 +01:00
Philip Dubé 1ca108feda
Merge pull request #3429 from citusdata/diff-filter-handle-normalize
Update diff-filter to handle lines removed by normalization
2020-01-28 16:23:32 +00:00
Philip Dubé 40ce531850 Update diff-filter to handle lines removed by normalization
Add a script to test our diff logic

pg_regress_multi updated to rely on $PATH having copy_modified to fix testing with VPATH
2020-01-28 15:39:40 +00:00
Jelte Fennema b9eee70fa5 Fix random output ordering in CTE inlining test (#3434) 2020-01-27 16:38:27 +01:00
SaitTalhaNisanci 94bd563ff0
switch back to old memory context in cache local plan for task (#3428) 2020-01-27 13:00:46 +03:00
Philip Dubé ca85b2b4ff
Merge pull request #3425 from citusdata/make-test-copying-work-again
Replace denormalized test output with normalized at the end of the run
2020-01-24 17:42:54 +00:00
Jelte Fennema c38446b5f5 Replace denormalized test output with normalized at the end of the run 2020-01-24 11:42:38 +01:00
Önder Kalacı 4519d3411d
Improve the representation of used sub plans (#3411)
Previously, we've identified the usedSubPlans by only looking
to the subPlanId.

With this commit, we're expanding it to also include information
on the location of the subPlan.

This is useful to distinguish the cases where the subPlan is used
either on only HAVING or both HAVING and any other part of the query.
2020-01-24 10:47:14 +01:00
Philip Dubé 87e6352d5b
Merge pull request #3422 from citusdata/return-const-when-borrowing
CurrentDatabaseName: return const char* as we're borrowing from cache
2020-01-23 23:06:39 +00:00
Philip Dubé 50c5e814c8 CurrentDatabaseName: return const char* as we're borrowing from cache 2020-01-23 22:49:35 +00:00
Philip Dubé cc1c398d87
Merge pull request #3401 from citusdata/test-extension-owner
See what flaky multi_extension test is doing with roles
2020-01-23 22:05:45 +00:00
Philip Dubé 69dde460de See what flaky multi_extension test is doing with roles 2020-01-23 21:50:40 +00:00
Philip Dubé 5e6a5a3ed0
Merge pull request #3419 from citusdata/less-normal-diffs-when-different
Avoid obscuring regression test diffs with normalization
2020-01-23 19:02:48 +00:00
Philip Dubé 5e55a36172 Avoid obscuring regression test diffs with normalization
First, diff is updated to not update the files in-place

For some reason diff is being called multiple times,
so $file1.unmodified becomes normalized on second invocation

Secondly, diff-filter updates output to come from the unmodified version

Normalization is serving two purposes:
- avoid diff noise in regressions
- avoid diff noise in commits when expected result is updated

The first purpose only wants to reduce the lines which diff registers,
whereas the second wants those changes to be committed
2020-01-23 18:51:23 +00:00
Hadi Moshayedi 65dfcaa54b
Merge pull request #3421 from citusdata/allow_noent_in_remove
Don't error for ENOENT in CitusRemoveDirectory.
2020-01-23 10:16:26 -08:00
Hadi Moshayedi 1dc19215eb Don't error for ENOENT in CitusRemoveDirectory.
For concurrency reasons, this can happen even if initial stat succeeded.
2020-01-23 10:07:54 -08:00