guozhangwang commented on a change in pull request #11847:
URL: https://github.com/apache/kafka/pull/11847#discussion_r819825757
##########
File path:
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
##########
@@ -978,24 +979,30 @@ private void resetOffsets(final Set<TopicPartition>
partitions, final Exception
final Set<TopicPartition> notReset = new HashSet<>();
for (final TopicPartition partition : partitions) {
- switch (topologyMetadata.offsetResetStrategy(partition.topic())) {
- case EARLIEST:
- addToResetList(partition, seekToBeginning, "Setting topic
'{}' to consume from {} offset", "earliest", loggedTopics);
- break;
- case LATEST:
- addToResetList(partition, seekToEnd, "Setting topic '{}'
to consume from {} offset", "latest", loggedTopics);
- break;
- case NONE:
- if ("earliest".equals(originalReset)) {
- addToResetList(partition, seekToBeginning, "No custom
setting defined for topic '{}' using original config '{}' for offset reset",
"earliest", loggedTopics);
- } else if ("latest".equals(originalReset)) {
- addToResetList(partition, seekToEnd, "No custom
setting defined for topic '{}' using original config '{}' for offset reset",
"latest", loggedTopics);
- } else {
- notReset.add(partition);
- }
- break;
- default:
- throw new IllegalStateException("Unable to locate topic "
+ partition.topic() + " in the topology");
+ final OffsetResetStrategy offsetResetStrategy =
topologyMetadata.offsetResetStrategy(partition.topic());
+
+ // This may be null if the task we are currently processing was
apart of a named topology that was just emoved.
+ // TODO: keep the StreamThreads and TopologyMetadtaa view of named
topologies in sync until final thread has acked
Review comment:
Could we create a separate JIRA ticket for bookkeeping?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]