-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Delayed acks impl #1462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delayed acks impl #1462
Conversation
2165444 to
9d28ea1
Compare
|
Rebased to master |
4c8d1a0 to
c0659d1
Compare
|
retest this please |
|
@merlimat this is not a backward compatible change with old broker (version < 2.0) because, old brokers don't understand group-ack command so, combination of new-client (>=2.0) and old-broker will not work and it can create ack-holes for the client. also I think we were making sure that we don't break backward compatibility so, If client uses new version and if it requires to rollback broker version then it can not create an issue here. Any thoughts to fix this issue? |
|
can we add |
|
@merlimat any update on it? |
|
@rdhabalia The code should already be sending 1 single ack if the broker is < 2.0 : https://github.com/apache/incubator-pulsar/blob/233c77fca1ac1bfbc439c2246a45673ff366bfc3/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java#L171 with the check validating for Let me verify that the repeated field, when 1 single entity is present, is equivalent to the "required" type. |
|
@rdhabalia I did the test by using :
I could no reproduce the issue. There are no unacked messages. Do you have a better way to reproduce? |
I see, I missed it to check. I think the issue is that I have cherry-picked ActiveConsumerListener-change into broker-1.22 to support function on broker-1.22 and this PR upgraded pulsar-broker version= |
Motivation
This PR is based on top of #1450. I'll rebase once first one is merged.
The processing of acknowledgments constitutes is broker a big chunk of CPU work. Even then, we throttle the persistence of acks to BK (default is once per sec).
In addition to that, acknowledgments generates a large number of very small IP packets and these are most expensive to process by OS/NIC (compared to fewer bigger packets).
This change introduces client side batching for acknowledgments. By default client, will group the acks and send out a single protobuf command every 100ms. Consumer can configure the delay, or set it to 0 to fall back to original behavior.