You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "qianye1001 (via GitHub)" <gi...@apache.org> on 2026/05/29 06:00:48 UTC

[PR] Fix: Prevent %RETRY% topic creation on brokers not hosting subscribed topics [rocketmq]

qianye1001 opened a new pull request, #10406:
URL: https://github.com/apache/rocketmq/pull/10406

   ## Summary
   
   Fix for [#10405](https://github.com/apache/rocketmq/issues/10405): When orderly consumer consume message fails and reaches `maxReconsumeTimes`, the `%RETRY%` topic is unconditionally created on all brokers, including those that don't host the original topic.
   
   ## Root Cause
   
   Two code paths create `%RETRY%` topic without checking if the broker actually hosts any of the consumer's subscribed topics:
   
   1. **`ClientManageProcessor.java`** (heartbeat path) — `registerConsumer()` unconditionally creates `%RETRY%<group>` for every consumer heartbeat
   2. **`AbstractSendMessageProcessor.java`** (msgCheck fallback) — Creates retry topic without broker-topic validation
   
   ## Fix
   
   Added guard conditions in both paths:
   
   1. **ClientManageProcessor** — Before creating `%RETRY%` topic, iterate through the consumer's subscription set and verify at least one subscribed topic (excluding `%RETRY%`/`%DLQ%` system topics) exists on this broker via `containsTopic()`. Only create `%RETRY%` if the check passes.
   
   2. **AbstractSendMessageProcessor** — In the `msgCheck` fallback path, extract the consumer group from the retry topic name and perform the same validation before creating the topic.
   
   ## Impact
   
   - Reduces unnecessary topic metadata bloat across brokers
   - Prevents confusing `%RETRY%` routes on brokers that have no relevant data
   - No behavioral change for brokers that DO host subscribed topics
   - Backward compatible — existing retry flow continues to work normally
   
   Closes #10405


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Prevent %RETRY% topic creation on brokers not hosting subscribed topics [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #10406:
URL: https://github.com/apache/rocketmq/pull/10406#issuecomment-4571533083

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/10406?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `8.00000%` with `46 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 47.92%. Comparing base ([`9443c6d`](https://app.codecov.io/gh/apache/rocketmq/commit/9443c6d9db8e681613d6b7da61f8f70be3ca7187?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1be5b09`](https://app.codecov.io/gh/apache/rocketmq/commit/1be5b090a53354b1e36f95ebe3aab75e4a222176?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on develop.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/rocketmq/pull/10406?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...cketmq/broker/processor/ClientManageProcessor.java](https://app.codecov.io/gh/apache/rocketmq/pull/10406?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fprocessor%2FClientManageProcessor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL0NsaWVudE1hbmFnZVByb2Nlc3Nvci5qYXZh) | 12.50% | [24 Missing and 4 partials :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/10406?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...broker/processor/AbstractSendMessageProcessor.java](https://app.codecov.io/gh/apache/rocketmq/pull/10406?src=pr&el=tree&filepath=broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fbroker%2Fprocessor%2FAbstractSendMessageProcessor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL0Fic3RyYWN0U2VuZE1lc3NhZ2VQcm9jZXNzb3IuamF2YQ==) | 0.00% | [18 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/10406?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop   #10406      +/-   ##
   =============================================
   - Coverage      48.00%   47.92%   -0.09%     
   + Complexity     13278    13253      -25     
   =============================================
     Files           1376     1376              
     Lines         100536   100573      +37     
     Branches       12983    12999      +16     
   =============================================
   - Hits           48263    48196      -67     
   - Misses         46349    46438      +89     
   - Partials        5924     5939      +15     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq/pull/10406?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Prevent %RETRY% topic creation on brokers not hosting subscribed topics [rocketmq]

Posted by "qianye1001 (via GitHub)" <gi...@apache.org>.
qianye1001 commented on PR #10406:
URL: https://github.com/apache/rocketmq/pull/10406#issuecomment-4571348396

   ## ⚠️ Note: Awaiting Community Confirmation
   
   This PR was submitted prematurely due to a bug in our automation that incorrectly detected self-approval. We have fixed the automation and are now **waiting for genuine community review and confirmation**.
   
   The code quality has been reviewed internally (approved by our automated reviewer with minor suggestions), but we want community input before proceeding.
   
   Please feel free to review and provide feedback here or on the original issue #10405. Once the community confirms with `/approve`, this PR will proceed normally.
   
   *This note was generated by the RocketMQ Issue Bot.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: Prevent %RETRY% topic creation on brokers not hosting subscribed topics [rocketmq]

Posted by "qianye1001 (via GitHub)" <gi...@apache.org>.
qianye1001 closed pull request #10406: Fix: Prevent %RETRY% topic creation on brokers not hosting subscribed topics
URL: https://github.com/apache/rocketmq/pull/10406


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org