kamalcph commented on code in PR #14329:
URL: https://github.com/apache/kafka/pull/14329#discussion_r1315512346


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -379,9 +379,9 @@ public void stopPartitions(Set<TopicPartition> 
topicPartitions,
                 LOGGER.error("Error while stopping the partition: {}, delete: 
{}", tpId.topicPartition(), delete, ex);
             }
         });
-        remoteLogMetadataManager.onStopPartitions(topicIdPartitions);
         if (delete) {
             // NOTE: this#stopPartitions method is called when Replica state 
changes to Offline and ReplicaDeletionStarted
+            remoteLogMetadataManager.onStopPartitions(topicIdPartitions);

Review Comment:
   Addressed your review comments. Please take another look. 
   
   As per the Javadoc in 
[RemoteLogMetadataManager#onStopPartitions](https://github.com/apache/kafka/blob/trunk/storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogMetadataManager.java#L203),
 this method will be called when replica emigrates to a new broker and during 
topic deletion.
   
   > /**
        * This method is invoked only when the topic partitions are stopped on 
this broker. This can happen when a
        * partition is emigrated to other broker or a partition is deleted.
        *
        * @param partitions topic partitions that have been stopped.
        */
        void onStopPartitions(Set<TopicIdPartition> partitions);



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to