-
Couldn't load subscription status.
- Fork 14.7k
KAFKA-19340: Move DelayedRemoteFetch to the storage module #19876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@frankvicky @apoorvmittal10 PTAL when you get a chance, thanks in advance. |
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
# Conflicts: # core/src/test/scala/unit/kafka/coordinator/AbstractCoordinatorConcurrencyTest.scala
|
I compared the performance of this patch with the current version in catch-up read scenarios with tiered storage enabled.
This patch(with trunk code)
Current 4.0.0 release
Summary:
|
Thanks for the PR, I am a bot occupied with queues as of now. It's on my list to review, will take some time. |
# Conflicts: # core/src/main/scala/kafka/server/DelayedRemoteFetch.scala # core/src/main/scala/kafka/server/ReplicaManager.scala # core/src/test/scala/integration/kafka/server/DelayedRemoteFetchTest.scala
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Show resolved
Hide resolved
@DL1231 please fix the build error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I made a first quick pass and left a few minor suggestions.
server/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/kafka/server/FetchPartitionStatus.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/apache/kafka/server/purgatory/DelayedRemoteFetchTest.java
Outdated
Show resolved
Hide resolved
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Show resolved
Hide resolved
|
@DL1231 would you mind fixing the conflicts? I will take a look asap |
# Conflicts: # core/src/main/scala/kafka/server/DelayedRemoteFetch.scala
# Conflicts: # core/src/main/scala/kafka/server/ReplicaManager.scala # core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. I left a few comments.
storage/src/main/java/org/apache/kafka/storage/internals/log/FetchPartitionStatus.java
Outdated
Show resolved
Hide resolved
storage/src/test/java/org/apache/kafka/server/purgatory/DelayedRemoteFetchTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like some of the constructors are not used anymore, so they can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DL1231 thanks for this patch. it is great overall, and I have just left a few comments
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Outdated
Show resolved
Hide resolved
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Outdated
Show resolved
Hide resolved
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Outdated
Show resolved
Hide resolved
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Outdated
Show resolved
Hide resolved
storage/src/main/java/org/apache/kafka/storage/internals/log/FetchPartitionStatus.java
Outdated
Show resolved
Hide resolved
storage/src/main/java/org/apache/kafka/storage/internals/log/LogReadResult.java
Outdated
Show resolved
Hide resolved
|
I'll review this PR by tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, left few comments to address. PTAL.
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Outdated
Show resolved
Hide resolved
| */ | ||
| @Override | ||
| public void onComplete() { | ||
| Map<TopicIdPartition, FetchPartitionData> fetchPartitionData = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we retain the response order similar to request order?
storage/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java
Outdated
Show resolved
Hide resolved
# Conflicts: # core/src/main/scala/kafka/server/DelayedRemoteFetch.scala
| remoteFetchMaxWaitMs, | ||
| fetchPartitionStatus.toMap.asJava, | ||
| params, | ||
| logReadResults.toMap.asJava, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also maintain the order of elements in logReadResults?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and I left a follow-up comment
| remoteFetchResults, | ||
| remoteFetchInfos, | ||
| remoteFetchMaxWaitMs, | ||
| fetchPartitionStatus.toMap.asJava, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could initialize fetchPartitionStatus as a Map type to reduce unnecessary collection conversions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #20769 to address this comment. PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't saw #20768 was also opened. We can merge either one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the FIFO policy and review #20768 together
| remoteFetch.topicIdPartition(), | ||
| partitionsAcquired.get(remoteFetch.topicIdPartition()), | ||
| ReplicaManager.createLogReadResult(error).toFetchPartitionData(false) | ||
| new LogReadResult(Errors.forException(remoteLogReadResult.error().get())).toFetchPartitionData(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we check that we didn't lose a useful error message by doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out. I checked the usage of LogReadResult and only found calls to LogReadResult.error(), so in the previous implementation, no code would utilize the error message from the Exception.
If anything is inappropriate, please feel free to correct me.
Move DelayedRemoteFetch to the storage module and rewrite it to java. Reviewers: Mickael Maison <[email protected]>, Kamal Chandraprakash <[email protected]>, Chia-Ping Tsai <[email protected]>
Move DelayedRemoteFetch to the storage module and rewrite it to java.
Reviewers: Mickael Maison [email protected], Kamal
Chandraprakash [email protected], Chia-Ping Tsai
[email protected]