Commit Graph

6859 Commits (3ec61f914e76c54816a3807b241e1318bb41e154)

Author SHA1 Message Date
zhjwpku 5034f8eba5
polish the codebase by fixing dozens of typos (#7166) 2023-09-01 12:21:53 +02:00
Naisila Puka 05443a77ad
Adds test for COPY FROM failure in Citus foreign tables (#7160) 2023-09-01 12:20:07 +03:00
Gürkan İndibay b8bded6454
Adds citus_pause_node udf (#7089)
DESCRIPTION: Presenting citus_pause_node UDF enabling pausing by
node_id.

citus_pause_node takes a node_id parameter and fetches all the shards in
that node and puts AccessExclusiveLock on all the shards inside that
node. With this lock, insert is disabled, until citus_pause_node
transaction is closed.

---------

Co-authored-by: Hanefi Onaldi <Hanefi.Onaldi@microsoft.com>
2023-09-01 11:39:30 +03:00
Gürkan İndibay 4a1a5491ce
Refactors grant statements (#7153)
DESCRIPTION: Refactors all grant statements to use common code blocks to
deparse
2023-09-01 09:49:46 +03:00
zhjwpku f03291a8c8
remove useless code block (#7158) 2023-08-29 17:15:22 +02:00
Naisila Puka a17fae36b9
Disable statistics collection (#7162)
Enabled by mistake in

ba40eb363c
2023-08-29 16:09:19 +03:00
Onur Tirtir 10e20d97db
Not undistribute Citus local table when converting it to a reference table / single-shard table (#7131)
Replaces https://github.com/citusdata/citus/pull/7120.
Closes https://github.com/citusdata/citus/issues/4692.

#7120 added the same functionality by implementing a transactional
--but scoped to Citus local tables-- version of TransferShards().
It was passing all the regression tests but didn't feel like an
intuitive approach.

This PR instead adds that functionality via the functions that we
use when creating a distributed table, namely, CreateShardsOnWorkers()
and CopyLocalDataIntoShards().

We insert entries into pg_dist_placement for the new shard placement(s)
and then call CreateShardsOnWorkers() to create those placement(s) on
workers.

Then we use CopyFromLocalTableIntoDistTable() to copy the data from
the local shard placement to the new shard placement(s).
CopyFromLocalTableIntoDistTable() is a new function that re-uses the
underlying logic of CopyLocalDataIntoShards() that allows copying
data from a local table into a distributed table. We tell
CopyLocalDataIntoShards() to read from local shard placement table
and to write the tuples into shard placement/s of the reference /
single-shard table. Before doing this, we temporarily delete metadata
record for the local placement to avoid from duplicating the data in
the local shard placement.

Finally, we drop the local shard placement if we were creating a
single-shard placement table and that effectively means moving the
local shard placement to the appropriate worker as we've already
created the new shard placement on the worker.

While the main motivation behind adding this functionality is to
avoid from the limitations when UndistributeTable() is called for
a Citus local table (during table conversion), this indeed optimizes
how we convert a Citus local table to a reference table /
single-shard table. This is because, the prior logic was causing
to use more disk space due to the duplication of the data during
UndistributeTable().

DESCRIPTION: Allow creating reference / distributed-schema tables from
local tables added to metadata and that use identity columns

- [x] Add tests.
- [x] Test django-tenants.
2023-08-29 13:12:07 +03:00
Onur Tirtir a830862717 Not undistribute Citus local table when converting it to a reference table / single-shard table 2023-08-29 12:57:28 +03:00
Onur Tirtir 34e3119b48 Intersect shard placements in a table type agnostic way
If we're in the middle of a table type conversion (such as from Citus
local table to a reference table), the table might not have all the
placements that we expect from the table type. For this reason, we
should intersect the placements of tables at hand when creating
inter-shard ddl tasks.
2023-08-29 12:57:28 +03:00
Onur Tirtir 5bdf19f517 Use CopyShardForeignConstraintCommandList in WorkerCreateShardCommandList
What we do to collect foreign key constraint commands in
WorkerCreateShardCommandList is quite similar to what we do in
CopyShardForeignConstraintCommandList. Plus, the code that we used
in WorkerCreateShardCommandList before was not able to properly handle
foreign key constraints between Citus local tables --when creating a
reference table from the referencing one.

With a few slight modifications made to
CopyShardForeignConstraintCommandList, we can use the same logic in
WorkerCreateShardCommandList too.
2023-08-29 12:57:28 +03:00
zhjwpku d97f786296
PQputCopyData's return value 0 should be considered fail (#7152) 2023-08-29 11:19:18 +02:00
Gokhan Gulbiz c272bb5112
Merge branch 'main', remote-tracking branch 'origin' into circleci-gha-migration 2023-08-28 13:19:03 +03:00
Gokhan Gulbiz b46ac3f1c5
Merge pull request #1 from gokhangulbiz/circleci-gha-migration-pr-trigger 2023-08-28 13:17:37 +03:00
Gokhan Gulbiz 82c97a033c
Renaming
Naming improvements
2023-08-28 13:16:21 +03:00
Gokhan Gulbiz 142a63148a
enable gcov 2023-08-28 13:16:21 +03:00
Gokhan Gulbiz 752eaff716
Better naming work build and test 2023-08-28 13:16:20 +03:00
Gokhan Gulbiz 5c5375e5ff
Fix secrets access in a composite action 2023-08-28 13:16:20 +03:00
Gokhan Gulbiz f961ed80fe
Remove run-name for build task 2023-08-28 13:16:19 +03:00
Gokhan Gulbiz a3a6df2d28
Additional configuration for codecov 2023-08-28 13:16:19 +03:00
Onur Tirtir d5d1684c45
Use correct errorCode for the errors thrown during recovery (#7146) 2023-08-28 11:03:38 +03:00
Gokhan Gulbiz b291b09349
Enable PR triggers 2023-08-24 16:36:35 +03:00
Gokhan Gulbiz 1c39c8b756
Revert "Disable test-citus temporarily"
This reverts commit 818bd9c06a.
2023-08-24 16:05:11 +03:00
Gokhan Gulbiz 88c92cc766
codecov and codeclimate 2023-08-24 16:00:15 +03:00
Naisila Puka afab879de3
PG16 - Add COPY FROM default tests (#7143)
Already supported in Citus, adding the same tests as in PG
Relevant PG commit:
https://github.com/postgres/postgres/commit/9f8377f
2023-08-24 15:52:09 +03:00
Naisila Puka 70c8aba967
PG16 - Add tests for CREATE/ALTER TABLE .. STORAGE (#7140)
Relevant PG commits:
https://github.com/postgres/postgres/commit/784cedd
https://github.com/postgres/postgres/commit/b9424d0
2023-08-24 15:26:40 +03:00
Gürkan İndibay 8d3a06c1c7
Adds grant/revoke privileges on database propagation (#7109)
DESCRIPTION: Adds grant/revoke propagation support for database
privileges

Following the implementation of support for granting and revoking
database privileges, certain tests that issued grants for worker nodes
experienced failures. These ones are fixed in this PR as well.
2023-08-24 14:43:19 +03:00
Gokhan Gulbiz d5f174705e
fix upload coverage 2023-08-24 13:48:11 +03:00
Gokhan Gulbiz a73da25e09
fix upload coverage 2023-08-24 13:39:58 +03:00
Gokhan Gulbiz 04c9d07a99
Fix upload coverage 2023-08-24 13:09:16 +03:00
Gokhan Gulbiz 818bd9c06a
Disable test-citus temporarily 2023-08-24 13:09:02 +03:00
Gokhan Gulbiz fdc35c40c6
Provide path for codeclimate results 2023-08-24 13:07:56 +03:00
Gokhan Gulbiz f92c0fa1db
Revert "flakyness test"
This reverts commit 784169cbe5.
2023-08-24 12:27:10 +03:00
Gürkan İndibay 553780e3f1
Removes ubuntu/bionic from packaging pipelines (#7142)
DESCRIPTION: Removes ubuntu/bionic from packaging pipelines

Since pg16 beta is not available for ubuntu/bionic and ubuntu/bionic
support is EOL, I need to remove this os from pipeline
https://ubuntu.com/blog/ubuntu-18-04-eol-for-devices 

Additionally, added concurrency support for GH Actions Packaging
pipeline
2023-08-24 10:30:33 +03:00
Naisila Puka b8c493f2c4
PG16 - Add GENERIC_PLAN option to EXPLAIN (#7141) 2023-08-23 20:15:54 +03:00
Gokhan Gulbiz 16f360a402
better naming 2023-08-23 15:49:20 +03:00
Gokhan Gulbiz ca8aa3face
Fix condition 2023-08-23 15:46:57 +03:00
Naisila Puka c73ef405f5
PG16 - IS JSON predicate and SYSTEM_USER tests (#7137)
Support the IS JSON predicate
Relevant PG commit:
https://github.com/postgres/postgres/commit/6ee30209

SYSTEM_USER
Relevant PG commit:
https://github.com/postgres/postgres/commit/0823d061
2023-08-23 14:13:56 +03:00
Gokhan Gulbiz fa38db2b8c
Preserve newlines 2023-08-23 14:04:50 +03:00
Marco Slot ba55fd67d7
Rename planner_readme.md to README.md (#7139) 2023-08-23 13:47:18 +03:00
Gokhan Gulbiz cfa58e9225
fix if condition 2023-08-23 13:24:00 +03:00
Gokhan Gulbiz dd8dfb9c85
Improve run name for build and test 2023-08-23 13:09:50 +03:00
Gokhan Gulbiz 3a767592d9
Add concurrency for flaky 2023-08-23 13:09:34 +03:00
Gokhan Gulbiz e7d75f094a
Fix container image name 2023-08-23 13:03:04 +03:00
Gokhan Gulbiz ad18d5d3b5
Always save logs and results 2023-08-23 12:54:01 +03:00
Gokhan Gulbiz 509c17311c
Fix test-flakyness 2023-08-23 12:30:27 +03:00
Gokhan Gulbiz bb9bdf77aa
Cleanup 2023-08-23 11:54:09 +03:00
Gokhan Gulbiz a6ec8729b1
Move workflow inputs to repository variables 2023-08-23 11:49:08 +03:00
Gokhan Gulbiz 2398b2fb21
Skip_test_flakyness added. 2023-08-23 11:17:14 +03:00
Gokhan Gulbiz d33088a79a
test-flakyness container image fix 2023-08-23 10:56:13 +03:00
Naisila Puka 36b51d617c
PG16 - Throw meaningful error for stats without a name on Citus tables (#7136)
Relevant PG commit:
624aa2a13b
624aa2a13bd02dd584bb0995c883b5b93b2152df
2023-08-23 10:25:01 +03:00