Skip to content

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

Closed

Description

@sijie

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.

Activity

  1. added
    type/bug
    area/sql
    on Mar 15, 2019
  2. jerrypeng commented on Mar 15, 2019

    @jerrypeng
    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

  3. sijie commented on Mar 15, 2019

    @sijie
    MemberAuthor

    @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.

  4. added this to the 2.3.1 milestone on Mar 15, 2019
  5. jerrypeng commented on Mar 15, 2019

    @jerrypeng
    Contributor

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

  6. assigned and unassigned on Mar 15, 2019
  7. merlimat commented on Mar 19, 2019

    @merlimat
    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.

  8. sijie commented on Mar 27, 2019

    @sijie
    MemberAuthor

    @merlimat we can move this to 2.4.0

  9. modified the milestones: 2.3.1, 2.4.0 on Mar 27, 2019
  10. removed this from the 2.4.0 milestone on Jun 9, 2019
  11. atris commented on Jan 23, 2020

    @atris

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

  12. sijie commented on Jan 24, 2020

    @sijie
    MemberAuthor

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

  13. added this to the 2.6.0 milestone on Feb 10, 2020
  14. codelipenghui commented on Feb 10, 2020

    @codelipenghui
    Contributor

    close via #5822

  15. codelipenghui commented on May 19, 2020

    @codelipenghui
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/sqlrelease/2.5.2type/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions