Skip to content

[ISSUE #11510] Add independent Fast Remoting and HA service switches - #11511

Open
qianye1001 wants to merge 3 commits into
apache:developfrom
qianye1001:codex/broker-listener-switches
Open

qianye1001 wants to merge 3 commits into
apache:developfrom
qianye1001:codex/broker-listener-switches

Conversation

@qianye1001

@qianye1001 qianye1001 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

Standalone deployments currently cannot disable the Fast Remoting server or the HA service independently. Add two startup options to BrokerConfig, both defaulting to true to preserve existing behavior:

  • enableFastRemotingServer=false: do not create the Fast server (listenPort - 2), and skip its processor registrations. Covers ordinary brokers and per-broker sub-servers in BrokerContainer.
  • enableHAService=false: do not create or initialize an HA service. This stops the entire service: the HA listener, outbound replication client, GroupTransferService and HAConnectionStateNotificationService are not started. The store lifecycle safely handles an absent HA service.

Disabling HA requires ASYNC_MASTER without controller or slave-acting-master mode. Incompatible configurations fail at the beginning of the store constructor before storage resources are initialized, instead of running replication-dependent modes without an HA service. Existing duplication and DLedger semantics are unchanged; this option does not disable alternative replication implementations.

Both options require a broker restart. Clients must use the main endpoint when Fast Remoting is disabled. BrokerContainer's own management listeners are unchanged. No reflection or changes to replication-mode flags are used.

How Did You Test This Change?

  • Linux JDK 8 reactor package, Checkstyle and SpotBugs passed.
  • Existing regression tests passed: BrokerControllerTest#testBrokerRestart, testCustomRemotingServer, testBrokerMetricsManagerInitialization; HATest#testHandleHA, testSemiSyncReplica (5 tests, no failures/errors).
  • External real-socket harness: all four flag combinations for ordinary Broker and BrokerContainer (8 scenarios), including 100 native Remoting sends/pulls per scenario, Fast sends when enabled, listener/service/thread state, and shutdown. HA-disabled scenarios additionally check absent HA threads, HA status/address-update handling, and persisted-message recovery after restart.
  • External HA harness: 100 synchronously acknowledged messages replicated with HA enabled, enabled AutoSwitch compatibility, rejection of incompatible HA-disabled modes, and successful startup with the disabled HA port already occupied.

The external verification harnesses are not included in this PR.

CI follow-up

The first Bazel run built successfully and passed 608 of 609 test targets. TlsTest#disabledServerRejectsSSLClient failed because the TLS-disabled server closed the channel before the client checked its active state, producing RemotingConnectException rather than RemotingSendRequestException. The test and production Remoting implementation were identical to the base branch.

Update that existing test to accept both rejection timings; a successful request still fails the assertion. No production behavior changes are included in this follow-up. The complete 13-test TLS suite passes on Linux JDK 8, along with Checkstyle and SpotBugs. The affected rejection test also passes 30 consecutive runs on Linux JDK 8. A fresh PR CI run has been triggered and is waiting for a runner.

lizhimins
lizhimins previously approved these changes Nov 12, 2026
@qianye1001 qianye1001 changed the title [ISSUE #11510] Add independent Fast Remoting and HA listener switches [ISSUE #11510] Add independent Fast Remoting and HA service switches Nov 12, 2026
@codecov-commenter

codecov-commenter commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.97101% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.76%. Comparing base (164322b) to head (7b34245).

Files with missing lines Patch % Lines
...a/org/apache/rocketmq/broker/BrokerController.java 71.42% 0 Missing and 14 partials ⚠️
.../java/org/apache/rocketmq/common/BrokerConfig.java 25.00% 6 Missing ⚠️
...org/apache/rocketmq/store/DefaultMessageStore.java 14.28% 4 Missing and 2 partials ⚠️
...ache/rocketmq/container/InnerBrokerController.java 40.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #11511      +/-   ##
=============================================
- Coverage      49.79%   49.76%   -0.03%     
+ Complexity     14407    14403       -4     
=============================================
  Files           1391     1391              
  Lines         103381   103408      +27     
  Branches       13529    13548      +19     
=============================================
- Hits           51477    51465      -12     
- Misses         45686    45706      +20     
- Partials        6218     6237      +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

[Feature] Add independent BrokerConfig switches for Fast Remoting and HA service

3 participants