Skip to content

cluster_link: gate shadow-link role sync behind a feature flag#30976

Open
nguyen-andrew wants to merge 5 commits into
redpanda-data:devfrom
nguyen-andrew:sl-roles-sync-feature-flag
Open

cluster_link: gate shadow-link role sync behind a feature flag#30976
nguyen-andrew wants to merge 5 commits into
redpanda-data:devfrom
nguyen-andrew:sl-roles-sync-feature-flag

Conversation

@nguyen-andrew

@nguyen-andrew nguyen-andrew commented Jun 30, 2026

Copy link
Copy Markdown
Member

Adds a shadow_link_role_sync feature flag and gates shadow-link role
sync behind it, so the per-link role_sync_cfg and the
DescribeRedpandaRoles Kafka API stay inert until the cluster is fully
upgraded.

  • features: new flag at release_version::v26_2_1,
    available_policy::always / prepare_policy::always.
  • redpanda/admin/shadow_link: check_role_sync_supported() on
    create/update rejects non-empty role_name_filters until the flag is
    active; empty filters stay inert.
  • kafka: the DescribeRedpandaRoles handler returns
    unsupported_version, and the reserved API is filtered out of the
    ApiVersions response, until the flag is active.
  • ducktape coverage for config rejection on a not-fully-upgraded cluster
    and for gating across finalization.

Fixes CORE-16767

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v26.1.x
  • v25.3.x
  • v25.2.x

Release Notes

  • none

Gates the role-sync mode for shadow links so its replicated config is
only written once every node supports it.

Temporarily acknowledge the flag in PERTURB_ACKNOWLEDGED_FEATURES to
satisfy the unfinalized-upgrade coverage guard. A follow-up commit will
add an unfinalized upgrade test that exercises the feature instead.
ManualFinalizationUpgradeTest acknowledged shadow_link_role_sync as
out of scope; promote it to an exercised feature so the upgrade gate
is actually covered. Before finalize, assert DescribeRedpandaRoles is
absent from ApiVersions and a validate-only role-sync config is
refused with FAILED_PRECONDITION via the feature gate. After finalize,
assert the feature auto-activates, the Kafka API is advertised, and
the config gate no longer rejects.
Copilot AI review requested due to automatic review settings June 30, 2026 22:56
@nguyen-andrew nguyen-andrew self-assigned this Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new cluster feature flag, shadow_link_role_sync, to keep shadow-link role sync configuration and the DescribeRedpandaRoles Kafka API inert until the cluster is fully upgraded (feature becomes active).

Changes:

  • Adds shadow_link_role_sync to the feature table (schema + string mapping) at release_version::v26_2_1.
  • Gates shadow-link role sync configuration on create/update in the admin shadow-link service unless the feature is active.
  • Gates DescribeRedpandaRoles by (a) removing it from ApiVersions until active and (b) returning unsupported_version from the handler until active, with unit + ducktape coverage.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/rptest/tests/cluster_linking_e2e_test.py Adds an e2e test asserting role-sync config is rejected when the feature is inactive.
tests/rptest/tests/cluster_features_test.py Extends unfinalized-upgrade perturbation coverage to exercise role-sync gating and post-finalize behavior.
src/v/redpanda/admin/services/shadow_link/shadow_link.cc Adds server-side validation gate for role sync config based on feature activation.
src/v/kafka/server/tests/BUILD Updates test build deps for new feature-table and protocol usage in tests.
src/v/kafka/server/tests/api_versions_test.cc Adds a unit test ensuring the reserved API is removed from ApiVersions when gated.
src/v/kafka/server/handlers/describe_redpanda_roles.cc Returns unsupported_version (with message) until shadow_link_role_sync is active.
src/v/kafka/server/handlers/api_versions.h Exposes helper to remove reserved APIs based on feature state.
src/v/kafka/server/handlers/api_versions.cc Implements reserved-API filtering for DescribeRedpandaRoles behind the feature flag.
src/v/features/tests/feature_table_test.cc Adds string mapping test coverage for the new feature name.
src/v/features/feature_table.h Adds the new feature bit and registers the feature spec in feature_schema.
src/v/features/feature_table.cc Adds to_string_view mapping for shadow_link_role_sync.

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

CI test results

test results on build#86559
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) ShadowLinkingReplicationTests test_auto_prefix_trimming {"source_cluster_spec": {"cluster_type": "redpanda"}, "storage_mode": "tiered", "with_failures": false} integration https://buildkite.com/redpanda/redpanda/builds/86559#019f1ad9-38c7-4811-8f91-6979731125a0 28/31 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0391, p0=0.3285, reject_threshold=0.0100. adj_baseline=0.1127, p1=0.3274, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=ShadowLinkingReplicationTests&test_method=test_auto_prefix_trimming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants