-
Notifications
You must be signed in to change notification settings - Fork 108
[server][dvc] Preserve PCS during non-Helix UNSUBSCRIBE to maintain quota accuracy #2299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a quota tracking issue by preserving PartitionConsumptionState (PCS) entries during non-Helix UNSUBSCRIBE operations. Previously, PCS was removed for all unsubscribe triggers, causing the quota computation to lose visibility into partitions that were unsubscribed due to errors or after end-of-push for batch stores.
- Moved
partitionConsumptionStateMap.remove(partition)inside the Helix-triggered action conditional - PCS now only removed for Helix-initiated unsubscribe, ensuring storage utilization tracking and quota enforcement remain accurate
- Aligns with existing pattern for
failedPartitionsandstorageUtilizationManagercleanup
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ts/da-vinci-client/src/main/java/com/linkedin/davinci/kafka/consumer/StoreIngestionTask.java
Outdated
Show resolved
Hide resolved
1649b4a to
46a6ba2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ts/da-vinci-client/src/main/java/com/linkedin/davinci/kafka/consumer/StoreIngestionTask.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ts/da-vinci-client/src/main/java/com/linkedin/davinci/kafka/consumer/StoreIngestionTask.java
Show resolved
Hide resolved
...ts/da-vinci-client/src/main/java/com/linkedin/davinci/kafka/consumer/StoreIngestionTask.java
Show resolved
Hide resolved
2dee2a7 to
a4ff362
Compare
…on-Helix triggered actions Remove PCS if it's dvc client Fix flaky test Fix another flaky test Address review comments Delete test that's already covered in other tests Redistributed tests
a4ff362 to
c619d31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| LOGGER.info( | ||
| "Removing tracking of replica: {} from storage utilization manager as this UNSUBSCRIBE is helix triggered action", | ||
| topicPartition); | ||
| "Removing replica: {} from PCS map and storage utilization manager. Trigger: {}", | ||
| topicPartition, | ||
| isDaVinciClient() ? "DaVinci client unsubscribe" : "Helix-triggered unsubscribe"); |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message has a logical inconsistency. When isDaVinciClient() returns true, the ternary operator will always select "DaVinci client unsubscribe", even if the action is also Helix-triggered. This could be misleading in cases where a DaVinci client uses Helix-triggered unsubscribe.
Consider restructuring the log message to accurately reflect both conditions:
String trigger = isDaVinciClient()
? (consumerAction.isHelixTriggeredAction() ? "DaVinci client (Helix-triggered)" : "DaVinci client")
: "Helix-triggered unsubscribe";
LOGGER.info(
"Removing replica: {} from PCS map and storage utilization manager. Trigger: {}",
topicPartition,
trigger);
[server][dvc] Preserve PCS during non-Helix UNSUBSCRIBE to maintain quota accuracy
Keep PartitionConsumptionState entries in partitionConsumptionStateMap
for non-Helix UNSUBSCRIBE actions. Previously PCS was removed for all
UNSUBSCRIBE triggers, causing quota computation to lose visibility into
partitions unsubscribed due to errors or after end-of-push for batch stores.
PCS is now removed only for Helix-initiated or for DVC UNSUBSCRIBE, to
ensure storage utilization tracking and quota enforcement remain accurate.
Code changes
Concurrency-Specific Checks
Both reviewer and PR author to verify
synchronized,RWLock) are used where needed.ConcurrentHashMap,CopyOnWriteArrayList).How was this PR tested?
Does this PR introduce any user-facing or breaking changes?