pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[Enhancement] Support negative acknowledgement (nack) with Key_Shared subscriptions while preserving ordering

Open lhotari opened this issue 1 year ago • 0 comments

Search before asking

  • [X] I searched in the issues and found nothing similar.

Motivation

Key_Shared subscriptions don't currently support negative acknowledgements (nack). Consumers can get stuck with Key_Shared subscriptions in all previous versions of Pulsar before 4.0.0. With Pulsar 4.0.0, the consumers will no longer get stuck due to using nacks. This has been addressed with PIP-379: Key_Shared Draining Hashes for Improved Message Ordering improvements. However, in Pulsar 4.0.0, the nacked messages will get relivered after a delay without considering the ordering. There's a need to also preserve ordering when using nacks in Key_Shared subscriptions.

Solution

Make changes in the Pulsar broker and clients to hold back any further messages for a particular key when negative acknowledgement has been issued for a message. Messages should be held back until the original message gets redelivered. This might require changes in the Pulsar binary protocol.

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

lhotari avatar Oct 18 '24 07:10 lhotari