Skip to content

Endless Topic HTTP Request Redirects #13946

Closed

Description

@rfmyuk

Describe the bug
Admin REST HTTP Request on topic may redirect multiple times to different broker endlessly.

This bug occurs randomly and at inconsistent times.

(The HTTP request must be related to topic ownership, e.g. get topic subscription, stats, etc...)

To Reproduce
Steps to reproduce the behavior:

  1. Setup a Pulsar Cluster with 3 BookKeepers, 3 Global ZooKeepers, 3 ZooKeepers and 3 Brokers, and add JWT Authentication.
  2. Open Postman (or any HTTP Client) and disable "Automatically follow redirects" in Settings.
  3. Have the cluster up for a while (can be hours/days).
  4. Send an HTTP request to create a topic.
  5. If you get a redirect, follow the redirect (send the request to the IP in the "Location" header).
  6. Keep following the redirects and you never get a response.

I used this broker.conf.

If you enable automatically follow redirects, the request will eventually return unauthorized 401 even though I provide a valid JWT that works with other non-topic related requests.

Shutting down 2 brokers (out of 3), inevitbly resolves the issue since there would be only one topic owner.

Expected behavior
I expect the redirects to eventually give me a broker that has the response for my request.

Desktop (please complete the following information):

  • OS: CentOS 7

Additional context
Pulsar Version: 2.8.2 - 2.8.3 (may affect more versions, not tested)

As requested by @lhotari
jstack dumps:
Bugged when 3 brokers are up:

Not bugged when 1 broker is up:

Activity

  1. added
    type/bug
    on Jan 25, 2022
  2. mattisonchao commented on Jan 26, 2022

    @mattisonchao
    Member

    I think i can help with it.

  3. rfmyuk commented on Jan 31, 2022

    @rfmyuk
    ContributorAuthor

    @mattisonchao Are there any updates related to this issue?

  4. lhotari commented on Jan 31, 2022

    @lhotari
    Member

    @ronfarkash Do you use the Pulsar Proxy?

  5. rfmyuk commented on Jan 31, 2022

    @rfmyuk
    ContributorAuthor

    @ronfarkash Do you use the Pulsar Proxy?

    No, 3 brokers and I send requests directly to them.

  6. rfmyuk commented on Feb 27, 2022

    @rfmyuk
    ContributorAuthor

    @mattisonchao Asking again if there is anything in the works for this issue?

  7. eolivelli commented on Feb 27, 2022

    @eolivelli
    Contributor

    It it not clear to me which API has the problem.
    Do we have a simple reproducer?

  8. eolivelli commented on Feb 27, 2022

    @eolivelli
    Contributor

    Which pulsar version?

  9. rfmyuk commented on Feb 27, 2022

    @rfmyuk
    ContributorAuthor

    It it not clear to me which API has the problem. Do we have a simple reproducer?

    Admin Rest API v2, as stated in the issue, if the HTTP request is related to topic ownership, it can start happening, and when it does start happening, a broker reset is required.

    Which pulsar version?

    Stated above, 2.8.2

  10. eolivelli commented on Feb 27, 2022

    @eolivelli
    Contributor

    Thank you very much for your answers.
    Do you see loads in the broker about bundle unloading or bundle splitting related to that namespace?

    There were (and probably still they are) problems with unloading. Last week I was investigating some of these problems in case of OOM during bundle unloading.

  11. rfmyuk commented on Feb 28, 2022

    @rfmyuk
    ContributorAuthor

    Thank you very much for your answers. Do you see loads in the broker about bundle unloading or bundle splitting related to that namespace?

    There were (and probably still they are) problems with unloading. Last week I was investigating some of these problems in case of OOM during bundle unloading.

    I am not entirely sure if bundle unloading/splitting is the cause of the issue since I have not noticed any OOM problems, it almost seems random.

    To my knowledge, there are multiple topic metadata & ownership issues that were being worked on, but sadly I am unaware of their status and have a hard time catching up due to busy schedule.

  12. github-actions commented on Mar 31, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

  13. mattisonchao commented on Mar 31, 2022

    @mattisonchao
    Member

    @ronfarkash
    Sorry for the late reply, I will check it and try to reproduce it.

  14. rfmyuk commented on Apr 9, 2022

    @rfmyuk
    ContributorAuthor

    This issue was still not fixed by 2.8.3 so as requested by @lhotari
    jstack dumps:
    Bugged when 3 brokers are up:

    Not bugged when 1 broker is up:

    I made Broker 1 work forcibly by shutting down the two other brokers therefore Broker 1 can't direct me to brokers which are down.

  15. rfmyuk commented on Apr 11, 2022

    @rfmyuk
    ContributorAuthor

    @mattisonchao added some more information on how to attempt to reproduce the issue.

  16. lhotari commented on Apr 27, 2022

    @lhotari
    Member

    @ronfarkash What type of deployment is this? Is it a Kubernetes deployment?

  17. rfmyuk commented on Apr 27, 2022

    @rfmyuk
    ContributorAuthor

    @ronfarkash What type of deployment is this? Is it a Kubernetes deployment?

    Microsoft Azure VMs.

  18. self-assigned this
    on May 6, 2022
  19. mattisonchao commented on May 30, 2022

    @mattisonchao
    Member

    Hi, @ronfarkash
    When you get a new address, you need to make authoritative=true.

    If you open the Automatically follow redirects, the broker will help you do that thing when redirected.

  20. shaniMaayan commented on Jun 13, 2022

    @shaniMaayan

    Hi @mattisonchao, i am working with @ronfarkash,
    thank u for your help but sadly your recommendation did not solve the problem for us, we are getting a lot of redirect (sometime above 10,000 and probably endless, this is the limit we tested).
    do u have more configuration to try , or do u need any more info to continue helping us.

  21. mattisonchao commented on Oct 20, 2022

    @mattisonchao
    Member

    Hi, @shaniMaayan

    Would you like to check PR #17401? it probably fixes this problem.

    I will close this PR and I will reopen it when the problem appears again.

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

Metadata

Metadata

Assignees

Labels

area/admintype/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions