-
Notifications
You must be signed in to change notification settings - Fork 14.8k
MINOR: Move ShareAcquireMode to consumer.internal package #20973
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: trunk
Are you sure you want to change the base?
Changes from all commits
60773d2
b48f2a2
0943bb1
cec6ae7
d8df847
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| import kafka.server.share.SharePartitionManager.SharePartitionListener; | ||
|
|
||
| import org.apache.kafka.clients.consumer.AcknowledgeType; | ||
| import org.apache.kafka.clients.consumer.ShareAcquireMode; | ||
| import org.apache.kafka.clients.consumer.internals.ShareAcquireMode; | ||
| import org.apache.kafka.common.KafkaException; | ||
| import org.apache.kafka.common.TopicIdPartition; | ||
| import org.apache.kafka.common.Uuid; | ||
|
|
@@ -1827,13 +1827,13 @@ private List<AcquiredRecords> createBatches( | |
| sharePartitionMetrics); | ||
| int delayMs = recordLockDurationMsOrDefault(groupConfigManager, groupId, defaultRecordLockDurationMs); | ||
| long lastOffset = acquiredRecords.firstOffset() + maxFetchRecords - 1; | ||
| acquiredRecords.setLastOffset(lastOffset); | ||
| inFlightBatch.maybeInitializeOffsetStateUpdate(lastOffset, delayMs); | ||
| updateFindNextFetchOffset(true); | ||
|
|
||
| cachedState.put(acquiredRecords.firstOffset(), inFlightBatch); | ||
| sharePartitionMetrics.recordInFlightBatchMessageCount( | ||
| acquiredRecords.lastOffset() - acquiredRecords.firstOffset() + 1); | ||
| acquiredRecords.setLastOffset(lastOffset); | ||
| return List.of(acquiredRecords); | ||
|
Comment on lines
-1830
to
1837
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not see any tests changes so are we testing the metrics in record limit mode, if we would be then we should have caught the issue earlier?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right — I did overlook the metrics-related test cases in record limit mode. I will add them. Thank you for pointing this out :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Besides this, the current
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, is the difference between them equal to the limit?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As @chirag-wadhwa5 noted in comment #20246 ,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @apoorvmittal10, |
||
| } | ||
| } | ||
|
|
||
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.
Just for my knowledge: Why this change?
Uh oh!
There was an error while loading. Please reload this page.
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.
This originates from the comment at #20246 (comment), and also I find the valid values here from website seem a bit odd:

They appear to come directly from the
Validator's toString() output, so it would be better to make the enum consistent and also fix this.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.
Thanks for letting me know.