Repository navigation
[improve][broker] Allow disabling scalable topics when upgrading to 5.x - #26740
Merged
lhotari merged 2 commits intoSep 29, 2026
Merged
Conversation
Gate scalable-topic resources, services, admin endpoints, lookups, loads, and protocol handlers. Fail V5 client capability checks before sending unsupported requests and verify disable/re-enable data retention. Assisted-by: Codex
Restore the existing DAG lookup path in this change. Keep disabled-broker coverage by asserting the lookup rejection returned to V5 producers and consumers. Preserve the independent discovery change on lh-check-scalable-topic-capability-before-lookup. Assisted-by: Codex
lhotari
requested review from
Technoboy-,
dao-jun,
david-streamlio,
merlimat and
nodece
September 29, 2026 00:47
merlimat
approved these changes
Sep 29, 2026
dao-jun
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PIP: 460
Motivation
Brokers already provide
enablePersistentTopicsandenableNonPersistentTopicsto control which topic types they support. Operators should also be able to disable scalable topics, introduced by PIP-460.Existing deployments should be able to upgrade to Pulsar 5.x for its performance and reliability improvements while continuing to run their existing workloads. Adopting scalable topics, the V5 client API, or Oxia is a separate decision. Workloads using the existing 4.0.x feature set retain a supported downgrade path from 5.0.x to 4.0.x.
Setting
scalableTopicsEnabled=falsebefore upgrading prevents applications from creating or using scalable topics that 4.x cannot serve. Operators can validate the upgrade with their existing topics, subscriptions, and client API, then enable scalable topics when they are ready to use them. The default remainstrue.The setting
scalableTopicsEnabledwas already added earlier to control capability advertisement and some protocol handlers, but scalable-topic resources and controllers still start when it is disabled, the admin API remains available, and existing segment topics can still load. This change makes those paths respect the setting as well. Disabling the feature retains existing scalable-topic data so it can be accessed again after re-enabling it.Modifications
scalableTopicsEnabled=falsewhen initializing broker services. Do not instantiateScalableTopicResources, startScalableTopicService, or start the V5 transaction coordinator. Do not register the/admin/v2/scalableREST resource.scalableTopicsEnabled=false. Advertise the existing scalable-topic and V5 transaction-discovery capability flags as disabled.topic://andsegment://topics, including topics created before the feature was disabled.true; changing it requires a broker restart. Existing scalable-topic data is retained, and ordinary topics remain available through the classic client API.Verifying this change
./gradlew quickCheckpassed.ScalableTopicBinaryAuthZTest: capability advertisement and rejection of raw protocol requests, lookups, and producer/consumer attachment when disabled.V5TransactionRecoveryTest: enabled transaction recovery, plus a disable/re-enable restart test covering absent resources/services, unavailable admin endpoints, rejected lookups and loads, V5 client errors, ordinary-topic availability, and recovery of previously written scalable-topic data.ClientCnxTest.testScalableTopicSupportRequiresExplicitFeatureFlagandWatchTcAssignmentsDiscoveryTest: missing/disabled capability flags and fail-fast transaction discovery.Does this pull request potentially affect one of the following parts:
scalableTopicsEnabled=falsebefore a 4.x-to-5.x migration; changing the setting requires a broker restart.