showuon commented on code in PR #16653:
URL: https://github.com/apache/kafka/pull/16653#discussion_r1699631266
##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -507,17 +525,25 @@ public void stopPartitions(Set<StopPartition>
stopPartitions,
LOGGER.error("Error while stopping the partition: {}",
stopPartition, ex);
}
}
- // Note `deleteLocalLog` will always be true when `deleteRemoteLog` is
true but not the other way around.
Set<TopicIdPartition> deleteLocalPartitions = stopPartitions.stream()
.filter(sp -> sp.deleteLocalLog() &&
topicIdByPartitionMap.containsKey(sp.topicPartition()))
.map(sp -> new
TopicIdPartition(topicIdByPartitionMap.get(sp.topicPartition()),
sp.topicPartition()))
.collect(Collectors.toSet());
+
if (!deleteLocalPartitions.isEmpty()) {
- // NOTE: In ZK mode, this#stopPartitions method is called when
Replica state changes to Offline and
- // ReplicaDeletionStarted
- remoteLogMetadataManager.onStopPartitions(deleteLocalPartitions);
deleteLocalPartitions.forEach(tpId ->
topicIdByPartitionMap.remove(tpId.topicPartition()));
}
+
+ // NOTE: In ZK mode, this#stopPartitions method is called when Replica
state changes to Offline and
+ // ReplicaDeletionStarted
+ Set<TopicIdPartition> stopRLMMPartitions = stopPartitions.stream()
Review Comment:
Check and think again. You are totally right! Thanks for the explanation!
Updated.
--
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]