Commit Graph

3977 Commits (fix/comp-type-field-access)

Author SHA1 Message Date
Onur Tirtir a225652c29 Handle INSERT/UPDATE queries with comp.type field access properly
Planner combines multiple fields accesses to same composite type column
in a single FieldStore object and "processIndirection" function that we
use to deparse such queries does not know how to handle such FieldStore
objects..

For that, we split field references in FiedlStore objects into
individual ones.
2020-10-12 16:04:03 +03:00
Önder Kalacı 93764a3782
Merge pull request #4230 from citusdata/do_not_copy
Do not copy bit map set unnecessarily
2020-10-09 18:29:26 +02:00
Onder Kalaci e29aa51a87 Do not copy bms 2020-10-09 16:41:36 +02:00
SaitTalhaNisanci 0919d90cf8
Merge pull request #4229 from citusdata/use_pg13.0
Use pg 13.0 in tests
2020-10-09 13:53:54 +03:00
Sait Talha Nisanci b27ed05f1a Use pg 13.0 in tests 2020-10-09 11:51:14 +03:00
SaitTalhaNisanci 58d7c1613a
Merge pull request #4221 from citusdata/fix/vacuum_stuck
Commit transaction for VACUUM on shell table
2020-10-09 11:50:31 +03:00
SaitTalhaNisanci c7ceabc44a
Merge branch 'master' into fix/vacuum_stuck 2020-10-09 11:32:39 +03:00
Jelte Fennema d57bbfd3f9
Add uuid-dev to Ubuntu deps in CONTRIBUTING (#4218)
This is needed to compile postgres with --with-uuid=e2fs.
2020-10-09 10:27:47 +02:00
Sait Talha Nisanci dc40758355 Return early if there is no citus table in VACUUM 2020-10-09 11:10:00 +03:00
Sait Talha Nisanci 99bb79745a Commit transaction for VACUUM on shell table
With postgres 13, there is a global lock that prevents multiple VACUUMs
happening in the current database. This global lock is taken for a short
time but this creates a problem because of the following:

- We execute the VACUUM for the shell table through the standard process
utility. In this step the global lock is taken for the current database.
- If the current node has shard placements then it tries to execute
VACUUM over a connection to localhost with ExecuteUtilityTaskList.
- the VACUUM on shard placements cannot proceed because it is waiting
for the global lock for the current database to be released.
- The acquired lock from the VACUUM for shell table will not be released
until the transaction is committed.
- So there is a deadlock.

As a solution, we commit the current transaction in case of VACUUM after
the VACUUM is executed for the shell table. Executing the VACUUM on a
shell table is not important because the data there will probably be
truncated. PostprocessVacuumStmt takes the necessary locks on the shell
table so we don't need to take any extra locks after we commit the
current transaction.
2020-10-09 10:57:44 +03:00
Marco Slot fd40605745
Merge pull request #4222 from citusdata/fix/multiple-maintenanced 2020-10-08 16:45:39 +02:00
Marco Slot 881e5df780 Fix a bug that could lead to multiple maintenance daemons 2020-10-08 16:18:14 +02:00
Marco Slot 18219843d0 Add maintenance daemon error tests 2020-10-08 16:17:33 +02:00
Marco Slot 2e02a30e37
Merge pull request #4226 from snopoke/patch-2 2020-10-08 13:59:48 +02:00
Simon Kelly 03e007e4eb
Merge branch 'master' into patch-2 2020-10-08 13:00:11 +02:00
Simon Kelly 50fa4af7e4 update migration script 2020-10-08 12:52:27 +02:00
Metin Döşlü 6f394e8b1e
Update CLA link (#4227) 2020-10-08 12:57:26 +03:00
Simon Kelly 6fffee7616
Drop backup table after upgrade
The prepare for upgrade script creates the `'public.pg_dist_rebalance_strategy` table which is not dropped when the upgrade is finished. This may block future upgrades.
2020-10-08 09:48:04 +02:00
Marco Slot f904ce1726
Merge pull request #4215 from citusdata/fix/rls-moves 2020-10-06 14:16:40 +02:00
Marco Slot 73fc054c27 Rename DDL command functions 2020-10-06 11:30:56 +02:00
Marco Slot 4f69298d90 Fix RLS and replica identity propagation on shard move 2020-10-06 11:30:03 +02:00
Marco Slot bce11514b9
Merge pull request #4203 from citusdata/fix/sequence-drop 2020-10-06 11:22:21 +02:00
Marco Slot dbc348b7e0 Create sequence dependency during metadata syncing 2020-10-06 10:57:39 +02:00
Marco Slot 9bba8bb4e8 Remove master_drop_sequences 2020-10-06 10:57:33 +02:00
SaitTalhaNisanci b271a4890b
Merge pull request #4216 from citusdata/write_to_postgres_config
Write settings to postgres configuration file directly
2020-10-05 22:43:11 +03:00
Sait Talha Nisanci 078dcae18c Write settings to postgres configuration file directly
In our test structure, we have been passing postgres configurations from
the terminal, which causes problems after it hits to a certain length
hence it cannot start the server and understanding why it failed is not
easy because there isn't a nice error message.

This commit changes this to write the settings directly to the postgres
configuration file. This way we can add as many postgres settings as we
want to without needing to worry about the length problem.
2020-10-05 22:09:08 +03:00
Ahmet Gedemenli 889fc2db5f
Merge pull request #4214 from citusdata/degrade-gracefully-when-no-background-workers
Degrade gracefully when no background workers available
2020-10-05 17:26:44 +03:00
Ahmet Gedemenli 81db4dca5c Degrade gracefully when no background workers available 2020-10-05 16:55:00 +03:00
Onur Tirtir 2cd0a69dfb
Fix multi-row & router INSERT crash with local exec. when def. cols not specified (#4197)
Multi-row & router INSERT's were crashing with local execution if at
least one of the DEFAULT columns were not specified in VALUES list.

This was because, the changes we make on query->values_lists and
query->targetList was sufficient for deparsing given INSERT for remote
execution but not sufficient for local execution.

With this commit, DEFAULT value normalization for multi-row & router
INSERT's is fixed by adding dummy column references for unspecified
DEFAULT columns.
2020-10-05 10:45:17 +03:00
Hanefi Onaldi ba88ed3f0b
Merge pull request #4207 from citusdata/no-worker-hash-in-insert-select 2020-10-02 18:27:36 +03:00
Hanefi Önaldı 6d8e83d24f
Replace worker_hash calls with partkey IS NOT NULL filters 2020-10-02 18:16:24 +03:00
Önder Kalacı df5aa0f0cc
Switch to sequential execution if the index name is long (#4209)
Citus has the logic to truncate the long shard names to prevent
various issues, including self-deadlocks. However, for partitioned
tables, when index is created on the parent table, the index names
on the partitions are auto-generated by Postgres. We use the same
Postgres function to generate the index names on the shards of the
partitions. If the length exceeds the limit, we switch to sequential
execution mode.
2020-10-02 13:39:34 +03:00
SaitTalhaNisanci 45bb0fb587
Do initial cleanup only once in pg_init (#4213)
In postmasters execution of _PG_init, IsUnderPostmaster will be false and
we want to do the cleanup at that time only, otherwise there is a chance that
there will be parallel queries and we might do a cleanup for things that are
already in use.
2020-10-02 09:12:39 +03:00
Ahmet Gedemenli 6a341b6ab8
Merge pull request #4196 from citusdata/support-explain-analyze-wal
Support EXPLAIN(ANALYZE, WAL)
2020-10-01 14:43:42 +03:00
Ahmet Gedemenli 70e9edb4f2 Add subplan test with insert 2020-10-01 13:58:55 +03:00
Jelte Fennema 13ef8252e7 Add broken distributed subplan test 2020-10-01 13:52:42 +03:00
Ahmet Gedemenli 3357eea46b Add regression tests for PG13 WAL 2020-10-01 13:52:42 +03:00
Ahmet Gedemenli d268aa7bc8 Support EXPLAIN(ANALYZE, WAL) 2020-10-01 13:52:42 +03:00
Önder Kalacı f3962fc7f6
Merge pull request #4199 from citusdata/terminate_connection
Forcefully terminate connections after citus.node_connection_timeout
2020-10-01 08:56:39 +02:00
Onder Kalaci 56ca256374 Forcefully terminate connections after citus.node_connection_timeout
After the connection timeout, we fail the session/pool. However, the
underlying connection can still be trying to connect. That is dangerous
because the new placement executions have already been in place. The
executor cannot handle the situation where multiple of
EXECUTION_ORDER_ANY task executions succeeds.

Adding a regression test doesn't seem easily doable. To reproduce the issue
- Add 2 worker nodes
- create a reference table
- set citus.node_connection_timeout to 1ms (requires code change)
- Continiously execute `SELECT count(*) FROM ref_table`
- Sometime later, you hit an out-of-array access in
  `ScheduleNextPlacementExecution()` hence crashing.
- The reason for that is sometimes the first connection
  successfully established while the executor is already
  trying to execute the query on the second node.
2020-09-30 18:24:24 +02:00
Hanefi Onaldi 2894002211
Merge pull request #4208 from citusdata/cleanup-pgoptions
Remove some pgoptions to prevent hitting bash command character limits
2020-09-30 17:04:27 +03:00
Hanefi Önaldı 9ec85f1283
Remove some pgoptions to prevent hitting bash command character limits 2020-09-30 15:04:40 +03:00
Onur Tirtir 3f8ac527c9
Merge pull request #4205 from citusdata/update-cl-941
Update CHANGELOG for 9.4.1
2020-09-30 10:47:45 +03:00
Onur Tirtir bc29238546 Update CHANGELOG for 9.4.1 2020-09-30 10:09:54 +03:00
Hanefi Onaldi 85d32bcf35
Merge pull request #4198 from citusdata/disallow-volatile-subquery-in-updates
Disallow volatile functions on single shard update subqueries
2020-09-29 16:27:13 +03:00
Hanefi Önaldı b0a2c1ee5c
Disallow volatile functions on single shard update queries
We currently do not support volatile functions in update/delete statements
because the function evaluation logic does not know how to distinguish
volatile functions (that need to be evaluated per row) from stable functions
(that need to be evaluated per query), and it is also not safe to push the
volatile functions down on replicated tables.
2020-09-29 15:40:21 +03:00
Marco Slot 12ecdea790
Merge pull request #4173 from citusdata/fix/create-index-concurrently-local 2020-09-29 10:15:40 +02:00
Marco Slot b905c8043d Fix create index concurrently crash with local execution 2020-09-25 11:49:09 +02:00
Ahmet Gedemenli e892e253b1
Merge pull request #4191 from citusdata/sort-explain-analyze-output-by-time
Sort explain analyze output by task time
2020-09-24 14:38:06 +03:00
Ahmet Gedemenli abfb79bda6 Sort explain analyze output by task time
Add sort method parameter for regression tests

Fix check-style

Change sorting method parameters to enum

Polish

Add task fields to OutTask

Add test into multi_explain

Fix isolation test
2020-09-24 11:38:40 +03:00