You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/05/07 00:21:16 UTC

[GitHub] [pulsar] mattisonchao opened a new pull request, #15479: [improve][client] Stop flush ack when the client reconnects.

mattisonchao opened a new pull request, #15479:
URL: https://github.com/apache/pulsar/pull/15479

   ### Motivation
   
   Current, we use PersistentAcknowledgmentsGroupingTracker#isDuplicate to do our best effort to deduplicate messages.
   the original comments as below:
   
   ```
   Since the ack are delayed, we need to do some best-effort duplicate check to discard messages that are being
   resent after a disconnection and for which the user has already sent an acknowledgement.
   ```
   
   Following this principle, we can improve our logic in ack flush. when the consumer state is not ready, we don't need to flush the ack to the wrong broker. which can help `isDuplicate` be more effective in some cases.
   
   
   ### Modifications
   
   - If the consumer state is not `ready`, we don't need to flush the ack.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   ### Documentation
   
   - [x] `no-need-doc` 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] mattisonchao closed pull request #15479: [improve][client] Stop flush ack when the client reconnects.

Posted by GitBox <gi...@apache.org>.
mattisonchao closed pull request #15479: [improve][client] Stop flush ack when the client reconnects.
URL: https://github.com/apache/pulsar/pull/15479


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] poorbarcode commented on pull request #15479: [improve][client] Stop flush ack when the client reconnects.

Posted by GitBox <gi...@apache.org>.
poorbarcode commented on PR #15479:
URL: https://github.com/apache/pulsar/pull/15479#issuecomment-1120124366

   > Do you mean we prevent the flush when consumers close?
   
   When close consumer, will trig flush once:
   
   https://github.com/apache/pulsar/blob/9b4df2cb528f6cacb9ddc85348480989c34629c4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java#L571-L576
   
   https://github.com/apache/pulsar/blob/9b4df2cb528f6cacb9ddc85348480989c34629c4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1028-L1031


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] poorbarcode commented on pull request #15479: [improve][client] Stop flush ack when the client reconnects.

Posted by GitBox <gi...@apache.org>.
poorbarcode commented on PR #15479:
URL: https://github.com/apache/pulsar/pull/15479#issuecomment-1120105589

   This may lead to an increased probability of repeated consumption (the client can stop at any time, resulting in the loss of requests already submitted by the user). We should do our best to ensure that all ACKS are handled correctly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] mattisonchao commented on pull request #15479: [improve][client] Stop flush ack when the client reconnects.

Posted by GitBox <gi...@apache.org>.
mattisonchao commented on PR #15479:
URL: https://github.com/apache/pulsar/pull/15479#issuecomment-1120120255

   Hi, @poorbarcode 
   
   Do you mean we prevent the flush when consumers close?
   I think we could add a parameter like if allowed force flush like this to solve this problem.
   `flush(Boolean force)`
   But I don't think it's worth modifying other methods because of this small optimization. So, I close this PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org