citusdata / citus_docs

Documentation for Citus. Distributed PostgreSQL as an extension.
Creative Commons Attribution 4.0 International
58 stars 59 forks source link

Rename `citus.hide_shards_from_app_name_prefixes ` -> `citus.show_shards_for_app_name_prefixes` #1049

Closed onderkalaci closed 2 years ago

onderkalaci commented 2 years ago

In the 11.0 beta, the logic was we provided app names to Citus to which shards are hidden from those apps.

In 11 GA, we changed that structure to "provide app names to Citus to which shards are shown to those apps"

Hence, rename citus.hide_shards_from_app_name_prefixes -> citus.show_shards_for_app_name_prefixes

And, the default value chaged from * to `` (empty string).

This is from updates page, hope gives the clarity on the change:

 With Citus 11.0, users can connect to any node to query their distributed tables. We are getting reports from users who are understandbly confused by seeing Citus-generated shards in their schemas next to their distributed tables when inspecting the database with tools like pgAdmin.

 To avoid the confusion, Citus 11.0 by default hides all the shards from all external applications. This is controlled by a GUC `citus.show_shards_for_app_name_prefixes`.

 This change is introduced via [`Pull request #5567`](https://github.com/citusdata/citus/pull/5567) and [`Pull request #5920`](https://github.com/citusdata/citus/pull/5920).

```sql
 -- empty string means that show shards to all applications
 show citus.show_shards_for_app_name_prefixes;
┌──────────────────────────────────────────┐
│ citus.show_shards_for_app_name_prefixes  │
├──────────────────────────────────────────┤
│                                          │
└──────────────────────────────────────────┘
(1 row)

 \d
                 List of relations
┌────────┬───────────────────┬───────┬─────────────┐
│ Schema │       Name        │ Type  │    Owner    │
├────────┼───────────────────┼───────┼─────────────┤
│ public │ citus_tables      │ view  │ onderkalaci │
│ public │ distributed_table │ table │ onderkalaci │
└────────┴───────────────────┴───────┴─────────────┘
(2 rows)

-- now configure the GUC so that it only hides shards from a specific application
-- and then, on psql -- where we run the test -- we can see the shards

SET citus.show_shards_for_app_name_prefixes TO 'psql';
\d
                     List of relations
┌────────┬──────────────────────────┬───────┬─────────────┐
│ Schema │           Name           │ Type  │    Owner    │
├────────┼──────────────────────────┼───────┼─────────────┤
│ public │ citus_tables             │ view  │ onderkalaci │
│ public │ distributed_table        │ table │ onderkalaci │
│ public │ distributed_table_102008 │ table │ onderkalaci │
│ public │ distributed_table_102015 │ table │ onderkalaci │
│ public │ distributed_table_102022 │ table │ onderkalaci │
│ public │ distributed_table_102029 │ table │ onderkalaci │
│ public │ distributed_table_102036 │ table │ onderkalaci │
└────────┴──────────────────────────┴───────┴─────────────┘
(7 rows)