Skip to content

Backport #8466 to release-13.2: Fix role propagation error due to missing grantor dependencies#8579

Merged
ihalatci merged 3 commits into
release-13.2from
release-13.2-backport-8466
May 15, 2026
Merged

Backport #8466 to release-13.2: Fix role propagation error due to missing grantor dependencies#8579
ihalatci merged 3 commits into
release-13.2from
release-13.2-backport-8466

Conversation

@ihalatci
Copy link
Copy Markdown
Contributor

Backport of #8466 to release-13.2.

DESCRIPTION: Add grantor role dependencies to fix node addition with interdependent roles

Modified ExpandRolesToGroups in dependency.c to track grantor roles as dependencies alongside role memberships during node activation. This ensures grantors are propagated before roles that reference them in GRANT ... GRANTED BY statements.

Added regression test covering the interdependent role scenario.

Fixes #8425

Verification (local)

  • Build: PG 16.10 ✅
  • Regression (check-multi): 188/188 ✅
  • Style check (vs. stylechecker image, uncrustify 0.68.1): no new issues introduced
  • Rebased onto latest origin/release-13.2 (12 newer upstream commits, none touch the same files)

ihalatci added 3 commits May 14, 2026 12:03
DESCRIPTION: Add grantor role dependencies to fix node addition with interdependent roles

Modified ExpandRolesToGroups in dependency.c to track grantor roles as
dependencies alongside role memberships during node activation. This
ensures grantors are propagated before roles that reference them in
GRANT ... GRANTED BY statements.

Added regression test covering the interdependent role scenario.

Fixes #8425
On PG <= 15, pg_auth_members records the original grantor on worker_2
(e.g. dist_role_1) instead of 'postgres'. Add a PG15-specific
alternative-expected file so the test passes on PG15 while keeping the
strong assertion on PG16+.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 35.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.20%. Comparing base (04351e9) to head (7e389e8).

❌ Your patch check has failed because the patch coverage (35.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (29.20%) is below the target coverage (87.50%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (04351e9) and HEAD (7e389e8). Click for more details.

HEAD has 135 uploads less than BASE
Flag BASE (04351e9) HEAD (7e389e8)
17_regress_check-follower-cluster_13.2-1_v13.2.2_coordinatoronly 1 0
17_regress_check-follower-cluster 1 0
17_regress_check-follower-cluster_13.2-1_v13.2.2_workeronly 1 0
16_regress_check-follower-cluster 1 0
17_regress_check-columnar-isolation_v13.2.2_all 1 0
17_regress_check-follower-cluster_v13.2.2_all 1 0
15_regress_check-follower-cluster 1 0
17_regress_check-follower-cluster_13.2-1_all 1 0
16_17_upgrade 1 0
17_regress_check-add-backup-node_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-enterprise-isolation-logicalrep-3_13.2-1_v13.2.2_coordinatoronly 1 0
15_regress_check-enterprise-isolation-logicalrep-2 1 0
17_regress_check-columnar_13.2-1_all 1 0
17_regress_check-columnar 1 0
17_regress_check-split 1 0
17_regress_check-columnar-isolation_13.2-1_all 1 0
17_regress_check-add-backup-node_13.2-1_v13.2.2_coordinatoronly 1 0
17_regress_check-columnar-isolation 1 0
17_regress_check-add-backup-node_v13.2.2_all 1 0
15_regress_check-add-backup-node 1 0
15_17_upgrade 1 0
17_regress_check-columnar-isolation_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-split_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-columnar_13.2-1_v13.2.2_coordinatoronly 1 0
15_regress_check-query-generator 1 0
15_regress_check-columnar 1 0
17_arbitrary_configs_3 1 0
17_regress_check-enterprise 1 0
15_16_upgrade 1 0
17_regress_check-enterprise_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-enterprise_13.2-1_all 1 0
16_arbitrary_configs_3 1 0
15_regress_check-enterprise-isolation-logicalrep-3 1 0
15_regress_check-enterprise-failure 1 0
17_regress_check-enterprise-isolation-logicalrep-2 1 0
17_regress_check-enterprise-isolation-logicalrep-2_v13.2.2_all 1 0
17_regress_check-enterprise-isolation-logicalrep-3_v13.2.2_all 1 0
17_regress_check-enterprise-isolation-logicalrep-2_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-enterprise-isolation-logicalrep-3 1 0
17_regress_check-query-generator 1 0
17_arbitrary_configs_5 1 0
17_regress_check-multi-1-create-citus 1 0
16_regress_check-vanilla 1 0
15_regress_check-vanilla 1 0
16_arbitrary_configs_2 1 0
17_regress_check-enterprise-isolation_13.2-1_v13.2.2_coordinatoronly 1 0
17_regress_check-enterprise-isolation-logicalrep-1_13.2-1_v13.2.2_coordinatoronly 1 0
17_regress_check-enterprise-isolation-logicalrep-1 1 0
16_arbitrary_configs_5 1 0
16_regress_check-multi-1-create-citus 1 0
15_regress_check-multi-mx 1 0
16_regress_check-multi-mx 1 0
16_regress_check-split 1 0
17_regress_check-split_13.2-1_v13.2.2_coordinatoronly 1 0
15_regress_check-columnar-isolation 1 0
17_regress_check-enterprise-isolation-logicalrep-3_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-columnar_v13.2.2_all 1 0
16_regress_check-enterprise-isolation-logicalrep-3 1 0
15_regress_check-split 1 0
17_regress_check-enterprise-isolation-logicalrep-2_13.2-1_all 1 0
17_regress_check-split_13.2-1_all 1 0
16_regress_check-enterprise-isolation-logicalrep-2 1 0
16_arbitrary_configs_4 1 0
17_arbitrary_configs_4 1 0
16_regress_check-failure 1 0
15_regress_check-failure 1 0
16_arbitrary_configs_0 1 0
17_arbitrary_configs_0 1 0
17_regress_check-enterprise_13.2-1_v13.2.2_coordinatoronly 1 0
17_regress_check-multi 1 0
17_regress_check-multi_v13.2.2_all 1 0
17_regress_check-multi_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-multi_13.2-1_all 1 0
17_regress_check-multi_13.2-1_v13.2.2_coordinatoronly 1 0
15_regress_check-multi 1 0
16_regress_check-multi 1 0
17_regress_check-operations_v13.2.2_all 1 0
17_regress_check-operations 1 0
15_regress_check-isolation 1 0
17_regress_check-multi-1 1 0
17_regress_check-enterprise-failure 1 0
16_regress_check-isolation 1 0
17_regress_check-isolation 1 0
15_arbitrary_configs_0 1 0
17_regress_check-isolation_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-isolation_13.2-1_v13.2.2_coordinatoronly 1 0
16_regress_check-enterprise-failure 1 0
16_regress_check-columnar-isolation 1 0
16_regress_check-add-backup-node 1 0
17_cdc_installcheck 1 0
16_regress_check-enterprise 1 0
16_cdc_installcheck 1 0
15_cdc_installcheck 1 0
16_regress_check-multi-1 1 0
17_regress_check-multi-1_13.2-1_v13.2.2_coordinatoronly 1 0
15_regress_check-multi-1 1 0
17_regress_check-multi-1_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-multi-1_13.2-1_all 1 0
17_regress_check-split_v13.2.2_all 1 0
17_regress_check-enterprise-isolation-logicalrep-1_v13.2.2_all 1 0
17_regress_check-enterprise-isolation-logicalrep-3_13.2-1_all 1 0
15_arbitrary_configs_2 1 0
17_regress_check-operations_13.2-1_all 1 0
17_regress_check-operations_13.2-1_v13.2.2_coordinatoronly 1 0
16_regress_check-operations 1 0
15_regress_check-operations 1 0
15_arbitrary_configs_4 1 0
17_regress_check-enterprise-isolation-logicalrep-1_13.2-1_all 1 0
17_arbitrary_configs_1 1 0
15_arbitrary_configs_1 1 0
16_arbitrary_configs_1 1 0
17_regress_check-columnar-isolation_13.2-1_v13.2.2_coordinatoronly 1 0
16_regress_check-columnar 1 0
17_regress_check-operations_13.2-1_v13.2.2_workeronly 1 0
15_regress_check-enterprise 1 0
17_regress_check-columnar_13.2-1_v13.2.2_workeronly 1 0
15_arbitrary_configs_3 1 0
15_regress_check-enterprise-isolation-logicalrep-1 1 0
17_regress_check-failure 1 0
17_regress_check-enterprise-isolation-logicalrep-2_13.2-1_v13.2.2_coordinatoronly 1 0
17_regress_check-add-backup-node_13.2-1_all 1 0
16_regress_check-query-generator 1 0
17_regress_check-add-backup-node 1 0
17_regress_check-vanilla 1 0
17_regress_check-enterprise-isolation_v13.2.2_all 1 0
17_regress_check-enterprise_v13.2.2_all 1 0
15_regress_check-enterprise-isolation 1 0
17_regress_check-enterprise-isolation-logicalrep-1_13.2-1_v13.2.2_workeronly 1 0
17_regress_check-enterprise-isolation_13.2-1_v13.2.2_workeronly 1 0
15_arbitrary_configs_5 1 0
15_regress_check-multi-1-create-citus 1 0
17_regress_check-isolation_13.2-1_all 1 0
17_regress_check-isolation_v13.2.2_all 1 0
17_arbitrary_configs_2 1 0
17_regress_check-multi-1_v13.2.2_all 1 0
Additional details and impacted files
@@                Coverage Diff                @@
##           release-13.2    #8579       +/-   ##
=================================================
- Coverage         88.77%   29.20%   -59.57%     
=================================================
  Files               288      288               
  Lines             64124    63798      -326     
  Branches           8071     7985       -86     
=================================================
- Hits              56925    18633    -38292     
- Misses             4815    42983    +38168     
+ Partials           2384     2182      -202     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ihalatci ihalatci merged commit 32facd6 into release-13.2 May 15, 2026
316 of 399 checks passed
@ihalatci ihalatci deleted the release-13.2-backport-8466 branch May 15, 2026 11:57
@ihalatci ihalatci mentioned this pull request May 15, 2026
ihalatci added a commit that referenced this pull request May 15, 2026
DESCRIPTION: Add grantor role dependencies to fix node addition with
interdependent roles

Modified `ExpandRolesToGroups` in `dependency.c` to track grantor roles
as dependencies alongside role memberships during node activation. This
ensures grantors are propagated before roles that reference them in
`GRANT ... GRANTED BY` statements.

Added regression test covering the interdependent role scenario.

Fixes #8425

Note: this is a clean re-application of #8466 onto current main
(replacing that PR, which had accumulated unrelated merge commits). The
change has already been backported and merged into release-14.0 (#8568),
release-13.2 (#8579), and release-12.1 (#8569).
ihalatci added a commit that referenced this pull request May 15, 2026
Adds the CHANGELOG entry for v13.3.0.

This release includes the following backports merged into release-13.2
since v13.2.2:
- #8541 - DDLs for schema-based sharding from any node
- #8543, #8571 - citus_cluster_changes_{block,unblock,block_status} UDFs
- #8466 (via #8579) - role propagation grantor dependencies
- #8540 (via #8575) - deadlock with long partition constraint names

Version bump to 13.3.0 was already done in e8a841d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Role propagation error due to interdependent roles while adding new nodes

2 participants