Skip to content

Backport #8466 to release-12.1: Fix role propagation error due to missing grantor dependencies#8569

Open
ihalatci wants to merge 1 commit into
release-12.1from
release-12.1-backport-8466
Open

Backport #8466 to release-12.1: Fix role propagation error due to missing grantor dependencies#8569
ihalatci wants to merge 1 commit into
release-12.1from
release-12.1-backport-8466

Conversation

@ihalatci
Copy link
Copy Markdown
Contributor

Backport of #8466 to release-12.1.

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

12.1-specific notes

The cherry-pick required minor expected/create_role_propagation.out adjustments:

  • Reverted unrelated column-width / non_dist_role_1 rows that were absent in 12.1's baseline.
  • New test's worker_2 grantor column: interdep_role1postgres (on 12.1, GRANTED BY is not preserved when re-propagating to a re-added worker — a separate, pre-existing limitation). The fix's core behavior (master_add_node no longer fails with the missing-admin-option error) works correctly.

Verification

  • Build: PG 16.10 ✅
  • Regression (check-multi): 183/183 ✅
  • Style (CI stylechecker image ghcr.io/citusdata/stylechecker:0.8.18-dev-85e972b, uncrustify 0.68.1): ✅

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
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.64%. Comparing base (377c1f2) to head (063b3a9).

Additional details and impacted files
@@               Coverage Diff                @@
##           release-12.1    #8569      +/-   ##
================================================
- Coverage         89.65%   89.64%   -0.02%     
================================================
  Files               276      276              
  Lines             59790    59804      +14     
  Branches           7471     7473       +2     
================================================
+ Hits              53605    53611       +6     
- Misses             4041     4047       +6     
- Partials           2144     2146       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant