Skip to content

Commit

Permalink
RemoteFetcherTierStatemachine logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AnatolyPopov committed Jan 5, 2024
1 parent df946bb commit 815a323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ protected final void handleSegmentWithDeleteSegmentStartedState(RemoteLogSegment
}

private void handleSegmentWithDeleteSegmentFinishedState(RemoteLogSegmentMetadata remoteLogSegmentMetadata) {
log.debug("Removing the entry as it reached the terminal state: [{}]", remoteLogSegmentMetadata);
log.error("Removing the entry as it reached the terminal state: [{}]", remoteLogSegmentMetadata);

doHandleSegmentStateTransitionForLeaderEpochs(remoteLogSegmentMetadata,
(leaderEpoch, remoteLogLeaderEpochState, startOffset, segmentId) ->
Expand All @@ -236,6 +236,8 @@ private void doHandleSegmentStateTransitionForLeaderEpochs(RemoteLogSegmentMetad
Integer leaderEpoch = entry.getKey();
Long startOffset = entry.getValue();
// leaderEpochEntries will be empty when resorting the metadata from snapshot.
log.error("Loading leaderEpochEntries: [{}] while handling state transition for remoteLogSegmentMetadata {} with state {}",
leaderEpochEntries, remoteLogSegmentMetadata, remoteLogSegmentMetadata.state());
RemoteLogLeaderEpochState remoteLogLeaderEpochState = leaderEpochEntries.computeIfAbsent(
leaderEpoch, x -> new RemoteLogLeaderEpochState());
action.accept(leaderEpoch, remoteLogLeaderEpochState, startOffset, remoteLogSegmentId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ public Iterator<RemoteLogSegmentMetadata> listRemoteLogSegments(TopicIdPartition

private FileBasedRemoteLogMetadataCache getRemoteLogMetadataCache(TopicIdPartition topicIdPartition)
throws RemoteResourceNotFoundException {
log.error("Getting RemoteLogMetadataCache for topicIdPartition: {} from {}", topicIdPartition, idToRemoteLogMetadataCache);
FileBasedRemoteLogMetadataCache remoteLogMetadataCache = idToRemoteLogMetadataCache.get(topicIdPartition);
if (remoteLogMetadataCache == null) {
throw new RemoteResourceNotFoundException("No resource found for partition: " + topicIdPartition);
}
log.error("remoteLogMetadataCache.isInitialized(): {}", remoteLogMetadataCache.isInitialized());
log.error("remoteLogMetadataCache: {}", remoteLogMetadataCache);
log.error("remoteLogMetadataCache epoch entries: {}", remoteLogMetadataCache.leaderEpochEntries);
log.error("remoteLogMetadataCache idToSegmentMetadata entries: {}", remoteLogMetadataCache.idToSegmentMetadata);
if (!remoteLogMetadataCache.isInitialized()) {
// Throwing a retriable ReplicaNotAvailableException here for clients retry. We can introduce a new more
// appropriate exception with a KIP in the future.
Expand Down

0 comments on commit 815a323

Please sign in to comment.