You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Technoboy- (via GitHub)" <gi...@apache.org> on 2023/08/16 09:31:34 UTC

[GitHub] [pulsar] Technoboy- opened a new pull request, #20990: [fix][broker] Fix incorrect unack msk count when dup ack a message

Technoboy- opened a new pull request, #20990:
URL: https://github.com/apache/pulsar/pull/20990

   Fixes #19268
   
   ### Modifications
   
   When pendingAck not contains the message, it means the msg has been removed, so it can't update the unack msg count..
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   
   


-- 
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] congbobo184 commented on a diff in pull request #20990: [fix][broker] Fix incorrect unack msk count when dup ack a message

Posted by "congbobo184 (via GitHub)" <gi...@apache.org>.
congbobo184 commented on code in PR #20990:
URL: https://github.com/apache/pulsar/pull/20990#discussion_r1294135632


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java:
##########
@@ -1666,4 +1666,29 @@ public void testIsSystemTopicAllowAutoTopicCreationAsync() throws Exception {
         assertTrue(brokerService.isAllowAutoTopicCreationAsync(
                 "persistent://pulsar/system/my-system-topic").get());
     }
+
+    @Test
+    public void testDuplicateAcknowledgement() throws Exception {
+        final String ns = "prop/ns-test";
+
+        admin.namespaces().createNamespace(ns, 2);
+        final String topicName = "persistent://prop/ns-test/duplicated-acknowledgement-test";
+        @Cleanup
+        Producer<byte[]> producer = pulsarClient.newProducer()
+                .topic(topicName)
+                .create();
+        @Cleanup
+        Consumer<byte[]> consumer1 = pulsarClient.newConsumer()
+                .topic(topicName)
+                .subscriptionName("sub-1")

Review Comment:
   ```
                   .isAckReceiptEnabled(true)
   ```
   add this config, otherwise, it will lead to test instability.



-- 
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] Technoboy- merged pull request #20990: [fix][broker] Fix incorrect unack msk count when dup ack a message

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- merged PR #20990:
URL: https://github.com/apache/pulsar/pull/20990


-- 
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] codecov-commenter commented on pull request #20990: [fix][broker] Fix incorrect unack msk count when dup ack a message

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #20990:
URL: https://github.com/apache/pulsar/pull/20990#issuecomment-1680379740

   ## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/20990?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#20990](https://app.codecov.io/gh/apache/pulsar/pull/20990?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (fdac917) into [master](https://app.codecov.io/gh/apache/pulsar/commit/63d9eaf974d0acf59ea8fa11cc75c08b784cd38d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (63d9eaf) will **increase** coverage by `0.01%`.
   > Report is 3 commits behind head on master.
   > The diff coverage is `65.38%`.
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/20990/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/20990?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #20990      +/-   ##
   ============================================
   + Coverage     36.92%   36.94%   +0.01%     
   - Complexity    12187    12229      +42     
   ============================================
     Files          1698     1698              
     Lines        129846   129857      +11     
     Branches      14163    14163              
   ============================================
   + Hits          47947    47975      +28     
   + Misses        75570    75554      -16     
   + Partials       6329     6328       -1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | inttests | `24.29% <38.46%> (+0.14%)` | :arrow_up: |
   | systests | `25.13% <42.30%> (-0.02%)` | :arrow_down: |
   | unittests | `32.18% <61.53%> (+0.10%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files Changed](https://app.codecov.io/gh/apache/pulsar/pull/20990?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...rg/apache/pulsar/compaction/TwoPhaseCompactor.java](https://app.codecov.io/gh/apache/pulsar/pull/20990?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NvbXBhY3Rpb24vVHdvUGhhc2VDb21wYWN0b3IuamF2YQ==) | `69.95% <58.33%> (-0.23%)` | :arrow_down: |
   | [...g/apache/pulsar/client/impl/RawBatchConverter.java](https://app.codecov.io/gh/apache/pulsar/pull/20990?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL1Jhd0JhdGNoQ29udmVydGVyLmphdmE=) | `75.32% <66.66%> (+1.64%)` | :arrow_up: |
   | [...ava/org/apache/pulsar/broker/service/Consumer.java](https://app.codecov.io/gh/apache/pulsar/pull/20990?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zZXJ2aWNlL0NvbnN1bWVyLmphdmE=) | `63.47% <72.72%> (-1.09%)` | :arrow_down: |
   
   ... and [58 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/20990/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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] Technoboy- closed pull request #20990: [fix][broker] Fix incorrect unack msk count when dup ack a message

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed pull request #20990: [fix][broker] Fix incorrect unack msk count when dup ack a message
URL: https://github.com/apache/pulsar/pull/20990


-- 
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


Re: [PR] [fix][broker] Fix incorrect unack msk count when dup ack a message [pulsar]

Posted by "shibd (via GitHub)" <gi...@apache.org>.
shibd commented on PR #20990:
URL: https://github.com/apache/pulsar/pull/20990#issuecomment-1773978131

   @Technoboy- Can you help create a PR to cherry-pick this change to `branch-2.11`?


-- 
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] Technoboy- commented on a diff in pull request #20990: [fix][broker] Fix incorrect unack msk count when dup ack a message

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on code in PR #20990:
URL: https://github.com/apache/pulsar/pull/20990#discussion_r1294159085


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java:
##########
@@ -1666,4 +1666,29 @@ public void testIsSystemTopicAllowAutoTopicCreationAsync() throws Exception {
         assertTrue(brokerService.isAllowAutoTopicCreationAsync(
                 "persistent://pulsar/system/my-system-topic").get());
     }
+
+    @Test
+    public void testDuplicateAcknowledgement() throws Exception {
+        final String ns = "prop/ns-test";
+
+        admin.namespaces().createNamespace(ns, 2);
+        final String topicName = "persistent://prop/ns-test/duplicated-acknowledgement-test";
+        @Cleanup
+        Producer<byte[]> producer = pulsarClient.newProducer()
+                .topic(topicName)
+                .create();
+        @Cleanup
+        Consumer<byte[]> consumer1 = pulsarClient.newConsumer()
+                .topic(topicName)
+                .subscriptionName("sub-1")

Review Comment:
   fixed



-- 
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