Skip to content

receiver_queue_size has no effect on partitioned topics, but is allowed #15702

Closed

Description

@zbentley

Describe the bug

Setting the receiver_queue_size kwarg to subscribe in the Python client has no effect when a partitioned topic is in use.

These docs indicate that this argument is not supported with partitioned topics, but nothing at runtime indicates an invalid argument. If this is an invalid configuration, then it should cause subscribe to throw an error.

To Reproduce

  1. Run the reproduction plan for max_total_receiver_queue_size_across_partitions does not work pulsar-client-python#190, but replace max_total_receiver_queue_size_across_partitions in the Python snippet with receiver_queue_size.
  2. Observe that the bug in that issue still manifests.

Expected behavior

  • If receiver_queue_size does not have any effect when used with a partitioned topic, its presence in a subscribe call for a partitioned topic should raise an error.
  • If receiver_queue_size does work with partitioned topics, these docs should be updated.
  • If receiver_queue_size does work with partitioned topics, its interaction with max_total_receiver_queue_size_across_partitions should be documented in the API reference for Pulsar client libraries.

Environment:
Same as the environment for apache/pulsar-client-python#190

Activity

  1. added
    type/bug
    on May 21, 2022
  2. codelipenghui commented on May 22, 2022

    @codelipenghui
    Contributor

    @zbentley The queue size of a partitioned topic consumer will be limited by both the receiver_queue_size and max_total_receiver_queue_size_across_partitions.

    As mentioned here apache/pulsar-client-python#190, it's not a receiver queue size-related issue. it's a pulsar's problem with batch message processing. The batch is for improving the throughput, and reduce the CPU overhead, so the broker side will not split the batch.

  3. zbentley commented on May 22, 2022

    @zbentley
    ContributorAuthor

    @codelipenghui I don't think this is affected by batching being enabled or disabled; see my reply to your other comment.

    Additionally, when you say:

    The queue size of a partitioned topic consumer will be limited by both the receiver_queue_size and max_total_receiver_queue_size_across_partitions

    How do those two settings interact? That should be documented. I.e. if I have receiver_queue_size=0 and max_total_receiver_queue_size_across_partitions=10, what is the result? What about 10 and 0? 10 and 10?

    Additionally, these docs are incorrect; they say:

    ... restricting the receiver queue size of consumers ... cannot be used with partitioned topics.

  4. codelipenghui commented on May 23, 2022

    @codelipenghui
    Contributor

    @zbentley

    Yes, looks like the doc is incorrect

    How do those two settings interact?

    Here is the code snippet

     config.setReceiverQueueSize(
            std::min(conf_.getReceiverQueueSize(),
                     (int)(conf_.getMaxTotalReceiverQueueSizeAcrossPartitions() / getNumPartitions())));
    

    I.e. if I have receiver_queue_size=0 and max_total_receiver_queue_size_across_partitions=10, what is the result? What about 10 and 0? 10 and 10?

    For a partitioned topic, not able to set the receiver queue size to 0 as I mentioned here apache/pulsar-client-python#43

  5. zbentley commented on May 26, 2022

    @zbentley
    ContributorAuthor

    @codelipenghui thanks! Could that min formula be added to the documentation? It's non-obvious at present.

  6. added
    doc-required
    on May 30, 2022
  7. codelipenghui commented on May 30, 2022

    @codelipenghui
    Contributor

    @zbentley Yes, I have added doc-required label, the document team will improve the document.

  8. github-actions commented on Jun 29, 2022

    @github-actions

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Staledoc-requiredtype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions