-
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
[C++] add chunk message id #14604
[C++] add chunk message id #14604
Conversation
@A-Wanderer:Thanks for your contribution. For this PR, do we need to update docs? |
Please complete the PR description. See more details in https://github.com/apache/pulsar/blob/master/CONTRIBUTING.md. |
In addition, please format your code via |
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.
I left some comments first, PTAL.
c15b225
to
d119050
Compare
@A-Wanderer:Thanks for providing doc info! |
Co-authored-by: ran <gaoran_10@126.com>
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.
I've left some comments. Please address them first.
Enhance the readability of judgment Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Delete redundant Co-authored-by: Yunze Xu <xyzinfernity@163.com>
const construction parameters Co-authored-by: Yunze Xu <xyzinfernity@163.com>
… into ready_chunk_message_id
I will check the compile failure on Windows x64 soon. But your code doesn't pass the format check as well, please format the code via |
Precise description Co-authored-by: Yunze Xu <xyzinfernity@163.com>
4cf8463
to
d0b3a39
Compare
const func Co-authored-by: Yunze Xu <xyzinfernity@163.com>
Fixes #12402
Master Issue: #12402
Motivation
This is a feature which follow-up to the C++ Client,master issue is #12402.
Currently, when we send chunked messages, the producer returns the message-id of the last chunk. This can cause some problems. For example, when we use this message-id to seek, it will cause the consumer to consume from the position of the last chunk, and the consumer will mistakenly think that the previous chunks are lost and choose to skip the current message. If we use the inclusive seek, the consumer may skip the first message, which brings the wrong behavior.
API Changes and Implementation
In cosumer.seek, use the first chunk message-id param of the chunk message-id. This will solve the problem caused by seeking chunk messages.
Add ProducerChunkedMessageCtx to stroing relevant chunk message id in Produceimpl,it mainly contains two public param: firstChunkMessageIdImplPtr_ and lastChunkMessageIdImplPtr_ to save information of chunk message id.
Add some test about Seek and Chunk Message Id Impl.
Here is the PR to demonstrate this PIP: #12403.