Commit Graph

3560 Commits (ea7c5f2b013d6d37901f7db49b5ba45c7f797571)

Author SHA1 Message Date
Gürkan İndibay ea7c5f2b01
Merge branch 'main' into alter_database_additional_options 2023-12-20 15:47:53 +03:00
Jodi-Ann Francis 6801a1ed1e
PG16 update GRANT... ADMIN | INHERIT | SET, and REVOKE
Allowing GRANT ADMIN to now also be INHERIT or SET in support of psql16

GRANT role_name [, ...] TO role_specification [, ...] [ WITH { ADMIN |
INHERIT | SET } { OPTION | TRUE | FALSE } ] [ GRANTED BY
role_specification ]

Fixes: #7148 
Related: #7138

See review changes from https://github.com/citusdata/citus/pull/7164
2023-12-13 15:57:02 -05:00
gindibay dd41c729f4 Adds distributed check for rename and alter db 2023-11-28 22:17:51 +03:00
gindibay ab19f4a4ee Fixes multiple includes 2023-11-28 00:08:25 +03:00
gindibay c750388699 Merge branch 'alter_database_additional_options' of https://github.com/citusdata/citus into alter_database_additional_options 2023-11-27 23:17:54 +03:00
Gürkan İndibay 81de9bb480
Merge branch 'main' into alter_database_additional_options 2023-11-27 23:24:44 +03:00
gindibay 2e00d3747f Fixes review comments 2023-11-27 22:42:52 +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
Gürkan İndibay 9301531941
Apply suggestions from code review
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-27 22:19:42 +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
gindibay ed3ebf2296 Removes unnecessary comment change 2023-11-21 20:22:02 +03:00
gindibay a747699b0d Removes duplicated includes 2023-11-21 20:20:42 +03:00
gindibay 752c2ee441 Fixes indentation 2023-11-21 19:52:57 +03:00
gindibay 3dd4735e6e Fixes runtime errors 2023-11-21 19:40:44 +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
Gürkan İndibay dc93ca8913
Update src/backend/distributed/commands/database.c
Co-authored-by: Onur Tirtir <onurcantirtir@gmail.com>
2023-11-21 16:50:40 +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 58bb165145 Removes unnecessary comments 2023-11-16 10:19:00 +03:00
gindibay da72cd3cf1 Fixes quotes for db columns 2023-11-16 10:03:02 +03:00
gindibay c63f124c93 Fixes indentation 2023-11-16 09:08:45 +03:00
gindibay 1cdae74a4c Fixes review notes 2023-11-16 08:45:20 +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 8443ae36e7 Fixes indentation 2023-11-16 02:59:32 +03:00
gindibay 95572c5ada Adds EnableCreateDatabasePropagation flag check 2023-11-16 02:58:56 +03:00
gindibay b474d98e5c Removes log 2023-11-15 23:09:35 +03:00
gindibay bb2b7ae9da Adds logs for test 2023-11-15 23:02:21 +03:00
gindibay a68587391c Fixes indentation 2023-11-15 21:32:28 +03:00
gindibay 772a13dc7c Removes SendDatabaseGrantSyncCommands 2023-11-15 21:32:01 +03:00
gindibay 9b6511ad10 Fixes indentation 2023-11-15 20:57:27 +03:00
gindibay e18c4400dc Removes unnecessary logs 2023-11-15 20:48:17 +03:00
gindibay 144ede3bf0 Adds GUC check for db grant sync 2023-11-15 20:45:13 +03:00
gindibay 37681eaed0 Fixes comment on code 2023-11-15 17:01:42 +03:00
gindibay 931514b0f7 Fixes indentation 2023-11-15 16:41:38 +03:00
gindibay 6f838e6e88 Fixes indentation 2023-11-15 16:34:02 +03:00
gindibay eb46d9399b Fixes warning on compile 2023-11-15 16:26:14 +03:00
gindibay 9a558bdece Adds datacl propagation 2023-11-15 16:04:26 +03:00
gindibay cf019b858c Adds static declarations 2023-11-14 10:21:23 +03:00