divijvaidya commented on code in PR #14425:
URL: https://github.com/apache/kafka/pull/14425#discussion_r1336965148


##########
core/src/main/java/kafka/log/remote/RemoteLogManager.java:
##########
@@ -697,12 +711,22 @@ public void copyLogSegmentsToRemote(UnifiedLog log) 
throws InterruptedException
                 this.cancel();
             } catch (InterruptedException | RetriableException ex) {
                 throw ex;
+            } catch (CorruptIndexException ex) {
+                logger.error("Error occurred while copying log segments. Index 
appeared to be corrupted for partition: {} ", topicIdPartition, ex);
+                segmentCopyFailures++;
             } catch (Exception ex) {
                 if (!isCancelled()) {
                     
brokerTopicStats.topicStats(log.topicPartition().topic()).failedRemoteCopyRequestRate().mark();
                     
brokerTopicStats.allTopicsStats().failedRemoteCopyRequestRate().mark();
                     logger.error("Error occurred while copying log segments of 
partition: {}", topicIdPartition, ex);
                 }
+            } finally {
+                
metricsGroup.newGauge(FAILED_REMOTE_COPY_PER_SEC_METRIC.getName(), new 
Gauge<Integer>() {

Review Comment:
   This metric is already update in the above catch clause as 
`brokerTopicStats.allTopicsStats().failedRemoteCopyRequestRate().mark();`. 
   
   Can we add 
`brokerTopicStats.allTopicsStats().failedRemoteCopyRequestRate().mark();` and 
`brokerTopicStats.topicStats(log.topicPartition().topic()).failedRemoteCopyRequestRate().mark();`
 to our corrupted index exception as well? (instead of create a new gauge 
here). We probably want to do it after our attempt to recreate index fails as 
mentioned above.



-- 
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