apache / apache/pulsar

Ignoring flow control message when resetCursorInProgress=TRUE

Open
#14,559 6 comments 0 reactions 1 assignee Claimed by @wenbingshen View on GitHub
lifecycle/stale Stale type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

**Describe the bug**

1. Our broker is highly busy
![image](https://user-images.githubusercontent.com/35599757/156730401-5968b62f-5ce0-4c43-ad3f-04f7433855ec.png)

2. Our business uses `Reader` for consumption, in which `seek` operations are often performed.
3. In the `seek` operation of pulsar, there will be a process of actively disconnecting the consumer and canceling the currently reading operation.
image

4. Next, whether the `seek` operation is completed or not, the client has the right to subscribe the subscription.
image

5. Because the server thread pool is busy, the `seek` operation is delayed. The client first subscribed a subscription and initiates a `FLOW` request, causing the broker to start reading data.
image

6. Next, the seek operation is completed, and the positions of `md position` and `rd position` are reset to the seek position.
image

7. Then, the read operation is completed, after the data is sent to the client, the client executes ack, and md and rd are set to a certain position of the message read by the client.
image

8. Next, the seek operation is completed, and the positions of `md position` and `rd position` are reset to the seek position.
image

9. Then, the read operation is completed, after the data is sent to the client, the client executes ack, and md and rd are set to a certain position of the message read by the client.
image

The entire execution flow is shown in the following figure:
![image](https://user-images.githubusercontent.com/35599757/156738780-025f94c9-c016-4c1c-b2ba-a0e5b7a59e38.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.