Skip to content

[Bug] [Non-persistent topic] Pulsar broker delete the whole subscription after trigger delete only one consumer from that subscription for the non-persistent topic #23993

Open
@mrd09

Description

@mrd09

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

apachepulsar/pulsar-all:3.0.2
apachepulsar/pulsar-all:3.0.9

java pulsar client app 3.2.2 run in k8s

Minimal reproduce step

  • start app with 1 replicas in k8s, cover this logic:
  1. create non-persistent topic or use allowAutoTopicCreation: "true" and allowAutoTopicCreationType: "non-partitioned"
  2. create subscription Shared type
  3. create consumer in the sub
  • scale app to 2 replicas => there 2 consumer create:
# pulsarctl $TLS_OPTS topics stats non-persistent://public/Test/TestRequest
"subscriptions": {
    "TestRequest": {
     ....
      "type": "Shared",
      "consumers": [
        {
          "availablePermits": 1000,
          "unackedMessages": 0,
          "msgRateOut": 0,
          "msgThroughputOut": 0,
          "msgRateRedeliver": 0,
          "consumerName": "8420b7f1",
          "metadata": {}
        },
        {
          "availablePermits": 1000,
          "unackedMessages": 0,
          "msgRateOut": 0,
          "msgThroughputOut": 0,
          "msgRateRedeliver": 0,
          "consumerName": "dd825dce",
          "metadata": {}
        }
      ]
    }
  • scale down app to 1 replicas => from broker logs, the scale down replicas consumer is removed from subscription
  • then do recheck the broker non-persistent topic see that the subscription is gone as soon as the replica is scale down:
# pulsarctl $TLS_OPTS topics stats non-persistent://public/Test/TestRequest
  "subscriptions": {},

What did you expect to see?

I expected

  • the subscription still there
  • only one of the consumer in the subscription is removed from the non-persistent topic as 1 replicas from app is scale down

What did you see instead?

I see:

  • the subscription from the non-persistent topic is gone
  • so the left up running replicas falling into fail state when the sub and consumer is gone

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions