Commit Graph

291 Commits (c75038869912c772d040d419f79fc68d9e67e7ab)

Author SHA1 Message Date
Gürkan İndibay 81de9bb480
Merge branch 'main' into alter_database_additional_options 2023-11-27 23:24:44 +03:00
gindibay 2608d942a2 Fixes review comments 2023-11-27 22:37:31 +03:00
gindibay 2fd191a8eb Merge branch 'alter_database_additional_options' of https://github.com/citusdata/citus into alter_database_additional_options 2023-11-27 22:23:40 +03:00
Gürkan İndibay 0526033750
Apply suggestions from code review
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-27 22:29:28 +03:00
gindibay 0c25b72a17 Fixes review notes 2023-11-27 22:23:38 +03:00
Nils Dijk 0620c8f9a6
Sort includes (#7326)
This change adds a script to programatically group all includes in a
specific order. The script was used as a one time invocation to group
and sort all includes throught our formatted code. The grouping is as
follows:

 - System includes (eg. `#include<...>`)
 - Postgres.h (eg. `#include "postgres.h"`)
- Toplevel imports from postgres, not contained in a directory (eg.
`#include "miscadmin.h"`)
 - General postgres includes (eg . `#include "nodes/..."`)
- Toplevel citus includes, not contained in a directory (eg. `#include
"citus_verion.h"`)
 - Columnar includes (eg. `#include "columnar/..."`)
 - Distributed includes (eg. `#include "distributed/..."`)

Because it is quite hard to understand the difference between toplevel
citus includes and toplevel postgres includes it hardcodes the list of
toplevel citus includes. In the same manner it assumes anything not
prefixed with `columnar/` or `distributed/` as a postgres include.

The sorting/grouping is enforced by CI. Since we do so with our own
script there are not changes required in our uncrustify configuration.
2023-11-23 18:19:54 +01:00
gindibay 455620cead Details coment for AppendBasicAlterDatabaseOptions 2023-11-22 04:45:38 +03:00
gindibay cd8e4e61a2 Fixes indentation 2023-11-22 04:23:55 +03:00
gindibay 1900c8e0f4 Fixes codecov issue 2023-11-22 04:23:28 +03:00
gindibay 63e3738f46 Fixes pre review check results 2023-11-22 03:33:03 +03:00
gindibay 5f263c1b39 Fixes review notes 2023-11-22 01:34:47 +03:00
gindibay 9d7e601e1d Fixes review notes 2023-11-21 23:36:32 +03:00
Gürkan İndibay 3b556cb5ed
Adds create / drop database propagation support (#7240)
DESCRIPTION: Adds support for propagating `CREATE`/`DROP` database

In this PR, create and drop database support is added.

For CREATE DATABASE:
* "oid" option is not supported
* specifying "strategy" to be different than "wal_log" is not supported
* specifying "template" to be different than "template1" is not
supported

The last two are because those are not saved in `pg_database` and when
activating a node, we cannot assume what parameters were provided when
creating the database.

And "oid" is not supported because whether user specified an arbitrary
oid when creating the database is not saved in pg_database and we want
to avoid from oid collisions that might arise from attempting to use an
auto-assigned oid on workers.

Finally, in case of node activation, GRANTs for the database are also
propagated.

---------

Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
Co-authored-by: Jelte Fennema-Nio <jelte.fennema@microsoft.com>
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-21 16:43:51 +03:00
gindibay a1ab60f5ad Merge branch 'main' into alter_database_additional_options 2023-11-20 14:40:52 +03:00
gindibay c123fc38ec Fixes indentation 2023-11-20 00:57:38 +03:00
gindibay 2207846d48 Fixes warning 2023-11-20 00:36:53 +03:00
Gürkan İndibay 7794aab38c
Merge branch 'create_alter_database' into alter_database_additional_options 2023-11-20 11:16:21 +03:00
Naisila Puka 0d1f18862b
Propagates SECURITY LABEL ON ROLE stmt (#7304)
We propagate `SECURITY LABEL [for provider] ON ROLE rolename IS
labelname` to the worker nodes.
We also make sure to run the relevant `SecLabelStmt` commands on a
newly added node by looking at roles found in `pg_shseclabel`.

See official docs for explanation on how this command works:
https://www.postgresql.org/docs/current/sql-security-label.html
This command stores the role label in the `pg_shseclabel` catalog table.

This commit also fixes the regex string in
`check_gucs_are_alphabetically_sorted.sh` script such that it escapes
the dot. Previously it was looking for all strings starting with "citus"
instead of "citus." as it should.

To test this feature, I currently make use of a special GUC to control
label provider registration in PG_init when creating the Citus extension.
2023-11-16 13:12:30 +03:00
gindibay ed9021ca90 Merge branch 'main' of https://github.com/citusdata/citus into create_alter_database 2023-11-16 04:37:01 +03:00
gindibay cf019b858c Adds static declarations 2023-11-14 10:21:23 +03:00
Gürkan İndibay 1e044a217d
Update src/backend/distributed/deparser/deparse_database_stmts.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-13 19:00:01 +03:00
Gürkan İndibay a956786bd8
Update src/backend/distributed/deparser/deparse_database_stmts.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-13 18:59:48 +03:00
gindibay a9977e8840 Moves validation to preprocess for createdb 2023-11-13 15:49:19 +03:00
gindibay 712fd8ebf3 Fixes comments 2023-11-13 14:23:37 +03:00
gindibay 3731c45c29 Fixes drop force option 2023-11-13 14:19:19 +03:00
Onur Tirtir 1a80181a9c indent 2023-11-13 13:42:11 +03:00
Onur Tirtir 69217678b3 allow wal_log option only if it's set to default 2023-11-13 12:16:08 +03:00
gindibay a35cae0ed7 Fixes review issues 2023-11-13 12:07:40 +03:00
gindibay 30e1a858d2 Removes oid support 2023-11-13 11:41:58 +03:00
gindibay f8b3f322aa Fixed review items 2023-11-10 08:33:51 +03:00
Gürkan İndibay 3067d1ef08
Apply suggestions from code review
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-10 17:34:09 +03:00
gindibay 1b9a8ea2db Fixes indentation 2023-11-10 06:11:43 +03:00
gindibay 2ebeea3ce3 Fixes compilation warnings 2023-11-10 06:10:24 +03:00
Gürkan İndibay 0a73cb31b0
Merge branch 'main' into create_alter_database 2023-11-10 14:12:48 +03:00
gindibay b5424db419 Fixes compilation errors 2023-11-10 05:46:30 +03:00
gindibay b45543f51b Merge remote-tracking branch 'origin/create_alter_database' into alter_database_additional_options 2023-11-10 05:38:19 +03:00
Nils Dijk 0dac63afc0
move pg_version_constants.h to toplevel include (#7335)
In preparation of sorting and grouping all includes we wanted to move
this file to the toplevel includes for good grouping/sorting.
2023-11-09 15:09:39 +00:00
gindibay 5f4092db5b Adds validation for template 2023-11-09 12:11:22 +03:00
gindibay 4c9863c0fb Fixes review comments 2023-11-09 01:49:43 +03:00
gindibay 65660db10d Fixes review items 2023-11-08 02:02:00 +03:00
gindibay 328e34969d Fixes review notes 2023-10-31 13:41:50 +03:00
gindibay 75f1e691c1 Merge branch 'create_alter_database' into alter_database_additional_options 2023-10-31 11:22:52 +03:00
gindibay 2d9181a9ab Fixes indents 2023-10-31 11:00:40 +03:00
gindibay d8639d58de Adds locale restrictions 2023-10-31 10:58:44 +03:00
gindibay c6d1ef9e41 Rollbacks enable_create_database_propagation 2023-10-14 20:19:18 +03:00
gindibay 3a6fdada11 Changes if to switch statements 2023-10-14 05:35:34 +03:00
gindibay ef920b0252 Fixes compile errors 2023-10-13 14:49:34 +03:00
Gürkan İndibay c3a9a37ae2
Merge branch 'create_alter_database' into alter_database_additional_options 2023-10-16 14:44:32 +03:00
gindibay c31479d2eb Fixes review notes 2023-10-13 14:17:14 +03:00
gindibay a274ffcb51 Adds If exists statement for drop database 2023-10-13 14:17:14 +03:00