question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug](indeviduallyDeleteMessage): slow rate consumer but ack in order will get indeviduallyDeleteMessage

See original GitHub issue

Describe the bug In my current test found, if i create a producer to produce with no dispatch limit while create a consumer to consumer with slow rate (set a 1 second sleep in message receive), although the the consumer acks in order but there is indeviduallyDeleteMessage in the topic.

And the weird thing is if i remove the 1 second sleep in consumer or i move the 1 second sleep from consumer to producer, there is no indeviduallyDeleteMessage in the topics. It looks like when the consumer is much slower than the producer, this issue will come.

This is the consume code i used, i add a delay for 1 second but the ack should be in order.

for true {
		msg, err := consumer.Receive(context.Background())
		if err != nil {
			log.Fatal(err)
		}
		fmt.Printf("Received message msgId: %#v -- content: '%s'\n",
			msg.ID(), string(msg.Payload()))
		consumer.Ack(msg)

		time.Sleep(time.Duration(1) * time.Second)
	}

To Reproduce Steps to reproduce the behavior:

  1. Start the producer without dispatch limit
  2. Start the consumer with 1 second limit to consume
  3. Stop the consumer after several consumes and acks are sent.
  4. Check the topic stats-internal and there is some indeviduallyDeleteMessage.

Expected behavior The ack is in order, there is no indeviduallyDeleteMessage in the topic.

Screenshots I use golang-client to produce and consume 截屏2021-11-12 上午12 36 32

keep on producing and stop the consumer after several consume with acks 截屏2021-11-12 上午12 37 05

Check the topic stats-internal and there is some indeviduallyDeleteMessage. 截屏2021-11-12 上午12 38 36

The test code i used pulsar-client-go-demo.zip

Additional context golang client and java client both tested with this issue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
gaozhangmincommented, Nov 12, 2021

I would like to help on it.

0reactions
hangc0276commented, Nov 28, 2021

This is the expected behavior. It was introduced by https://github.com/apache/pulsar/wiki/PIP-33%3A-Replicated-subscriptions

In order to support replicated subscription stats between different pulsar clusters, it will start subscription snapshot every 1 second by default if we enable this feature in consumer subscription replicateSubscriptionState(true).

The snapshot will write an internal mark into the topic message and will be filter out on message dispatch period. Thus you will see the messageId has been acked even though you haven’t ack the message yet. In fact, you will never receive this message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DeleteMessage - Amazon Simple Queue Service
Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another...
Read more >
Interest policy: nats server won't delete acked messages if ...
consumers are slower than inbound producer but ack messages normally within configured timeframe; messages get stacked up inside nats server ...
Read more >
Delete message after consuming it in KAFKA - Stack Overflow
Use a compacted topic so you can then delete any individual message you need via producer.send(key+GUID, null); Use a consumer interceptor to ...
Read more >
CLI Book 1: Cisco ASA Series General Operations CLI ...
Individual interfaces are normal routed interfaces, each with their own Local IP address. Because interface configuration must be configured ...
Read more >
Publication 1346 (Rev. 10-2012) - IRS
Record Layouts for Individual Income Tax Returns ... Any changes made after publication will be posted on www.irs.gov.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found