-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][pip] Change cursor`s properties to store chunk ID map. #21027
Conversation
@liangyepianzhou Please add the following content to your PR description and select a checkbox:
|
```java | ||
// Recover properties map | ||
Map<String, String> recoveredProperties; | ||
if (info.getPropertiesCount() == 0 && info.getmarkDeletePropertiesCount() == 0) { |
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.
The info
means ManagedCursorInfo
, right?
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's true.
# Goals | ||
|
||
## In Scope | ||
Chunk messages can be effectively filtered on the broker side. Ensure that chunk messages work normally after enabling deduplication and the topic has no duplicate chunks. |
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.
Background:*: There are two properties in the metadata of the cursor
properties<String, Long>
: used to maintain the last sequence of producer-sent messages[1].cursorProperties<String, String>
: used to maintain the subscription properties.- PIP: PIP 105: Support pluggable entry filter in Dispatcher #12269
- PR: PIP-105 Per-subscription properties are not persistent to MetadataStore #15750
[1]: a structure of properties
:
properties:
- "producer_name_1" : {{last_persist_sequence_1}}
- "producer_name_2" : {{last_persist_sequence_2}}
In this PIP, you want to change properties<String, Long>
to properties<String, String>
, right? Could you also explain this change here?
.build(); | ||
``` | ||
|
||
Optimize the `properties` of the `MarkDeleteEntry` from `Map<String, Long>` to `Map<String, String>`. In the depublication design, the ' MarkDeleteEntry' properties are used as a snapshot to store the sequence ID map. After introducing the chunk ID map, it cannot hold two long for each producer. So we hope to change the `MarkDeleteEntry' properties from `Map<String, Long>` to `Map<String, String>` to make it more flexible. |
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.
Could you add a demo to describe the structure of the attribute properties
of cursor metadata that you wanted after this PIP?
Motivation
Chunk messages can be effectively filtered on the broker side. Ensure that chunk messages work normally after enabling deduplication and the topic has no duplicate chunks.
Modifications
chunkIDPushed
andchunkIDPersisted
to store the chunk of each producer`s ongoing chunk messages. It will be used to check whether the chunks in a single message are duplicated.properties
of theMarkDeleteEntry
fromMap<String, Long>
toMap<String, String>
.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: