clolov commented on code in PR #14787: URL: https://github.com/apache/kafka/pull/14787#discussion_r1399015272
########## core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java: ########## @@ -735,7 +781,7 @@ void testMetricsUpdateOnCopyLogSegmentsFailure() throws Exception { verify(remoteStorageManager, times(1)).copyLogSegmentData(any(RemoteLogSegmentMetadata.class), any(LogSegmentData.class)); // Verify we should not have updated the highest offset because of write failure - verify(mockLog, times(0)).updateHighestOffsetInRemoteStorage(anyLong()); + verify(mockLog, times(1)).updateHighestOffsetInRemoteStorage(anyLong()); Review Comment: ```suggestion verify(mockLog).updateHighestOffsetInRemoteStorage(anyLong()); ``` times(1) is implicit ########## storage/src/main/java/org/apache/kafka/storage/internals/log/EpochAndOffset.java: ########## @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.kafka.storage.internals.log; + +import java.util.Objects; + +public class EpochAndOffset { Review Comment: Can you not use one of `org.apache.kafka.server.common.OffsetAndEpoch` or `org.apache.kafka.raft.OffsetAndEpoch`? Or is this because of trying to minimise package dependencies? ########## core/src/test/java/kafka/log/remote/RemoteLogManagerTest.java: ########## @@ -775,7 +821,7 @@ void testCopyLogSegmentsToRemoteShouldNotCopySegmentForFollower() throws Excepti verify(remoteLogMetadataManager, never()).addRemoteLogSegmentMetadata(any(RemoteLogSegmentMetadata.class)); verify(remoteStorageManager, never()).copyLogSegmentData(any(RemoteLogSegmentMetadata.class), any(LogSegmentData.class)); verify(remoteLogMetadataManager, never()).updateRemoteLogSegmentMetadata(any(RemoteLogSegmentMetadataUpdate.class)); - verify(mockLog, never()).updateHighestOffsetInRemoteStorage(anyLong()); + verify(mockLog, times(1)).updateHighestOffsetInRemoteStorage(anyLong()); Review Comment: ```suggestion verify(mockLog).updateHighestOffsetInRemoteStorage(anyLong()); ``` As 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