[Bug] Enforce Lite subscription quota for complete and batch updates
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
Description
## Version
Reproduced on develop at `e3458616d`.
## Problem
`LiteSubscriptionRegistryImpl.addPartialSubscription` checks only the current active count before it processes the request. A request that adds multiple active Lite subscriptions can therefore exceed `maxLiteSubscriptionCount`. `addCompleteSubscription` does not check the limit at all. Conversely, an idempotent retry for an already active subscription is rejected once the quota is full.
## Reproduction
1. Configure `maxLiteSubscriptionCount` as `1`.
2. Submit a partial subscription update with two active Lite topics, or submit a complete update containing two active Lite topics.
3. Observe that the registry accepts both entries and the active count becomes `2`.
4. Add one active subscription, then retry the same partial update. Observe that the retry throws `LiteQuotaException`.
## Expected
Both update paths should enforce the limit against the net number of newly active references. Existing references must remain idempotent, and rejected updates must not partially mutate the registry.
## Regression coverage
`LiteSubscriptionRegistryImplTest` contains focused failing tests for batch overflow, complete-update overflow, and idempotent retries at the limit.
Contributor guide
Research direction
Start with LiteSubscriptionRegistryImpl.addPartialSubscription and addCompleteSubscription, then run the focused failing tests in LiteSubscriptionRegistryImplTest. Done means batch and complete updates enforce maxLiteSubscriptionCount against net newly active references, retries of existing references remain idempotent, and rejected updates do not partially mutate the registry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100