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

Pulsar SQL is not able to read the latest message #3828

Closed
sijie opened this issue Mar 15, 2019 · 9 comments
Closed

Pulsar SQL is not able to read the latest message #3828

sijie opened this issue Mar 15, 2019 · 9 comments
Assignees
Labels
area/sql Pulsar SQL related features release/2.5.2 type/bug The PR fixed a bug or issue reported a bug
Milestone

Comments

@sijie
Copy link
Member

sijie commented Mar 15, 2019

Describe the bug

Pulsar SQL is always lacking one message when querying pulsar topics.

Expected behavior

"read-my-write" semantic.

if I write a bunch of messages to pulsar topics, and issue a query after "my-write", I should be able to query all the messages I written.

Reason

The problem is due to broker doesn't advance LAC, so when pulsar sql bypasses broker to query the data, it can only read entries up to the LAC that all the bookies learned.

Fixes

Enable periodically write lac on broker.

@sijie sijie added type/bug The PR fixed a bug or issue reported a bug area/sql Pulsar SQL related features labels Mar 15, 2019
@jerrypeng
Copy link
Contributor

@sijie yup have discussed this issue before with @merlimat but we decided not to take any action at that time because we reasoned that Pulsar is a streaming system thus we expect users to continuously pump data into pulsar and not just one time batch thus this wouldn't be an issue since LAC will eventually get updated if there is continuous data

@sijie
Copy link
Member Author

sijie commented Mar 15, 2019

@jerrypeng this is not just about not being able to read the event, but also about the latency (how fast it can query the data). current assumption is assuming there are are events "eventually" arrive and advance the LAC, which will significantly delay the messages being visible to users if the events are delayed. so I think we still need to enable explicit write lac on broker, so the lac will be advanced within a SLA.

The feature is already in bookkeeper. It is just a matter to enable it and make sure it is working as expected. If pulsar broker doesn't want this feature to be turned on by default, we can make it configurable and turned off by default. If people want this feature, they can turn it on. I don't think we should just ignore this fact and try to explain to people who don't really understand how the underlying stuff works.

@sijie sijie added this to the 2.3.1 milestone Mar 15, 2019
@jerrypeng
Copy link
Contributor

@sijie I totally agree we should add something like this. I was just presenting some previous thoughts we have had on this problem.

@sijie sijie assigned sijie and unassigned sijie Mar 15, 2019
@merlimat
Copy link
Contributor

Yes, we should have a way to configure the explicit LAC update on the topics and have some reasonable default.

Though, should this be for 2.3.1? I think it would more be appropriate for 2.4 since it's not a bug.. but rather a current limitation.

@sijie
Copy link
Member Author

sijie commented Mar 27, 2019

@merlimat we can move this to 2.4.0

@atris
Copy link

atris commented Jan 23, 2020

Hi, If nobody is working on this, can I please be assigned this?

@sijie
Copy link
Member Author

sijie commented Jan 24, 2020

@atris the bookkeeper change has made to Pulsar. #5822 is enabling the explicit lac configuration. once that is fixed, this task is done.

codelipenghui added a commit that referenced this issue Feb 10, 2020
### Motivation

Expose bookkeeper expose explicit lac configuration in broker.conf
It's related to #3828 #4976, some Pulsar SQL users need to enable the explicitLacInterval, so that they can get the last message in Pulsar SQL.
@codelipenghui codelipenghui self-assigned this Feb 10, 2020
@codelipenghui codelipenghui added this to the 2.6.0 milestone Feb 10, 2020
@codelipenghui
Copy link
Contributor

close via #5822

tuteng pushed a commit to AmateurEvents/pulsar that referenced this issue Feb 23, 2020
### Motivation

Expose bookkeeper expose explicit lac configuration in broker.conf
It's related to apache#3828 apache#4976, some Pulsar SQL users need to enable the explicitLacInterval, so that they can get the last message in Pulsar SQL.
tuteng pushed a commit to AmateurEvents/pulsar that referenced this issue Mar 21, 2020
### Motivation

Expose bookkeeper expose explicit lac configuration in broker.conf
It's related to apache#3828 apache#4976, some Pulsar SQL users need to enable the explicitLacInterval, so that they can get the last message in Pulsar SQL.

(cherry picked from commit 4fd17d4)
tuteng pushed a commit that referenced this issue Apr 13, 2020
### Motivation

Expose bookkeeper expose explicit lac configuration in broker.conf
It's related to #3828 #4976, some Pulsar SQL users need to enable the explicitLacInterval, so that they can get the last message in Pulsar SQL.

(cherry picked from commit 4fd17d4)
jiazhai pushed a commit to jiazhai/pulsar that referenced this issue May 18, 2020
### Motivation

Expose bookkeeper expose explicit lac configuration in broker.conf
It's related to apache#3828 apache#4976, some Pulsar SQL users need to enable the explicitLacInterval, so that they can get the last message in Pulsar SQL.
(cherry picked from commit 4fd17d4)
@codelipenghui
Copy link
Contributor

This issue is fixed by #6908 and #6908 is released in 2.5.2, So I add release/2.5.2 tag for this issue.

huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this issue Aug 24, 2020
### Motivation

Expose bookkeeper expose explicit lac configuration in broker.conf
It's related to apache#3828 apache#4976, some Pulsar SQL users need to enable the explicitLacInterval, so that they can get the last message in Pulsar SQL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql Pulsar SQL related features release/2.5.2 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

5 participants