Commit Graph

4723 Commits (c3446fbdbd560938674ffd091955cc11583e8c50)

Author SHA1 Message Date
Gokhan Gulbiz c3446fbdbd
Adjust test-citus 2023-10-31 15:32:21 +03:00
Gokhan Gulbiz 2b2715e59f
Adjust check-style
(cherry picked from commit 5d7924e7c7)
2023-10-31 15:10:21 +03:00
Gokhan Gulbiz 853575ca4f
Adjust upgrade_pg_versions 2023-10-31 15:10:18 +03:00
Gokhan Gulbiz 4eb3b2d0a3
Remove code climate coverage
(cherry picked from commit 512d185cc3)
2023-10-31 15:07:05 +03:00
Gokhan Gulbiz 2eb72cb9b8
Adjust test-pg-upgrade
(cherry picked from commit 92ddf2e867)
2023-10-31 15:06:40 +03:00
Gokhan Gulbiz 4f16b9819c
Remove flaky test section
(cherry picked from commit d69fe364f4)
2023-10-31 15:06:22 +03:00
Gokhan Gulbiz 144fb90a1e
Remove upload-coverage section
(cherry picked from commit ec531c4afb)
2023-10-31 15:06:13 +03:00
Gokhan Gulbiz 992e749de6
Remove test-arbitrary-configs section
(cherry picked from commit 344bc5b86e)
2023-10-31 15:01:21 +03:00
Gokhan Gulbiz 058851d7f9
Modify pg versions
(cherry picked from commit 615cdca97b)
2023-10-31 14:53:02 +03:00
Gokhan Gulbiz 1482bf3727
Disable CircleCI
(cherry picked from commit 790dca08bc)
2023-10-31 14:43:29 +03:00
Gokhan Gulbiz 08240e37b4
Move GHA environment variables to workflow file (#7275)
Since GHA does not interpolate env variables in a matrix context, This
PR defines them in a separate job and uses them in other jobs.

(cherry picked from commit 2bf1472c8e)
2023-10-31 14:43:00 +03:00
Gokhan Gulbiz 51605e1b31
CircleCI to GHA migration (#7154)
Co-authored-by: Hanefi Onaldi <Hanefi.Onaldi@microsoft.com>
(cherry picked from commit e0b0cdbb87)
2023-10-31 14:40:12 +03:00
Hanefi Onaldi 11db00990f
Bump Citus version to 10.0.8 2023-04-26 16:05:20 +03:00
Hanefi Onaldi bd5544fdc5
Add missing entry for 10.0.8 2023-04-26 16:05:20 +03:00
Hanefi Onaldi e5e50570b3
Add changelog entries for 10.0.8 2023-04-26 13:31:50 +03:00
aykut-bozkurt 758cda1394 fix single tuple result memory leak (#6724)
We should not omit to free PGResult when we receive single tuple result
from an internal backend.
Single tuple results are normally freed by our ReceiveResults for
`tupleDescriptor != NULL` flow but not for those with `tupleDescriptor
== NULL`. See PR #6722 for details.

DESCRIPTION: Fixes memory leak issue with query results that returns
single row.

(cherry picked from commit 9e69dd0e7f)
2023-02-17 14:41:30 +03:00
Halil Ozan Akgul 8b4bab14a2 Fixes the bug where undistribute can drop Citus extension
(cherry picked from commit b255706189)

 Conflicts:
	src/backend/distributed/commands/alter_table.c
	src/include/distributed/metadata/dependency.h
2022-06-13 16:36:59 +03:00
jeff-davis 115f2c124a Columnar: fix wraparound bug. (#5962)
columnar_vacuum_rel() now advances relfrozenxid.

Fixes #5958.

(cherry picked from commit 74ce210f8b)
2022-05-27 09:33:18 -07:00
Onur Tirtir 4b7af5aaaf Fix coordinator/worker query targetlists for agg. that we cannot push-down (#5679)
Previously, we were wrapping targetlist nodes with Vars that reference
to the result of the worker query, if the node itself is not `Const` or
not a `Param`. Indeed, we should not do that unless the node itself is
a `Var` node or contains a `Var` within it (e.g.: `OpExpr(Var(column_a) > 2)`).
Otherwise, when worker query returns empty result set, then combine
query exec would crash since the `Var` would be pointing to an empty
tuple slot, which is not desirable for the node-executor methods.

(cherry picked from commit 79442df1b7)
2022-02-07 11:40:39 +03:00
Onur Tirtir 6b87b3ea27 Skip deleting options if columnar.options is already dropped (#5458)
Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.

(cherry picked from commit 25024b776e)

 Conflicts:
	src/test/regress/after_pg_upgrade_schedule
	src/test/regress/expected/upgrade_columnar_after.out
	src/test/regress/sql/upgrade_columnar_after.sql
2021-11-12 15:17:59 +03:00
Hanefi Onaldi d13b989cff
Bump Citus version to 10.0.6 2021-11-12 14:14:33 +03:00
Hanefi Onaldi 0f62f1a93a
Add changelog entries for 10.0.6
(cherry picked from commit 45549d20a6)
2021-11-12 14:12:16 +03:00
Sait Talha Nisanci 83585e32f9 Adjust tests for release-10.0 2021-11-08 12:51:23 +03:00
Sait Talha Nisanci 0f1f55c287 Fix missing from entry
(cherry picked from commit a0e0759f73)
2021-11-08 12:39:23 +03:00
Onder Kalaci 3e8348c29e Deparse/parse the local cached queries
With local query caching, we try to avoid deparse/parse stages as the
operation is too costly.

However, we can do deparse/parse operations once per cached queries, right
before we put the plan into the cache. With that, we avoid edge
cases like (4239) or (5038).

In a sense, we are making the local plan caching behave similar for non-cached
local/remote queries, by forcing to deparse the query once.

(cherry picked from commit 69ca943e58)
2021-11-08 12:38:11 +03:00
Nils Dijk 537618aaed
reinstate optimization that got unintentionally broken in 366461ccdb (#5418)
DESCRIPTION: Reinstate optimisation for uniform shard interval ranges

During a refactor introduced in #4132 the following change was made, which made the optimisation in `CalculateUniformHashRangeIndex` unreachable: 
366461ccdb (diff-565a339ed3c78bc5a0d4ffeb4e91032150b1dffbeeff59cd3e65981d20b998c7L319-R319)

This PR reinstates the path to the optimisation!
2021-11-05 13:09:25 +01:00
Onur Tirtir 6c989830d2 Add CheckCitusVersion() calls to columnarAM (#5308)
Considering all code-paths that we might interact with a columnar table,
add `CheckCitusVersion` calls to tableAM callbacks:
- initializing table scan (`columnar_beginscan` & `columnar_index_fetch_begin`)
- setting a new filenode for a relation (storage initializiation or a table rewrite)
- truncating the storage
- inserting tuple (single and multi)

Also add `CheckCitusVersion` call to:
- drop hook (`ColumnarTableDropHook`)
- `alter_columnar_table_set` & `alter_columnar_table_reset` UDFs
(cherry picked from commit f8b1ff7214)

 Conflicts:
	src/backend/columnar/cstore_tableam.c
	src/test/regress/expected/multi_extension.out
	src/test/regress/sql/multi_extension.sql

 Note: Not applying multi_extension.sql/out changes to 10.0 since
       previous Citus version (9.5) already doesn't have columnarAM.
2021-09-20 17:45:27 +03:00
Marco Slot 259511746e Small fix to PG12 compatibility 2021-09-10 14:21:03 +02:00
Marco Slot bd245b5fbb Avoid switch to superuser in worker_merge_files_into_table 2021-09-10 13:25:52 +02:00
Marco Slot 25c71fb3d0 Add worker_append_table_to_shard permissions tests 2021-09-10 13:25:52 +02:00
Marco Slot 28a503fad9 Perform copy command as regular user in worker_append_table_to_shard 2021-09-10 13:25:52 +02:00
Onur Tirtir 30b46975b8 Not read heaptuple after closing pg_rewrite (#5255)
(cherry picked from commit cc49e63222)
2021-09-08 16:02:05 +03:00
Hanefi Onaldi 5f5e5ef471
Bump Citus version to 10.0.5 2021-08-17 07:45:37 +03:00
Hanefi Onaldi 5a1036e361
Add changelog entries for 10.0.5
(cherry picked from commit 167a023770)
2021-08-16 17:38:54 +03:00
Onder Kalaci 6de2a09d79 Guard against hard WaitEvenSet errors
In short, add wrappers around Postgres' AddWaitEventToSet() and
ModifyWaitEvent().

AddWaitEventToSet()/ModifyWaitEvent*() may throw hard errors. For
example, when the underlying socket for a connection is closed by
the remote server and already reflected by the OS, however
Citus hasn't had a chance to get this information. In that case,
if replication factor is >1, Citus can failover to other nodes
for executing the query. Even if replication factor = 1, Citus
can give much nicer errors.

So CitusAddWaitEventSetToSet()/CitusModifyWaitEvent() simply puts
AddWaitEventToSet()/ModifyWaitEvent() into a PG_TRY/PG_CATCH block
in order to catch any hard errors, and returns this information to
the caller.
2021-08-10 09:38:09 +02:00
Onder Kalaci d485003807 Adjust the tests to earlier versions
- Drop PRIMARY KEY for Citus 10 compatibility
- Drop columnar for PG 12
- Do not start/stop metadata sync as stop is not implemented in 10.1
- PG 11 parallel query changes explain outputs
2021-08-06 16:38:01 +02:00
Onder Kalaci 32124efd83 Dropped columns do not diverge distribution column for partitioned tables
Before this commit, creating a partition after a DROP column
on the parent (position before dist. key) was leading to
partition to have the wrong distribution column.
2021-08-06 13:42:06 +02:00
naisila c84d1d9e70 Fix master_update_table_statistics scripts for 9.5 2021-08-03 16:45:46 +03:00
naisila b46f8874d3 Fix master_update_table_statistics scripts for 9.4 2021-08-03 16:45:46 +03:00
Hanefi Onaldi 1492bd1e8b
Bump Citus to 10.0.4 2021-07-14 16:03:45 +03:00
Hanefi Onaldi 4082fab0c9
Add changelog entry for 10.0.4
(cherry picked from commit 45b72c204d)
2021-07-14 15:49:44 +03:00
Hanefi Onaldi 4ca544200c
Use ONLY keywords on PG11 deparser 2021-07-13 17:27:34 +03:00
Marco Slot e58b78f1e8
Fix FROM ONLY queries on partitioned tables
(cherry picked from commit 4b49cb112f)
2021-07-13 17:27:33 +03:00
jeff-davis f526eec6a8 Columnar: use clause Vars for chunk group filtering. (#4856)
* Columnar: use clause Vars for chunk group filtering.

This solves #4780 and also provides a cleaner separation between chunk
group filtering and projection pushdown.

* Columnar: sort and deduplicate Vars pulled from clauses.

* Columnar: cleanup variable names.

* Columnar: remove alternate test output.

* Columnar: do not recurse when looking for whereClauseVars.

Co-authored-by: Jeff Davis <jefdavi@microsoft.com>
(cherry picked from commit 063e673038)
2021-07-13 12:01:57 -07:00
SaitTalhaNisanci 5759233f15
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.

(cherry picked from commit b453563e88)
2021-07-13 11:30:15 +03:00
Hanefi Onaldi 6640c76bde
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

(cherry picked from commit 9919fbe3f8)
2021-07-13 08:06:58 +03:00
Sait Talha Nisanci 11d5d21fd8
Call LockPlacementCleanup in RemoveOldShardPlacementForNodeGroup 2021-07-13 05:30:51 +03:00
SaitTalhaNisanci 4fbed90505
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>
(cherry picked from commit 93c2dcf3d2)
2021-07-13 05:30:51 +03:00
Ahmet Gedemenli 7214673a9f Fix test output for cherry-picked commits for 10.0 2021-07-12 16:42:15 +03:00
Ahmet Gedemenli 79a274e226 Fix relname null bug when parallel execution
(cherry picked from commit 69d39c0e8b)
2021-07-12 16:42:15 +03:00