This repository was archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
[FEATURE] Reusing the Pulsar message deduplication #1006
Merged
BewareMyPower
merged 11 commits into
streamnative:master
from
Demogorgon314:impl/reuse-pulsar-message-deduplication
Jan 30, 2022
Merged
[FEATURE] Reusing the Pulsar message deduplication #1006
BewareMyPower
merged 11 commits into
streamnative:master
from
Demogorgon314:impl/reuse-pulsar-message-deduplication
Jan 30, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0f2ed27 to
0f847cf
Compare
Collaborator
|
Add the |
Collaborator
BewareMyPower
left a comment
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. I've left some comments, PTAL. I'll review again after comments are addressed.
kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/MessagePublishContext.java
Outdated
Show resolved
Hide resolved
kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/storage/AppendRecordsContext.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/storage/ProducerStateManagerTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/io/streamnative/pulsar/handlers/kop/TransactionTest.java
Outdated
Show resolved
Hide resolved
940b142 to
1310cd7
Compare
kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/storage/ReplicaManager.java
Show resolved
Hide resolved
Demogorgon314
commented
Jan 30, 2022
kafka-impl/src/main/java/io/streamnative/pulsar/handlers/kop/storage/PartitionLog.java
Show resolved
Hide resolved
BewareMyPower
approved these changes
Jan 30, 2022
BewareMyPower
pushed a commit
that referenced
this pull request
Feb 9, 2022
Fixes #957 #1007 ## Motivation Currently, the KoP use Kafka's implantation to check duplicate message, but it is hard to support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`. However, we should reuse the Pulsar message duplication check in KoP by mapping `baseSequence` to `sequenceId` and `lastSequence` to `highestSequenceId`. Pulsar is using producer name to persist sequenced, in KoP we want to follow the Kafka behavior. So we need to use a name role to build a producer name. Because Kafka will reuse PID when the transaction ID is the same but will increase the producer Enoch. So we need to ensure the producer name is not the same. So the producer name role is `PID_PREFIX-{producerId}-{producerEpoch}`. ## Modifications Support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`, and reuse Pulsar message deuplication. (cherry picked from commit 1841b82)
BewareMyPower
pushed a commit
that referenced
this pull request
Feb 9, 2022
Fixes #957 #1007 ## Motivation Currently, the KoP use Kafka's implantation to check duplicate message, but it is hard to support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`. However, we should reuse the Pulsar message duplication check in KoP by mapping `baseSequence` to `sequenceId` and `lastSequence` to `highestSequenceId`. Pulsar is using producer name to persist sequenced, in KoP we want to follow the Kafka behavior. So we need to use a name role to build a producer name. Because Kafka will reuse PID when the transaction ID is the same but will increase the producer Enoch. So we need to ensure the producer name is not the same. So the producer name role is `PID_PREFIX-{producerId}-{producerEpoch}`. ## Modifications Support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`, and reuse Pulsar message deuplication.
BewareMyPower
pushed a commit
that referenced
this pull request
Feb 9, 2022
Fixes #957 #1007 ## Motivation Currently, the KoP use Kafka's implantation to check duplicate message, but it is hard to support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`. However, we should reuse the Pulsar message duplication check in KoP by mapping `baseSequence` to `sequenceId` and `lastSequence` to `highestSequenceId`. Pulsar is using producer name to persist sequenced, in KoP we want to follow the Kafka behavior. So we need to use a name role to build a producer name. Because Kafka will reuse PID when the transaction ID is the same but will increase the producer Enoch. So we need to ensure the producer name is not the same. So the producer name role is `PID_PREFIX-{producerId}-{producerEpoch}`. ## Modifications Support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`, and reuse Pulsar message deuplication. (cherry picked from commit 1841b82)
eolivelli
pushed a commit
to eolivelli/kop
that referenced
this pull request
Feb 24, 2022
Fixes streamnative#957 streamnative#1007 Currently, the KoP use Kafka's implantation to check duplicate message, but it is hard to support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`. However, we should reuse the Pulsar message duplication check in KoP by mapping `baseSequence` to `sequenceId` and `lastSequence` to `highestSequenceId`. Pulsar is using producer name to persist sequenced, in KoP we want to follow the Kafka behavior. So we need to use a name role to build a producer name. Because Kafka will reuse PID when the transaction ID is the same but will increase the producer Enoch. So we need to ensure the producer name is not the same. So the producer name role is `PID_PREFIX-{producerId}-{producerEpoch}`. Support `MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1`, and reuse Pulsar message deuplication. (cherry picked from commit 1841b82)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
cherry-picked/branch-2.8.2
cherry-picked/branch-2.9.2
cherry-picked/branch-2.10.0
doc-required
This pr needs a document
release/2.8.2.x
release/2.9.2
release/2.10.0
type/feature
Indicates new functionality
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #957 #1007
Motivation
Currently, the KoP use Kafka's implantation to check duplicate message, but it is hard to support
MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1.However, we should reuse the Pulsar message duplication check in KoP by mapping
baseSequencetosequenceIdandlastSequencetohighestSequenceId.Pulsar is using producer name to persist sequenced, in KoP we want to follow the Kafka behavior. So we need to use a name role to build a producer name.
Because Kafka will reuse PID when the transaction ID is the same but will increase the producer Enoch. So we need to ensure the producer name is not the same.
So the producer name role is
PID_PREFIX-{producerId}-{producerEpoch}.Modifications
Support
MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION > 1, and reuse Pulsar message deuplication.