[Enhancement] Improve Lite subscription quota validation for remove actions
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- distributed-systems
Research direction
Start at ClientProcessor#syncLiteSubscription and trace how liteTopicSet, liteSubClientQuota, quotaBuffer, and the four subscription actions are handled. Done means quota validation remains for PARTIAL_ADD and COMPLETE_ADD, is skipped for PARTIAL_REMOVE and COMPLETE_REMOVE, and the relevant behavior is covered by the repository's existing tests.
Written by the indexing model from the issue text.
Description
Before Creating the Enhancement Request
- I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
Improve Lite subscription quota validation in proxy by applying the quota check only to Lite subscription add actions.
Currently, proxy validates liteTopicSet.size() against liteSubClientQuota + quotaBuffer before syncing Lite subscriptions. This validation should apply to PARTIAL_ADD and COMPLETE_ADD, but not to remove actions.
Motivation
Lite subscription quota is used to limit subscription growth. Remove actions release existing subscriptions and should not be blocked by the same quota validation.
For example, a client may add Lite subscriptions in several smaller PARTIAL_ADD requests and later remove them in one larger PARTIAL_REMOVE request. The remove request can contain more Lite topics than the quota threshold, but it only reduces the active subscription set.
Describe the Solution You'd Like
Update ClientProcessor#syncLiteSubscription so that Lite subscription quota validation is only applied to add actions:
PARTIAL_ADDCOMPLETE_ADD
Skip this quota validation for remove actions:
PARTIAL_REMOVECOMPLETE_REMOVE
This keeps the quota protection for subscription growth while allowing large unsubscribe requests to release resources normally.
Describe Alternatives You've Considered
One alternative is to keep validating all actions with non-empty liteTopicSet, but this treats remove requests as if they were adding subscriptions.
Another alternative is to introduce a separate request-size limit for Lite subscription sync requests. That may be useful independently, but it should not reuse LITE_SUBSCRIPTION_QUOTA_EXCEEDED, because subscription quota and request size are different concepts.
Additional Context
No response
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
[Bug] TopicValidator rejects V2 retry topic names containing `+` separator introduced by KeyBuilder Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100