Skip to content
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

[Issue 11814] fix pulsar admin method:getMessageById. #11852

Merged
merged 3 commits into from
Sep 2, 2021

Conversation

zhanghaou
Copy link
Contributor

Fix #11814 , if we use another topic to find the message, it will return the message, but we may contaminate the ledgers cache in the topic.

changes
Add check in the method 'internalGetMessageById' in PersistentTopicsBase, if the ledgerId not belong to this topic, throw a exception.

@zhanghaou
Copy link
Contributor Author

/pulsarbot run-failure-checks

@Anonymitaet
Copy link
Member

Thanks for your contribution. For this PR, do we need to update docs?

(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

Copy link
Contributor

@gaoran10 gaoran10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhanghaou
Copy link
Contributor Author

Thanks for your contribution. For this PR, do we need to update docs?

(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

This is bug fix, no need to add docs.

@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Sep 2, 2021
@sijie sijie added this to the 2.9.0 milestone Sep 2, 2021
@sijie sijie added area/admin release/2.7.4 release/2.8.2 type/bug The PR fixed a bug or issue reported a bug labels Sep 2, 2021
@sijie sijie merged commit 9bfb3db into apache:master Sep 2, 2021
@zhanghaou zhanghaou deleted the fix-get-message-by-id branch September 2, 2021 02:04
+ "the ledgerId does not belong to this topic.",
clientAppId(), ledgerId, entryId, topicName);
asyncResponse.resume(new RestException(Status.NOT_FOUND,
"Message not found, the ledgerId does not belong to this topic"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a 'return' here

Let me send a fix up patch

eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Sep 2, 2021
Fix apache#11814 , if we use another topic to find the message, it will return the message, but we may contaminate the ledgers cache in the topic.

**changes**
Add check in the method 'internalGetMessageById' in PersistentTopicsBase, if the ledgerId not belong to this topic, throw a exception.

(cherry picked from commit 9bfb3db)
eolivelli pushed a commit to datastax/pulsar that referenced this pull request Sep 2, 2021
Fix apache#11814 , if we use another topic to find the message, it will return the message, but we may contaminate the ledgers cache in the topic.

**changes**
Add check in the method 'internalGetMessageById' in PersistentTopicsBase, if the ledgerId not belong to this topic, throw a exception.

(cherry picked from commit 9bfb3db)
hangc0276 pushed a commit that referenced this pull request Sep 3, 2021
Fix #11814 , if we use another topic to find the message, it will return the message, but we may contaminate the ledgers cache in the topic.

**changes**
Add check in the method 'internalGetMessageById' in PersistentTopicsBase, if the ledgerId not belong to this topic, throw a exception.

(cherry picked from commit 9bfb3db)
@hangc0276 hangc0276 added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Sep 3, 2021
@codelipenghui
Copy link
Contributor

Remove the release/2.7.4 label, #11913 already fixed the branch-2.7

bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
Fix apache#11814 , if we use another topic to find the message, it will return the message, but we may contaminate the ledgers cache in the topic.


**changes**
Add check in the method 'internalGetMessageById' in PersistentTopicsBase, if the ledgerId not belong to this topic, throw a exception.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.1 release/2.9.0 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pulsar admin] admin command 'get-message-by-id' can get message by messageId regardless of topic name
7 participants