Commit Graph

53 Commits (c3a9a37ae24a1dbd2af1939aa51d9ca84c95ffa8)

Author SHA1 Message Date
Gürkan İndibay c3a9a37ae2
Merge branch 'create_alter_database' into alter_database_additional_options 2023-10-16 14:44:32 +03:00
gindibay ca5e234821 Adds EnableCreateDatabasePropagation for drop db 2023-10-13 14:17:14 +03:00
gindibay abf9dd9e59 Adds EnableCreateDatabasePropagation check 2023-10-13 14:17:14 +03:00
gindibay 333f77a267 Fixes distributed_object management 2023-10-13 14:17:14 +03:00
gindibay c31479d2eb Fixes review notes 2023-10-13 14:17:14 +03:00
gindibay 8cc67921cb Fixes review comments 2023-10-13 14:17:14 +03:00
gindibay f2092d2f44 Clarifies the code 2023-10-13 14:17:14 +03:00
gindibay 7bdeb2f866 Fixes indentation 2023-10-13 14:17:14 +03:00
gindibay fb6dd413ad Fixes PostprocessCreateDatabaseStmt comment 2023-10-13 14:17:14 +03:00
gindibay d0ef13dc89 Fixes review comments 2023-10-13 14:17:14 +03:00
gindibay 480c22acc2 Fixes the comment 2023-10-13 14:17:14 +03:00
gindibay 94abb07409 Fixes indentation 2023-10-13 14:17:13 +03:00
gindibay 1f578791bb Fixes pg_dist_object delete problem 2023-10-13 14:17:13 +03:00
gindibay a5e0b9411a Adds tests for create and drop database 2023-10-13 14:17:13 +03:00
gindibay cef9ac702e Fixes indentation 2023-10-13 14:17:13 +03:00
gindibay eb1f093381 Fixes runtime and compile errors 2023-10-13 14:17:13 +03:00
gindibay 39cb7977ce Fixes additional compile errors 2023-10-13 14:16:43 +03:00
gindibay 0d5c2f9350 Adds first commit 2023-10-13 14:16:43 +03:00
Gürkan İndibay c38e856f13
Merge branch 'create_alter_database' into alter_database_additional_options 2023-10-14 08:15:45 +03:00
gindibay 0fdb3384d9 Adds EnableCreateDatabasePropagation for drop db 2023-10-13 04:46:53 +03:00
gindibay 06050a1411 Adds EnableCreateDatabasePropagation check 2023-10-13 04:36:49 +03:00
gindibay bc0a283221 Fixes distributed_object management 2023-10-13 04:26:03 +03:00
gindibay 761fb13ac8 Fixes review notes 2023-10-13 03:10:17 +03:00
gindibay 4087d1941d Fixes review comments 2023-10-13 00:12:38 +03:00
gindibay f8962380a1 Adds expected test result 2023-10-12 19:36:13 +03:00
gindibay 8d6d27a241 Adds set tablespace support 2023-10-12 19:06:27 +03:00
gindibay 959d26db89 Fixes code indents 2023-10-11 20:01:12 +03:00
gindibay 6a333ca742 Adds alter database rename stmt propagation 2023-10-11 19:59:33 +03:00
gindibay fd521f2792 Fixes indentation 2023-10-11 18:09:45 +03:00
gindibay 37d2a5f5a8 Adds seperate set tablespace on each node support 2023-10-11 18:09:00 +03:00
gindibay 2d9da93d3d Adds connection limit 2023-10-11 17:28:40 +03:00
gindibay 78f8ae22c4 Clarifies the code 2023-10-09 20:24:34 +03:00
gindibay 1a26316cef Fixes indentation 2023-10-09 20:03:07 +03:00
gindibay be9f660fad Fixes PostprocessCreateDatabaseStmt comment 2023-10-09 20:01:29 +03:00
gindibay 5dd6ed6935 Fixes review comments 2023-10-09 19:42:17 +03:00
gindibay d573910f2a Fixes the comment 2023-10-09 18:10:28 +03:00
gindibay 6d429521b6 Fixes indentation 2023-10-06 15:22:15 +03:00
gindibay 8ded5bc256 Fixes pg_dist_object delete problem 2023-10-06 15:18:16 +03:00
gindibay 236ea1d1b9 Adds tests for create and drop database 2023-10-04 21:20:19 +03:00
gindibay 90ead5dd19 Fixes indentation 2023-10-04 13:32:39 +03:00
gindibay 84826dcc98 Fixes runtime and compile errors 2023-10-04 13:23:28 +03:00
gindibay ae9cd9c895 Fixes additional compile errors 2023-10-04 13:23:28 +03:00
gindibay 226696e42a Adds first commit 2023-10-04 13:23:28 +03:00
Gürkan İndibay 7c0b289761
Adds alter database set option (#7181)
DESCRIPTION: Adds support for ALTER DATABASE <db_name> SET .. statement
propagation
SET statements in Postgres has a common structure which is already being
used in Alter Function
statement. 
In this PR, I added a util file; citus_setutils and made it usable for
both for
alter database<db_name>set .. and alter function ... set ... statements.
With this PR, below statements will be propagated
```sql
ALTER DATABASE name SET configuration_parameter { TO | = } { value | DEFAULT }
ALTER DATABASE name SET configuration_parameter FROM CURRENT
ALTER DATABASE name RESET configuration_parameter
ALTER DATABASE name RESET ALL
```
Additionally, there was a bug in processing float values in the common
code block.
I fixed this one as well

Previous
```C
case T_Float:
			{
				appendStringInfo(buf, " %s", strVal(value));
				break;
			}
```
Now
```C
case T_Float:
			{
				appendStringInfo(buf, " %s", nodeToString(value));
				break;
			}
```
2023-09-14 16:29:16 +03:00
Gürkan İndibay e5e64b7454
Adds alter database propagation - with and refresh collation (#7172)
DESCRIPTION: Adds ALTER DATABASE WITH ... and REFRESH COLLATION VERSION
support

This PR adds supports for basic ALTER DATABASE statements propagation 
support. Below statements are supported:
ALTER DATABASE <database_name> with IS_TEMPLATE <true/false>;
ALTER DATABASE <database_name> with CONNECTION LIMIT <integer_value>;
ALTER DATABASE <database_name> REFRESH COLLATION VERSION;

---------

Co-authored-by: Jelte Fennema-Nio <jelte.fennema@microsoft.com>
2023-09-12 14:09:15 +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
aykutbozkurt 7387c7ed3d address method should take parameter isPostprocess 2022-08-02 21:00:23 +03:00
aykutbozkurt 9d232d7b00 change address method to return list of addresses 2022-07-19 18:13:11 +03:00
Jelte Fennema 184c7c0bce
Make enterprise features open source (#6008)
This PR makes all of the features open source that were previously only
available in Citus Enterprise.

Features that this adds:
1. Non blocking shard moves/shard rebalancer
   (`citus.logical_replication_timeout`)
2. Propagation of CREATE/DROP/ALTER ROLE statements
3. Propagation of GRANT statements
4. Propagation of CLUSTER statements
5. Propagation of ALTER DATABASE ... OWNER TO ...
6. Optimization for COPY when loading JSON to avoid double parsing of
   the JSON object (`citus.skip_jsonb_validation_in_copy`)
7. Support for row level security
8. Support for `pg_dist_authinfo`, which allows storing different
   authentication options for different users, e.g. you can store
   passwords or certificates here.
9. Support for `pg_dist_poolinfo`, which allows using connection poolers
   in between coordinator and workers
10. Tracking distributed query execution times using
   citus_stat_statements (`citus.stat_statements_max`,
   `citus.stat_statements_purge_interval`,
   `citus.stat_statements_track`). This is disabled by default.
11. Blocking tenant_isolation
12. Support for `sslkey` and `sslcert` in `citus.node_conninfo`
2022-06-16 00:23:46 -07:00
Nils Dijk b71a08955a
Refactor: reduce complexity and code duplication for Object Propagation
Over time we have added significantly improved the support for objects to be propagated by Citus as to make scaling out the database more seamless. It became evident that there was a lot of code duplication that got into the codebase to implement the propagation.

This PR tries to reduce the amount of repeated code that is at most only slightly different. To make things worse, most of the differences were actually oversights instead of correct.

This Patch introduces 3 reusable sets of pre/post processing steps for respectively
 - create
 - alter
 - drop

With the use of the common functionality we should have more coherent behaviour between different supported object by Citus.

Some steps either omit the Pre or Post processing step if they would not make sense to include.

All tests pass, only 1 test needed changing, foreign servers, as the dropping of foreign servers didn't implement support for dropping multiple foreign servers at once. Given the common approach correctly supports dropping of multiple objects, either distributed or not, the test that assumed it wouldn't work was now obsolete.
2022-05-18 15:58:28 +02:00