Commit Graph

4183 Commits (cef1d0e915d1e9c130d169b842a0f99a1b9dd02c)

Author SHA1 Message Date
Onder Kalaci 15e724c073 Add regression tests for outer/cross JOINs 2020-10-14 15:17:30 +02:00
Onder Kalaci de33079065 Improve outer join checks
Before this commit, the logic was:
    - As long as the outer side of the JOIN is not a JOIN (e.g., relation
      or subquery etc.), we check for the existence of any recurring
      tuples. There were two implications of this decision.

      First, even if a subquery which is on the outer side contains
      distributed table JOIN reference table, Citus would unnecessarily throw
      an error. Note that, the JOIN inside the subquery would already
      be going to be tested recursively. But, as long as that check
      passes, there is no reason for the upper JOIN to fail. An example, which
      used to fail and now works:

	SELECT * FROM (SELECT * FROM dist JOIN ref) as foo LEFT JOIN dist;

      Second, certain JOINs, especially with ON (true) conditions were not
      represented as Citus expects the JOINs to be in the format
      DeferredErrorIfUnsupportedRecurringTuplesJoin().
2020-10-14 15:17:30 +02:00
Onur Tirtir 1a28858c47
Disallow field indirection in INSERT/UPDATE queries (#4241) 2020-10-14 14:11:59 +03:00
Nils Dijk 5fc7f61936 Projection pushdown (#11)
DESCRIPTION: add pushdown support for projections and quals in table access method scan

This implementation uses custom scans to push projections into the scans on a columnar table. The custom scan replaces all access paths to a table to force the projection of the columns.
2020-10-13 13:36:02 +02:00
Onur Tirtir 8efca3b60a
Fix a crash with inserting domain composite types in coord. evaluation (#4231)
Use short lived per-tuple context in citus_evaluate_expr like
(pg) evaluate_expr does.

We should not use planState->ExprContext when evaluating expressions
as it might lead to freeing the same executor twice (first one happens
in citus_evaluate_expr itself and the other one happens when postgres
doing clean-up for the top level executor state), which in turn might
cause seg.faults.

However, now as we don't have necessary planState info to evaluate
prepared statements, we also add planState->es_param_list_info to
per-tuple ExprContext.
2020-10-13 14:19:59 +03:00
Halil Ozan Akgül df185179c3
Merge pull request #4201 from citusdata/support-with-ties
Adds support for WITH TIES option
2020-10-12 19:44:48 +03:00
Halil Ozan Akgul e2736c25bd Adds support for WITH TIES option 2020-10-12 19:34:18 +03:00
Hadi Moshayedi 685d5c9d4c Merge pull request #15 from citusdata/vacuum
Initial support for VACUUM (without FULL option)
2020-10-09 21:10:34 -07:00
Hadi Moshayedi c4eb36dfd2 Merge pull request #13 from citusdata/vacuum_analyze
Support VACUUM FULL
2020-10-09 21:10:11 -07:00
Hadi Moshayedi 102b7670d4 Fix tautological compare issue (#19) 2020-10-09 13:08:03 -07: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
Hadi Moshayedi e481e73d18 Encapsulate snapshot used for reading stripes in cstore_metadata_tables 2020-10-08 16:02:45 -07:00
Hadi Moshayedi 76a71aa61a Use SnapshotDirty for reading metadata in truncation 2020-10-08 14:46:42 -07:00
Hadi Moshayedi 55885c81dd log stats on verbose 2020-10-08 14:42:49 -07:00
Hadi Moshayedi 37e3845e6a Address Nils feedback 2020-10-08 14:42:49 -07:00
Hadi Moshayedi 74dd1facf3 add isolation tests 2020-10-08 14:42:49 -07:00
Hadi Moshayedi 2ede755107 Initial version of VACUUM 2020-10-08 14:42:49 -07:00
Hadi Moshayedi aa3032cfdd Address feedback 2020-10-08 14:42:31 -07:00
Hadi Moshayedi eeb25aca85 Add a test which checks for resource clean-up 2020-10-08 14:42:31 -07:00
Hadi Moshayedi 7cc8c8c155 Support VACUUM FULL 2020-10-08 14:42:31 -07:00
Hadi Moshayedi ad78260c3d Merge pull request #21 from citusdata/warn_shadows
Remove shadowed variable definitions
2020-10-08 13:17:30 -07:00
Hadi Moshayedi d1c7d9f09d address feedback 2020-10-08 11:50:32 -07:00
Hadi Moshayedi 92e1603443 Remove shadowed variables 2020-10-08 11:03:07 -07:00
Nils Dijk 9b9b9e2cf0 remove double declaration of stripeMetadata (#20)
Compilers seem to behave differently with variable shadowing as both I and the marlin deployment have segfaults when querying a cstore table today, however, CI seem to not care :D

This removes a double declaration that was not caught in #10
2020-10-08 19:07:18 +02: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
Hadi Moshayedi 434275d46b Merge pull request #17 from citusdata/truncate_cleanup
Implement nontransactional TRUNATE + resource clean-up on TRUNCATE
2020-10-05 11:41:09 -07:00
Hadi Moshayedi 62fc59202c Implement nontransactional truncate 2020-10-05 10:09:19 -07:00