Commit Graph

5282 Commits (c0eb67b24faf2a3b69f9f8b088eb4f2f24a809eb)

Author SHA1 Message Date
Halil Ozan Akgul c0eb67b24f Skip forceCloseAtTransactionEnd connections only if BEGIN was not sent on them 2021-11-01 17:43:04 +03:00
Jelte Fennema 57a0228c52
Fix string-concatenation warning on Clang 13 (#5425)
Clang 13 complains about a suspicious string concatenation. It thinks we
might have missed a comma. This adds parentheses to make it clear that
concatenation is indeed what we meant.
2021-11-01 13:55:43 +03:00
Marco Slot 53882f4723
Merge pull request #5268 from citusdata/renaming 2021-10-30 10:03:27 +02:00
naisila 796d56a7b1 Rename ddlJob->commandString to ddlJob->metadataSyncCommand 2021-10-29 23:45:43 +03:00
Jelte Fennema b19979fda5
Update install command to work on Ubuntu 20.04 (#5362)
libxslt-dev was renamed to libxslt1-dev in Ubuntu 20.04. This is also an
alias for this package on Ubuntu 18.04, so this new command works there
too.
2021-10-28 04:13:09 -07:00
Ahmet Gedemenli 67dca4363d
Dont auto-undistribute user-added citus local tables (#5314)
* Disable auto-undistribute for user-added citus local tables
2021-10-28 12:10:26 +03:00
Nils Dijk f4297f774a
Bump mitmproxy version (#5334)
There is a vulnerability in mitmproxy with the version we are using.

It would be hard to exploit anything with regards to the artifacts we ship as its only used in our test suite. Still its good hygiene to _not_ use software with known vulnerabilities.

This PR updates the version of python, mitmproxy and the crypto libraries used.
The latest version of mitmproxy for python 3.6 is not patched, hence the upgrade of python.
For our CI images this cascades into upgrading debian as well :)

For CI we bake these versions in our images so we need to update them as well.

Changes to the CI images: https://github.com/citusdata/the-process/pull/65
2021-10-27 17:57:13 +02:00
Jelte Fennema a8cbeb1047
Fix docs of arbitrary configs (#5413)
The old command would run none of the tests. The new command runs all of
the tests for the given configs.
2021-10-27 17:16:24 +02:00
Philip Dubé 44204ec9f1
Merge pull request #5401 from citusdata/fix-typos
Fix typos. Spurred spotting "connectios" in logs
2021-10-25 15:33:16 +00:00
Philip Dubé cc50682158 Fix typos. Spurred spotting "connectios" in logs 2021-10-25 13:54:09 +00:00
Jelte Fennema 3bdbfc3edf
Fix duplicate typedef which can cause compile failures (#5406)
ColumnarScanDesc is already defined in columnar_tableam.h. Redifining it
again causes a compiler error on some C compilers.

Useful reference: https://bugzilla.redhat.com/show_bug.cgi?id=767538

Fixes #5404
2021-10-25 12:20:13 +00:00
Önder Kalacı fc00ddee4e
Merge pull request #5386 from citusdata/simplify_2pc_decision
Simplify 2PC decision in the executor
2021-10-23 09:35:22 +02:00
Onder Kalaci ce4c4540c5 Simplify 2PC decision in the executor
It seems like the decision for 2PC is more complicated than
it should be.

With this change, we do one behavioral change. In essense,
before this commit, when a SELECT task with replication factor > 1
is executed, the executor was triggering 2PC. And, in fact,
the transaction manager (`ConnectionModifiedPlacement()`) was
able to understand not to trigger 2PC when no modification happens.

However, for transaction blocks like:
BEGIN;
-- a command that triggers 2PC
-- A SELECT command on replication > 1
..
COMMIT;

The SELECT was used to be qualified as required 2PC. And, as a side-effect
the executor was setting `xactProperties.errorOnAnyFailure = true;`

So, the commands was failing at the time of execution. Now, they fail at
the end of the transaction.
2021-10-23 09:06:28 +02:00
Önder Kalacı 8664e6873f
Merge pull request #5381 from citusdata/do_not_mark_placements_invalid
Drop support Inactive Shard States
2021-10-23 09:04:50 +02:00
Onder Kalaci 575bb6dde9 Drop support for Inactive Shard placements
Given that we do all operations via 2PC, there is no way
for any placement to be marked as INACTIVE.
2021-10-22 18:03:35 +02:00
Önder Kalacı b3299de81c
Drop support for citus.multi_shard_commit_protocol (#5380)
In the past, we allowed users to manually switch to 1PC
(e.g., one phase commit). However, with this commit, we
don't. All multi-shard modifications are done via 2PC.
2021-10-21 14:01:28 +02:00
Marco Slot e4760e348a
Merge pull request #5389 from citusdata/marcocitus/remove-master_get_table_metadata 2021-10-21 12:21:40 +02:00
Marco Slot df43868369 Remove PG11 expected upgrade_list_citus_objects output 2021-10-21 12:08:05 +02:00
Marco Slot dafba6c242 Deprecate master_get_table_metadata UDF 2021-10-21 12:08:05 +02:00
Marco Slot 3b7641b32d
Merge pull request #5396 from citusdata/marcocitus/opclass-parameters
Support operator class parameters in indexes
2021-10-21 10:38:11 +02:00
Marco Slot defb97b7f5 Support operator class parameters in indexes 2021-10-20 17:03:59 +02:00
Önder Kalacı 3f726c72e0
When replication factor > 1, all modifications are done via 2PC (#5379)
With Citus 9.0, we introduced `citus.single_shard_commit_protocol` which
defaults to 2PC.

With this commit, we prevent any user to set it to 1PC and drop support
for `citus.single_shard_commit_protocol`.

Although this might add some overhead for users, it is already the default
behaviour (so less likely) and marking placements as INVALID is much
worse.
2021-10-20 01:39:03 -07:00
Sait Talha Nisanci a851211dbc Run tests sequentially 2021-10-19 18:35:26 +03:00
Marco Slot 641ef9bd6f Fix flappy subquery_append test 2021-10-19 15:29:01 +02:00
Sait Talha Nisanci 56abd3d501 Increase parallelism 2021-10-19 15:38:58 +03:00
Marco Slot d9e36820f4
Merge pull request #5361 from citusdata/marcocitus/remove-append-4 2021-10-19 12:50:22 +02:00
Marco Slot 096660d61d Remove master_apply_delete_command 2021-10-18 22:29:37 +02:00
Marco Slot 9571311c65
Merge pull request #5359 from citusdata/marcocitus/remove-append-3 2021-10-18 22:07:41 +02:00
Marco Slot bece86b2f7 Add some subquery on append-distributed table tests 2021-10-18 21:11:16 +02:00
Marco Slot 93e79b9262 Never allow co-located joins of append-distributed tables 2021-10-18 21:11:16 +02:00
Marco Slot b97e5081c7 Disable co-located joins for append-distributed tables 2021-10-18 21:11:16 +02:00
Marco Slot dfad73d918 Disable implicit single re-partition joins for append tables 2021-10-18 21:11:16 +02:00
Marco Slot 2206e64e42 Disable single-repartition joins for append tables 2021-10-18 21:11:16 +02:00
Sait Talha Nisanci 6ff2083311 Remove base test as it is not useful anymore 2021-10-18 20:31:18 +03:00
Sait Talha Nisanci 7336c03c22 Add local-dist table joins to arbitrary configs 2021-10-18 20:31:18 +03:00
Önder Kalacı 31c8f279ac
Add helper UDFs to inspect object dependencies (#5293)
- citus_get_all_dependencies_for_object: emulate what Citus
                                         would qualify as
					 dependency when adding
					 a new node
- citus_get_dependencies_for_object: emulate what Citus would qualify
				     as dependency when creating an
				     object

Example use:
```SQL
-- find all the depedencies of table test
SELECT
	pg_identify_object(t.classid, t.objid, t.objsubid)
FROM
	(SELECT * FROM pg_get_object_address('table', '{test}', '{}')) as addr
JOIN LATERAL
	citus_get_all_dependencies_for_object(addr.classid, addr.objid, addr.objsubid) as t(classid oid, objid oid, objsubid int)
ON TRUE
	ORDER BY 1;
```
2021-10-18 14:46:49 +03:00
Halil Ozan Akgül 169084f1bb
Merge pull request #5382 from citusdata/fix_comma_bug_in_ShardListInserCommand
Fix the extra comma bug in ShardListInsertCommand
2021-10-18 13:37:41 +03:00
Halil Ozan Akgul e3446692f3 Fix the bug by adding comma before the values 2021-10-15 18:42:23 +03:00
Halil Ozan Akgül b576e69260
Merge pull request #5378 from citusdata/turn_mx_on_columnar_schedule
Fix the tests that fail with MX in columnar_schedule
2021-10-15 13:28:53 +03:00
Halil Ozan Akgul 3fb996f6de Fix the tests that fail with MX in columnar_schedule 2021-10-15 13:09:01 +03:00
Halil Ozan Akgül eca784d088
Merge pull request #5377 from citusdata/turn_mx_on_multi_schedule
Fix tests that fail with MX in multi_schedule
2021-10-15 13:08:30 +03:00
Halil Ozan Akgul b710e0064d Fix tests that fail with MX in multi_schedule 2021-10-15 12:58:38 +03:00
Onur Tirtir 59caaf0a54
Merge pull request #5375 from citusdata/update-cl-10.2.2
Add changelog for 10.2.2
2021-10-14 14:29:55 +03:00
Onur Tirtir c2ea886085 Add changelog for 10.2.2 2021-10-14 14:09:57 +03:00
Ahmet Gedemenli 35f6fe5f9f
Refactor/Improve PreprocessAlterTableStmtAttachPartition (#5366)
* Refactor/Improve PreprocessAlterTableStmtAttachPartition
2021-10-14 11:39:39 +03:00
SaitTalhaNisanci de61a89083
Fix sql_schedule_name problem (#5371) 2021-10-13 13:10:00 +02:00
Hanefi Onaldi 3e64dc44c8
Fix some typos in comments (#5369) 2021-10-13 13:00:39 +03:00
Önder Kalacı af876bf452
Add value materialization test (#5368) 2021-10-13 09:08:24 +02:00
SaitTalhaNisanci a39859bc74
Remove unnecesary output (#5367) 2021-10-13 09:28:01 +03:00
SaitTalhaNisanci 3f65751d43
Add an infrastructure to run same tests with arbitrary configs (#5316)
To run tests in parallel use:

```bash
make check-arbitrary-configs parallel=4
```

To run tests sequentially use:

```bash
make check-arbitrary-configs parallel=1
```

To run only some configs:

```bash
make check-arbitrary-base CONFIGS=CitusSingleNodeClusterConfig,CitusSmallSharedPoolSizeConfig
```

To run only some test files with some config:

```bash
make check-arbitrary-base CONFIGS=CitusSingleNodeClusterConfig EXTRA_TESTS=dropped_columns_1
```

To get a deterministic run, you can give the random's seed:

```bash
make check-arbitrary-configs parallel=4 seed=12312
```

The `seed` will be in the output of the run.

In our regular regression tests, we can see all the details about either planning or execution but this means
we need to run the same query under different configs/cluster setups again and again, which is not really maintanable.

When we don't care about the internals of how planning/execution is done but the correctness, especially with different configs
this infrastructure can be used.

With `check-arbitrary-configs` target, the following happens:

-   a bunch of configs are loaded, which are defined in `config.py`. These configs have different settings such as different shard count, different citus settings, postgres settings, worker amount, or different metadata.
-   For each config, a separate data directory is created for tests in `tmp_citus_test` with the config's name.
-   For each config, `create_schedule` is run on the coordinator to setup the necessary tables.
-   For each config, `sql_schedule` is run. `sql_schedule` is run on the coordinator if it is a non-mx cluster. And if it is mx, it is either run on the coordinator or a random worker.
-   Tests results are checked if they match with the expected.

When tests results don't match, you can see the regression diffs in a config's datadir, such as `tmp_citus_tests/dataCitusSingleNodeClusterConfig`.

We also have a PostgresConfig which runs all the test suite with Postgres.
By default configs use regular user, but we have a config to run as a superuser as well.

So the infrastructure tests:

-   Postgres vs Citus
-   Mx vs Non-Mx
-   Superuser vs regular user
-   Arbitrary Citus configs

When you want to add a new test, you can add the create statements to `create_schedule` and add the sql queries to `sql_schedule`.
If you are adding Citus UDFs that should be a NO-OP for Postgres, make sure to override the UDFs in `postgres.sql`.

You can add your new config to `config.py`. Make sure to extend either `CitusDefaultClusterConfig` or `CitusMXBaseClusterConfig`.

On the CI, upon a failure, all logfiles will be uploaded as artifacts, so you can check the artifacts tab.
All the regressions will be shown as part of the job on CI.

In your local, you can check the regression diffs in config's datadirs as in `tmp_citus_tests/dataCitusSingleNodeClusterConfig`.
2021-10-12 14:24:19 +03:00